1

I'm using DBpedia public endpoint http://dbpedia.org/sparql, but I suspect that it sets a limit on the number of results it returns. I'm not sure, and just want to confirm. For example, for these two queries:

select distinct ?property 
where { 
   ?property <http://www.w3.org/2000/01/rdf-schema#domain> <http://dbpedia.org/ontology/Person> . 
}


select distinct ?property 
where {
     ?instance a <http://dbpedia.org/ontology/Person> . 
     ?instance ?property ?obj . 
}

I would expect the second one return much more results than the first one because although they are all asking for the properties of "Person", the second one retrieves properties that are not explicit in the schema. But weirdly, the second one only returns one result. I'm wondering if the endpoint is setting a limit on the result it returns and how do I change this limit. Do I really need to set up my local instance of DBpeida if I want to retrieve the complete information?

al3xtouch
  • 491
  • 4
  • 19

2 Answers2

0

There is a limit but that is not the reason why you are getting unexpected results to the 2nd query (from dbpedia.org/sparql):

  • The 2nd query works fine on live.dbpedia.org so there must be something wrong with the dbpedia.org endpoint at the moment (a new release being loaded?)

About the DBPedia result limit and how to work around it: How to get all companies from DBPedia?.

UPDATE: 2nd query returned many more results from dbpedia.org/sparql if a part of the query is inside the OPTIONAL clause:

select distinct ?property 
where {
     ?instance a <http://dbpedia.org/ontology/Person> . 
     OPTIONAL {?instance ?property ?obj . }
}
Community
  • 1
  • 1
CaptSolo
  • 1,771
  • 1
  • 16
  • 17
  • live.dbpedia.org returns more results, but is the results returned by dbpedia live the complete results or is there still a limit? – al3xtouch Mar 06 '16 at 10:37
  • and the 1st query only returns one result on dbpedia live now, I have no idea what is going on with these endpoint. – al3xtouch Mar 06 '16 at 10:44
  • If you are using the web interface, there is a timeout that can be set and is set to 30s default. Because Virtuoso has some kind of any-time support, it returns everything found in the given time. For the `dbo:Person` example, it's either to expensive or there is currently too much load on the server. – UninformedUser Mar 06 '16 at 20:59
  • @al3xtouch if you get many results (instead on just 1) you are probably getting them all (because the limits mentioned in the other SO question are at least 40000 - you won't have that many properties) - to be sure try changing the timeout and see if the result changes (that will show if the timeout that AKSW mentioned is a problem). – CaptSolo Mar 06 '16 at 21:10
  • 1
    @al3xtouch both queries worked OK for me on live.dbpedia.org – CaptSolo Mar 06 '16 at 21:16
  • I checked the workaround you gave me. It works when you query directly using the endpoint interface, but sometimes the endpoint gives you timeout if you are using libraries (such as Sparqlwrapper python) and virtuoso ignores the timeout parameter you set in the code. So I think the best solution wold be to set up a local instance of dbpedia... – al3xtouch Mar 07 '16 at 19:19
  • Local DBPedia instance (or a separate instance on the cloud) is the safest bet. SparqlWrapper uses that parameter to set socket timeout so it is not even sent to Virtuoso. If the timeout is a problem you could modify your copy of SparqlWapper to send a timeout param to Virtuoso. – CaptSolo Mar 07 '16 at 19:59
0

You're using the Virtuoso SPARQL Query Editor to get these results? Very odd. I also get one result, rdf:type using that service. But if I use a different tool (TopBraid Composer in my case) with the SERVICE keyword per below, I see sensible results, such as height weight, alias, child, etc.

select distinct ?property 
where {
   SERVICE <http://dbpedia.org/sparql> {
      ?instance a <http://dbpedia.org/ontology/Person> . 
      ?instance ?property ?obj . 
   }
}

Could very well be an issue with the Virtuoso SPARQL Query Editor.

scotthenninger
  • 3,921
  • 1
  • 15
  • 24