Search code examples
sparqldbpediageonames

SPARQL query: no return


Why does this SPARQL query return a result:

SELECT * WHERE {
?c <http://www.geonames.org/ontology#name> ?a .}
LIMIT 20

result:

enter image description here

While this returns an empty table of columns a and b:

SELECT * WHERE {
?c <http://dbpedia.org/ontology#name> ?a .}
LIMIT 20

Solution

  • I replaced the # in dbpedia's by / as in follows:

    SELECT * WHERE {
    ?c <http://dbpedia.org/ontology/name> ?a .}
    LIMIT 20
    

    This means any prefixes for dbpedia should include / instead of # as well. :)