1

At this endpoint http://spcdata.digitpa.gov.it:8899/sparql I have a list of all italian municipalities. I want to fetch the population data for every muncipality from dbpedia, and I'm using the owl:sameAs property as a pointer to dbpedia .

In this question you can find the query I'd like to use. Unfortunately, this query times out roughly over a LIMIT 1500 clause, so I guessed paginating results using an offset was the best solution. Unfortunately, this query

PREFIX pa:  <http://spcdata.digitpa.gov.it/> 
PREFIX rdf: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dbp: <http://dbpedia.org/ontology/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT * WHERE {
  ?s a pa:Comune .
  ?s rdf:label ?label .
  ?s owl:sameAs ?sameAs .
  SERVICE <http://dbpedia.org/sparql> { 
    ?sameAs dbp:populationTotal ?populationTotal .
   }

} LIMIT 10 offset 6000

causes the endpoint to timeout. I've tried with different OFFSET values, and below 1000 it works nicely, problems start to arrive when offsetting 1000 and beyond.

What could I do for retrieving all the results? I've tried with the dbpedia endpoint, but seems that federating requests to http://spcdata.digitpa.gov.it:8899/sparql is forbidden.

Many thanks!

Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58
Dev-otchka
  • 327
  • 1
  • 4
  • 20

1 Answers1

1

try setting the timeout explicitly, as a query parameter.

the request completed successfully (with timeout=600000 and should-sponge=grab-all)

you can set both parameters also manually from the sparql mask, the should-sponge parameter is represented as retrieve all missing remote RDF data that might be useful in the html select.

kr1
  • 7,225
  • 1
  • 26
  • 29
  • What is the sponge parameter for? I've tried opening your link but I get this error: `Virtuoso 37000 Error SP030: SPARQL compiler, line 2: Missing in PREFIX declaration at '<' before 'http:` I've tried with the timeout alone and all I get is an empty table, so I guess the sponge must play an important part here. – Dev-otchka Jun 09 '13 at 13:38
  • you are right, the link is not working (it got URL encoded twice - probably SO link regex). the sponge parameter means: `retrieve all missing remote RDF data that might be useful` and can be selected from the sparql query mask in the browser. I have updated the answer. – kr1 Jun 09 '13 at 16:08