Search code examples
sparqlrdf

Sparql query for provenance metadata


Following resaource has provenance metadata as a graph:

http://geo.linkeddata.es/resource/Provincia/Madrid

and here is the turtle serialization:

http://geo.linkeddata.es/data/resource/ComunidadAut%C3%B3noma/Comunidad%20de%20Madrid?output=ttl

And I am trying to access provenance metadata with following SPARQL query to the endpoint http://geo.linkeddata.es/sparql:

SELECT ?y WHERE {
    ?x foaf:primaryTopic <http://geo.linkeddata.es/resource/Provincia/Madrid> .
    ?x rdf:type ?y.
    } 

But it returns null, and I can't understand where is my mistake. Thanks in advance.


Solution

  • The queries :

    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
    SELECT * WHERE {
       GRAPH ?g { ?x foaf:primaryTopic ?y .}
        } 
    LIMIT 10
    

    and

    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
    SELECT * WHERE {
       ?x foaf:primaryTopic ?y .
        } 
    LIMIT 10
    

    Return no answer on your endpoint : http://geo.linkeddata.es/sparql

    Therefore the property foaf:primaryTopic is definitely not used in the data accessible through the endpoint.

    Then why does this property appear in the serialization http://geo.linkeddata.es/data/resource/ComunidadAut%C3%B3noma/Comunidad%20de%20Madrid?output=ttl ?

    I guess this link is a document generated from the data contained in the endpoint, but with additional information on the document itself that are not contained in the original endpoint. Typically :

    <http://geo.linkeddata.es/data/resource/ComunidadAut%C3%B3noma/Comunidad%20de%20Madrid?output=ttl>
          rdfs:label "RDF description of Comunidad de Madrid" ;
          foaf:primaryTopic <http://geo.linkeddata.es/resource/ComunidadAut%C3%B3noma/Comunidad%20de%20Madrid> .
    

    I hope it helps and that I made myself clear.