Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jones project 4 #93

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 45 additions & 1 deletion Project 4/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,48 @@ You're probably thinking, "why would I submit a level 8 kata if they're not wort

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 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.



QUESTION 1 - Kata 8
Write a SPARQL query that provides all of the types of “things” under which Barack Obama is classified, according to DBpedia.

TIPS:
Use <pre>dbr:Barack_Obama</pre> as the Subject.
Use <pre>rdf:type</pre> as the Predicate.

ANSWER
PREFIX dbr: http://dbpedia.org/resource
PREFIX rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#

SELECT ?Concept
WHERE
{
dbr:Barack_Obama a ?Concept .
}



QUESTION 2 - Kata 6
Not all information on the internet is accurate information. To give an example of this, write a SPARQL query to check if Barack Obama is a city according to DBpedia. Limit the results to 50 and order them alphabetically. In addition, ensure there are no duplicate results and ensure that the results are case-independent.

TIPS:
Use <pre>dbr:Barack_Obama</pre> as the Subject.
Be sure to account for both the plural and singular form of the word "city".


Answer

PREFIX dbr: http://dbpedia.org/resource
PREFIX rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#

SELECT distinct ?Concept
WHERE
{
dbr:Barack_Obama a ?Concept .
FILTER (regex(?Concept, "cit","i"))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This filter would keep everything that Obama was a type of that included - roughly speaking - "cit" in its label, e.g. Obama is tacit. Was that your intent?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was my intent, yes, but I do realize that it might return anything that isn't a city too... still, I thought it would be sufficient to prove the point that not everything that is returned is actually about Obama.

}
ORDER BY ?Concept
LIMIT 50