Variable GRAPH + VALUES asignment is broken

Given this test dataset:

GRAPH <urn:graph:X> {
  <urn:resource:subject> <urn:resource:predicate> <urn:resource:objectX> .
}
GRAPH <urn:graph:Y> {
  <urn:resource:subject> <urn:resource:predicate> <urn:resource:objectY> .
}

The following queries:

SELECT DISTINCT ?g
FROM NAMED <urn:graph:X> 
FROM NAMED <urn:graph:Y> 
{
  BIND (<urn:graph:X> as ?g )
  GRAPH ?g {
  	?s ?p ?o
  }
}
ORDER BY ?g
SELECT DISTINCT ?g
FROM NAMED <urn:graph:X> 
FROM NAMED <urn:graph:Y> 
{
  
  GRAPH ?g {
  	?s ?p ?o
        FILTER (?g = <urn:graph:X>)
  }
}
ORDER BY ?g

return the expected result:

g
urn:graph:X

This query, however, does not:

SELECT DISTINCT ?g
FROM NAMED <urn:graph:X> 
FROM NAMED <urn:graph:Y> 
{
  GRAPH ?g {
  	?s ?p ?o
    VALUES (?g) {(<urn:graph:X>)}
  }
}
ORDER BY ?g

as both graphs are returned:

g
urn:graph:X
urn:graph:Y

The problem was reproduced with Stardog 5.3.6 and Stardog 6.0.1

1 Like

Hi Ruben,

Thanks for the great bug report. I confirm the behavior is present in Stardog 6 as well. I created ticket #6607 to track it and we will get it fixed for Stardog 6.0.2 (tentatively scheduled before Christmas).

One possible temporary workaround would be to add the following to your $STARDOG_SERVER_JAVA_ARGS: -Dcom.complexible.stardog.plan.optimizer.from_named_expansion_limit=0

Best,
Pavel

1 Like

This is fixed in Stardog 6.1 which was released yesterday.

Thanks,
Pavel

1 Like