Update project4 madness#6
Conversation
| FILTER (REGEX(STR(?id), “Batman_films_casts”, “I”)) | ||
| } | ||
|
|
||
| Kata Level 6 – 6 points |
There was a problem hiding this comment.
This seems to work but if we already know that Bell invented the telephone when we look for him in the regex query, why write a query in the first place? I think the query should work in any case without using the regex function in any case
There was a problem hiding this comment.
Thank you for your note! I will remove the regex function
| It is your responsibility and the responsibility of your peers reviewing your submission in PR to determine whether your submission is ranked appropriately. In the event that consensus is reached that your kata is ranked inappropriately, you must work with your peers to revise the submission so that it is either more or less challenging, accordingly. You are not permitted to submit new problems with different strengths after PRs are open, but must instead revise your PRs. So, think hard about how challenging your submission is. | ||
|
|
||
| There is one other option for those desiring a different sort of challenge. If you provide alongside your SPARQL submission a translation of the same problem into SQL, complete with documentations, solution, etc. then you may receive half points extra at that kata level (rounded up). For example, if you submit a SPARQL problem that is kata rank 1 and also submit a SQL version of that same problem, you will receive 35+18=53 points. | ||
|
|
There was a problem hiding this comment.
I apologize for sending my review just now, I completely missed the notification from github. If this happens again, please feel free to notify me in any other way.
| ?film dbo:starring ?act . | ||
| ?film dbo:wikiPageRedircts dbr:Batman_(film_series) . | ||
| ?actor dbo:wikiPageID ?id . | ||
| FILTER (REGEX(STR(?id), “Batman_films_casts”, “I”)) |
There was a problem hiding this comment.
I am not entirely sure about this line. As I read it, you are asking the id to contain the term "Batman_films_casts", but this doesn't seem to be something that is stored in an id.
I also believe there might be a typo on line 55, where you have "starring ?act" (I was guessing it was ?actor, but of course I may be wrong).
There was a problem hiding this comment.
I chose starring ?act because there could be multiple actors in a given project but the starring act would be the star of the film. I could change it to lead ?act. Additionally, I am hesitant to use actor as there is a big push in hollywood to call all actors actors -- not discriminate between male/non-binary/female etc.. so the starring act can account for this shift.... I hope lol
There was a problem hiding this comment.
Oh yeah you can definitely use the term you believe fits best in this situation (sorry for not recognising what was going on), my issue was that you probably want it to be the same term you then use in line 57, where you wrote ?actor, since it seems you want to refer to the same entity
| SELECT DISTINCT ?class | ||
| WHERE { | ||
| ?s a ?class . | ||
| FILTER (strstarts(str(?class), http://dbpedia.org/ontology/)) |
There was a problem hiding this comment.
You probably don't even need the FILTER clause, and this will be a perfect easy level 8
|
|
||
| CONSTRUCT { | ||
| ?book rdf:type dc:Book ; | ||
| dc:title >?title ; |
There was a problem hiding this comment.
Good catch ! Thank you!!
| ?otherBook rdf:type dc:Book ; | ||
| dc:creator ?author ; | ||
| genre:ScienceFicton ?genre . | ||
| Filter (?otherBook !=?book) |
There was a problem hiding this comment.
Let's say that an author has written only one book, of genre science fiction. I wonder whether it would fall outside of the scope of this query, because it doesn't have an ?otherbook.
It is probably easier to rewrite the question than to rewrite the query. As I see it now, it seems to ask for all the authors that have at least two books, at least one of which is a sci fi book.
There was a problem hiding this comment.
Second this. Maybe you should use a OPTIONAL keyword to deal with ?otherbook, Delaney.
There was a problem hiding this comment.
I had not considered this. Thank you for pointing this out I will rewrite the question
| ^^<http://www.w3.org/2001/XMLSchema#date>) | ||
| } | ||
|
|
||
| Kata level 6? -- 19 points |
There was a problem hiding this comment.
I think it is a level 6, yes
| ORDER BY DESC(?publicationDate) | ||
| LIMIT 10 | ||
|
|
||
| Level 5? -- 21 points |
There was a problem hiding this comment.
This is ok but I would say it is a level 6, not a level 5. For a level 5 I am thinking of a bit more complex queries with multiple "tricks" (filter, regex, comparison of values, etc.)
There was a problem hiding this comment.
hmmm thank you. Maybe I can further complicate it...
peihongx
left a comment
There was a problem hiding this comment.
@dmcnulty27 Hi Delaney, I've finished my review of your kata changllenges. BTW, ZOMBIE movie (e.g. Shaun of the Dead) are my favorite type of horror films!
|
|
||
| Select Distinct ?actor WHERE { | ||
|
|
||
| ?film dbo:starring ?act . |
There was a problem hiding this comment.
Second Giacomo's comment: I tend to think here "?act" should be "?actor".
|
|
||
| ?actor dbo:wikiPageID ?id . | ||
|
|
||
| FILTER (REGEX(STR(?id), “Batman_films_casts”, “I”)) |
There was a problem hiding this comment.
I find you use "I" in regex() function. Do you care whether an ID string is in uppercase or lowercase? If not, maybe it is better to use "i". Also, I suspect whether this challenge is kata 7 because although you use a complex function in FILTER, but a reader may not notice it without reading your sample solution. After all, intuitively, it seems that a solution only need 2 substantive lines:
WHERE{?film :label "Batman".
?film dbo:starring ?actor
}
Maybe you can make it more complex, for example, by requesting women actors starrring Batman before 2000?
| Filter (regex(?name, “Bell”, “I”)) | ||
|
|
||
| } | ||
|
|
There was a problem hiding this comment.
Hi Delaney, it seems that you need to add a triple to emphasize that ?telephone is a telephone (as rdf:type). Otherwise, readers cannot know what type of device ?telephone is. (After all, technically speaking, ?telephone is not different from ?s.) Also, I suspect that this is a kata 8 because it is somewhat similar to Jaron's Buffalo Wing example in Goog Doc. Maybe you can make it more difficult by querying more info about telephone's inventor (e.g. his company, or his patents in telephone).
| PREFIX foaf: http://xmlns.com/foaf/0.1/ | ||
|
|
||
| Select ?name | ||
|
|
There was a problem hiding this comment.
Oh, you miss WHERE after "SELECT ..." BTW, I suggest to capitalize keywords like "filter", "select", "where" and so on in their all letters.
|
|
||
| Kata level 8 – 0 points | ||
|
|
||
| Return all classes -- (A is shorthand for rdfs; type) |
There was a problem hiding this comment.
"rdf:type" instead of "rdf;type"
| } | ||
|
|
||
|
|
||
| using dbpedia generate a sparql query using constructs query to create a graph about films featuring Sacha Baron Cohen |
There was a problem hiding this comment.
typo: "constructs" → “CONSTRUCT”
|
|
||
| using dbpedia generate a sparql query using constructs query to create a graph about films featuring Sacha Baron Cohen | ||
| Kata level 5 -- 87 points | ||
|
|
There was a problem hiding this comment.
Maybe you can construct data about the actors who cast together with Sacha Baron Cohen for at least 2 films, so this challenge can reach level 5 or higher.
|
|
||
|
|
||
|
|
||
| CONSTRUCT { |
There was a problem hiding this comment.
Consider making this challenge harder by constructing some new data different from those in WHERE.
|
|
||
| # Get Tim Curry's information | ||
|
|
||
| dbr:Tim_Curry dbo:occupation dbo:Actor ; |
There was a problem hiding this comment.
This triple has no variable. Do you really need it?
| } | ||
|
|
||
| ORDER BY DESC(?year) | ||
|
|
There was a problem hiding this comment.
Maybe you can add LIMIT 20 or something like this.
No description provided.