Search code examples
sparqlvirtuoso

OpenLink Virtuoso Retrieve all triple through SPARQL returns type assertion


I'm using OpenLink Virtuoso through the Conductor administration page. I'm making the following SPARQL query in order to retrieve all the triples in a specific graph:

SELECT * WHERE{   
?s ?p ?o.   
}

The problem is that all the retrieved triples are type assertions , namely, all the triples where ?p is rdf:type, while the remaining triples are not retrieved.

With the following SPARQL query:

 SELECT * WHERE{   
 ?s ?p ?o. 
  FILTER (?p != <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>)
 }  

I retrieve all the triples involving the RDF properties (rdf:type excluded) but not all the triples involving the properties defined within the considered graph.

I tried the following query:

 SELECT WHERE
   { ?s ?p ?o  
   FILTER (?p != <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>)
   }

and it retrieves all the triples where ?p can be replaced with one of the properties in the rdf-schema (except rdf:type) but not all the triples where ?p is any property defined in the selected GRAPH.


Solution

  • You might be getting partial results from virtuoso. That is a virtuoso feature that can sometimes give confusing results if you don't know it is on. If you can look at the HTTP headers from the server you could know for sure. https://docs.openlinksw.com/virtuoso/anytimequeries/