Reputation: 113
Can it be a case when using two different implementations of TTL bulk loading to naming graphs in Virtuoso, string literals are represented in different encodings and can not be compared directly without explicit str()
conversion?
The actual problem is the following.
One named graph <urn:model1>
was populated using a custom JENA-based app.
The second graph <urn:model2>
was populated using native Virtuoso Uploading from the web admin console.
Both graphs have a triple —
m:ID1111 m:reflect "ROAM-1234".
However the following query returns empty result —
select DISTINCT ?s ?s2 ?o
WHERE {
GRAPH <urn:model1>
{
?s m:reflect ?o.
}
GRAPH <urn:model2>
{
?s2 m:reflect ?o.
}
}
— while a modification with explicit str
and FILTER
works as expected —
select DISTINCT ?s ?s2 ?o
WHERE {
GRAPH <urn:model1>
{
?s m:reflect ?o.
}
GRAPH <urn:model2>
{
?s2 m:reflect ?o2.
}
FILTER(str(?o) = str(?o2))
}
For both graphs, strlen()
and datatype()
returns correct results (the same length and http://www.w3.org/2001/XMLSchema#string
).
And finally if the following modification of the filter is used —
FILTER( ?o = str(?o2))
— then the query runs forever.
Upvotes: 2
Views: 73