virtuoso-opensource icon indicating copy to clipboard operation
virtuoso-opensource copied to clipboard

`datatype(?o)` is empty

Open excursus opened this issue 3 years ago • 1 comments

I initially posted this question on stackoverflow and was advised to open a ticket here since it might be caused by "a relatively recently introduced bug".

I noticed that running the following query on dbpedia:

SELECT ?s, datatype(?s), ?p, datatype(?p), ?o, datatype(?o)
WHERE {
   ?s ?p ?o .
} 
LIMIT 100

returns a response in which the column for datatype(?o) is blank. The first row returned by this query looks like this:

?s           http://dbpedia.org/ontology/deathDate  
datatype(?s) http://www.w3.org/2001/XMLSchema#anyURI    
?p           http://www.w3.org/1999/02/22-rdf-syntax-ns#type    
datatype(?p) http://www.w3.org/2001/XMLSchema#anyURI    
?o           http://www.w3.org/2002/07/owl#FunctionalProperty
datatype(?o)

Running this same query on a local installation running Virtuoso version 7.2.6.3233 returns:

http://www.openlinksw.com/virtrdf-data-formats#default-iid                        
http://www.w3.org/2001/XMLSchema#anyURI                                           
http://www.w3.org/1999/02/22-rdf-syntax-ns#type                                  
 http://www.w3.org/2001/XMLSchema#anyURI                                           
http://www.openlinksw.com/schemas/virtrdf#QuadMapFormat                           
NULL

where the value returned for datatype(?o) is NULL.

(I suspect that this behavior goes back to at least 2016: this question on stackoverflow asks why a query with a filter clause FILTER(datatype(?o) = xsd:integer) times out before returning any results across all of dbpedia, which I suspect is caused by the behavior describe above.)

Is this a bug or intended behavior?

excursus avatar Oct 24 '22 15:10 excursus

Development is looking into this issue

pkleef avatar Oct 25 '22 10:10 pkleef