Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PREFIX dbpedia: <http://dbpedia.org/resource/>
- PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
- PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
- PREFIX nobel: <http://data.nobelprize.org/terms/>
- PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
- PREFIX owl: <http://www.w3.org/2002/07/owl#>
- #SELECT DISTINCT ?instance ?category ?laureate ?continent
- SELECT DISTINCT (COUNT(?instance) AS ?nr) ?continent
- WHERE {
- ?instance a nobel:LaureateAward.
- ?instance nobel:category ?category.
- ?instance nobel:laureate ?laureate.
- ?laureate dbpedia-owl:birthPlace ?birthPlace.
- ?birthPlace rdf:type dbpedia-owl:Country;
- owl:sameAs ?country
- {
- SELECT *
- WHERE {
- SERVICE <http://dbpedia.org/sparql>
- {
- ?country dbpedia-owl:abstract ?ABS.
- FILTER LANGMATCHES(LANG(?ABS),'en').
- BIND(
- IF(CONTAINS(?ABS,'Australia'),'Australia',
- IF(CONTAINS(?ABS,'South America')|| CONTAINS(?ABS,'Costa Rica')|| CONTAINS(?ABS,'Guatemala'),'South America',
- IF(CONTAINS(?ABS,'North America'),'North America',
- IF(CONTAINS(?ABS,'Asia'),'Asia',
- IF(CONTAINS(?ABS,'Africa'),'Africa',
- IF(CONTAINS(?ABS,'Europe') || CONTAINS(?ABS,'United Kingdom'),'Europe',
- 'N/A')))))) AS ?continent)
- }
- }
- }
- FILTER (
- ?category NOT IN (
- <http://data.nobelprize.org/resource/category/Literature>,
- <http://data.nobelprize.org/resource/category/Peace>
- ) &&
- ?continent IN ('Europe', 'Asia')
- )
- }
- GROUP BY ?continent
- ORDER BY ?instance
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement