geo1007-labinstructions

GEO1007 Lab 8 - Semantic Web and Linked Data

A. RCE linked data

prefix geo: <http://www.opengis.net/ont/geosparql#>
select ?pointLabel where {
  values (?pointLabel) {
    (
    "Point Nemo is the place in the ocean that is farthest from land"
    )
  }
}

See what comes back as response (look under: Table and Response).

prefix geo: <http://www.opengis.net/ont/geosparql#>
select * where {
  values (?point ?pointTooltip ?pointLabel ?pointColor) {
    ("Point (-123.393333 -48.876667)"^^geo:wktLiteral
    "Point Nemo"
    "Point Nemo is the place in the ocean that is farthest from land"
    "blue")
  }
}

❓ Question / Result #1.a
Summarize what is visible under the Geo tab and add in your report a description and screenshot of this.

prefix graph: <https://linkeddata.cultureelerfgoed.nl/graph/>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
prefix ceo: <https://linkeddata.cultureelerfgoed.nl/def/ceo#>
prefix skos: <http://www.w3.org/2004/02/skos/core#>
prefix rn: <https://data.cultureelerfgoed.nl/term/id/rn/>
prefix owms: <https://linkeddata.cultureelerfgoed.nl/graph/owms>

select DISTINCT 
  (iri(concat("https://monumentenregister.cultureelerfgoed.nl/monumenten/", ?rijksmonumentnummer)) as ?monumentenregister)
  ?rijksmonumentnummer ?straat ?huisnummer ?adres ?provincie ?gemeente ?postcode ?woonplaatsnaam ?functie ?datumInschrijving

where {
  graph graph:instanties-rce {
    ?rijksmonument 
      ceo:rijksmonumentnummer ?rijksmonumentnummer;
      ceo:datumInschrijvingInMonumentenregister ?datumInschrijving;
      ceo:heeftJuridischeStatus rn:b2d9a59a-fe1e-4552-9a05-3c2acddff864;
      ceo:heeftMonumentAard rn:fc966a68-8863-4970-a83e-110f96006c21;
      ceo:heeftBasisregistratieRelatie ?basisrel.

    ?basisrel ceo:heeftProvincie ?prov;
              ceo:heeftGemeente ?gem.

    OPTIONAL { 
      ?basisrel ceo:heeftBAGRelatie ?bagrelatie.

      OPTIONAL { ?bagrelatie ceo:volledigAdres ?adres. }
      OPTIONAL { ?bagrelatie ceo:postcode ?postcode_. }
      OPTIONAL { ?bagrelatie ceo:woonplaatsnaam ?woonplaatsnaam. }
      OPTIONAL { ?bagrelatie ceo:openbareRuimte ?straat. }
      OPTIONAL { ?bagrelatie ceo:huisnummer ?huisnummer. }
    }

    BIND(replace(str(?postcode_), "([0-9]{4})([A-Z]{2})", "$1 $2") AS ?postcode)

    OPTIONAL {
      ?rijksmonument ceo:heeftOorspronkelijkeFunctie/ceo:heeftFunctieNaam ?functies.
    }
  }

   graph owms: {
     ?prov skos:prefLabel ?provincie.
     ?gem skos:prefLabel ?gemeente.
   }

  OPTIONAL {
    graph graph:bebouwdeomgeving {
      ?functies skos:prefLabel ?functie_.
      BIND(replace(?functie_, "\\s\\(.*\\)|\\(.*\\)", "") AS ?functie)
    }
  }
}

❓ Question / Result #1.b
Summarize what is the result of this query and add in your report a description of this, together with a screenshot.

❓ Question / Result #1.c

B. Wikidata

SELECT ?place ?placeLabel ?location
WHERE
{
  # Berlin coordinates
  wd:Q64 wdt:P625 ?berlinLoc .
  SERVICE wikibase:around {
    ?place wdt:P625 ?location .
    bd:serviceParam wikibase:center ?berlinLoc .
    bd:serviceParam wikibase:radius "100" .
  } .
  # Is an airport
  FILTER EXISTS { ?place wdt:P31/wdt:P279* wd:Q1248784 } .
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
  }
}

❓ Question / Result #2

❓ Question / Result #3
Once more, adapt the query to find hospitals within 30 km around that city (again, include 1. adapted query and screenshots of 2. result table and 3. result map in your report)

C. Federated query

PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX : <http://dbpedia.org/resource/>
PREFIX dbpedia2: <http://dbpedia.org/property/>
PREFIX dbpedia: <http://dbpedia.org/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX bd: <http://www.bigdata.com/rdf#>

SELECT *
WHERE 
{ 

SERVICE <http://dbpedia.org/sparql>
 {     
 ?person dbo:birthPlace  :Delft .      
 ?person foaf:name ?name .
FILTER (?name = "Johannes Vermeer"@en) .      
?person owl:sameAs ?samePerson .     
FILTER(STRSTARTS(STR(?samePerson), "http://www.wikidata.org")) 
 }

SERVICE <https://query.wikidata.org/sparql>
 {
 ?samePerson wdt:P551 ?residence .
 ?residence wdt:P625 ?coordinates .
 }

}
LIMIT 10

❓ Question / Result #4

Explain/add in your report:

  1. What does, in plain English, the query ask for?
  2. What is the role of SERVICE in this query?
  3. How is the link between the DBPedia triples and Wikidata triples achieved?
  4. In the result table: Which information comes from DBPedia, which information comes from Wikidata?
  5. Adapt the query. Change ‘Delft’ to another city name and run again. Include the adapted query plus screenshot of the result table in your report.

D. Write a comparison between DBPedia and Wikidata

Do some research and discover what the main differences and similarities between DBPedia and Wikidata are.

❓ Question / Result #5

Write a short explanation about it in your own words (200 words max) and include it in your report.

What to submit