4

I want to download all object of type d0:Loaction from dbpedia in N-Triple format. The query in http://dbpedia.org/sparql is :

DESCRIBE ?x
WHERE { ?x rdf:type d0:Location
}

But i will give timeout. Is there any simpler approach for downloading such database?

Seyed Morteza Mousavi
  • 6,855
  • 8
  • 43
  • 69
  • It's unclear just what you want. The results of a *describe* query are implementation-defined, though it's common to return all triples in which a resource is mentioned. If you just want a list of the things with the given type, a `construct` query might be a better choice, and you'll have less data to get back. – Joshua Taylor Oct 20 '14 at 14:36

1 Answers1

3

If you're downloading a lot of data from DBpedia, you should probably just download the data dumps and run your own endpoint locally. But if you just want a list of list of individuals of a given type, you can use a select query:

select ?location where {
  ?location a d0:Location
}
order by ?location  #-- need an order for offset to work
limit 1000          #-- how many to get each time
offset 3000         #-- where to start in the list

If you actually want RDF data back, you can just change that to a construct query:

construct where {
  ?location a d0:Location
}
order by ?location
limit 1000
offset 3000
Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
  • Thank you, it is a good idea to run my own endpoint. Can you give me example here? – Seyed Morteza Mousavi Oct 21 '14 at 06:43
  • 1
    @SeyedMortezaMousavi Have a look at [Load DBpedia locally using Jena TDB?](http://stackoverflow.com/q/16832862/1281433) and see the **Using TDB locally** section of [my answer](http://stackoverflow.com/a/16610663/1281433) to [Querying Open Data Communities Data with SPARQL](http://stackoverflow.com/q/16608265/1281433). – Joshua Taylor Oct 21 '14 at 10:28
  • I will takes look at them later. Thanks for your response. – Seyed Morteza Mousavi Oct 21 '14 at 14:51