From 38829719e873e0b3e8cbd3dc2c0840733c7f8a6c Mon Sep 17 00:00:00 2001 From: Arachnophobian <123899465+Arachnophobian@users.noreply.github.com> Date: Sat, 1 Apr 2023 16:08:09 -0400 Subject: [PATCH 1/2] Update README.md I've only created the two questions/answers so far, but I plan to try to make more if I can. --- Project 4/README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/Project 4/README.md b/Project 4/README.md index 4c5a27e8..e0bc6f03 100644 --- a/Project 4/README.md +++ b/Project 4/README.md @@ -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 {dbr:Barack_Obama} as the Subject. +Use {rdf:type} as the Predicate. + +ANSWER +PREFIX dbr: http://dbpedia.org/resource +PREFIX rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# + +SELECT ?Concept dbr:Barack_Obama +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 {dbr:Barack_Obama} as the Subject. +Be aware of plurals: you should return four entries. + + +Answer + +PREFIX dbr: http://dbpedia.org/resource +PREFIX rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# + +SELECT distinct ?Concept dbr:Barack_Obama +WHERE +{ + dbr:Barack_Obama a ?Concept . + FILTER (regex(?Concept, "cit","i")) +} + ORDER BY ?Concept + LIMIT 50 + From 517a8e1df3aca8330218a8d1186318a3c2de0df2 Mon Sep 17 00:00:00 2001 From: Arachnophobian <123899465+Arachnophobian@users.noreply.github.com> Date: Tue, 4 Apr 2023 09:17:42 -0400 Subject: [PATCH 2/2] Update README.md --- Project 4/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Project 4/README.md b/Project 4/README.md index e0bc6f03..e7d246eb 100644 --- a/Project 4/README.md +++ b/Project 4/README.md @@ -52,14 +52,14 @@ 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 {dbr:Barack_Obama} as the Subject. -Use {rdf:type} as the Predicate. +Use
dbr:Barack_Obamaas the Subject. +Use
rdf:typeas the Predicate. ANSWER PREFIX dbr: http://dbpedia.org/resource PREFIX rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# -SELECT ?Concept dbr:Barack_Obama +SELECT ?Concept WHERE { dbr:Barack_Obama a ?Concept . @@ -71,8 +71,8 @@ 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 {dbr:Barack_Obama} as the Subject. -Be aware of plurals: you should return four entries. +Use
dbr:Barack_Obamaas the Subject. +Be sure to account for both the plural and singular form of the word "city". Answer @@ -80,7 +80,7 @@ Answer PREFIX dbr: http://dbpedia.org/resource PREFIX rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# -SELECT distinct ?Concept dbr:Barack_Obama +SELECT distinct ?Concept WHERE { dbr:Barack_Obama a ?Concept .