Search code examples
sparqlrdfsemantic-webdbpedialinked-data

SPARQL Construct query Segmentation


I run a SPARQL construct query on DBpedia endpoint. The query is for getting all the information describing all movies:

construct
{
    ?s ?p ?o
}
where
{
    ?s a <http://dbpedia.org/ontology/Film>.
{
  SELECT ?s ?p ?o
  {
       ?s ?p ?o
  } 
  group by ?s ?p 
}


}

The query works fine. The problem is DBpedia stops it at 10.000. I tried to make the offset 0 but it does make any difference. Also, I don't think chrome would support to display a million triple. Therefore, I was thinking if there is a solution, or a tip, so I can retrieve the data by segments, meaning I start from where I stopped previously.


Solution

  • You could try ORDER BY, LIMIT and OFFSET. You can also simplify your query significantly:

    construct
    {
       ?s ?p ?o
    }
    where
    {
       ?s a <http://dbpedia.org/ontology/Film> .
       ?s ?p ?o
    } ORDER BY ?s ?p ?o
      OFFSET 0 LIMIT 1000
    

    Then change the OFFSET for each "segment".