Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete results with VALUES in CONSTRUCT query #1157

Open
julianrojas87 opened this issue Aug 22, 2023 · 1 comment
Open

Incomplete results with VALUES in CONSTRUCT query #1157

julianrojas87 opened this issue Aug 22, 2023 · 1 comment

Comments

@julianrojas87
Copy link

Given the following graph:

@prefix ex: <http://example.org/> .
@prefix nav: <http://navigability.org/> .

ex:E1 a ex:Entity.

ex:E2 a ex:Entity.

ex:E3 a ex:Entity.

ex:E4 a ex:Entity.

ex:R1 a ex:Relation;
   ex:elementA ex:E1;
   ex:elementB ex:E2;
   ex:navigability nav:AB.

ex:R2 a ex:Relation;
   ex:elementA ex:E2;
   ex:elementB ex:E3;
   ex:navigability nav:Both.

ex:R3 a ex:Relation;
   ex:elementA ex:E3;
   ex:elementB ex:E4;
   ex:navigability nav:BA.

ex:R4 a ex:Relation;
   ex:elementA ex:E4;
   ex:elementB ex:E1;
   ex:navigability nav:None.

This query gives incomplete results on Virtuoso version 07.20.3237 (f3d88f16b) on Linux (x86_64-ubuntu_bionic-linux-gnu) Single Server Edition:

PREFIX ex: <http://example.org/>
PREFIX nav: <http://navigability.org/>
CONSTRUCT {
   ?e1 ex:connectedTo ?e2.
} WHERE {
   VALUES  ?navAB { nav:AB nav:Both }
   VALUES  ?navBA { nav:BA nav:Both }
   
   {
      ?r1 a ex:Relation;
         ex:elementA ?e1;
         ex:elementB ?e2;
         ex:navigability ?navAB.
   }
   UNION
   {
      ?r2 a ex:Relation;
         ex:elementA ?e2;
         ex:elementB ?e1;
         ex:navigability ?navBA.
   }
}

The expected results should be:

<http://example.org/E4>  <http://example.org/connectedTo>  <http://example.org/E3> .
<http://example.org/E2>  <http://example.org/connectedTo>  <http://example.org/E3> .
<http://example.org/E3>  <http://example.org/connectedTo>  <http://example.org/E2> .
<http://example.org/E1>  <http://example.org/connectedTo>  <http://example.org/E2> .

But instead it gives:

<http://example.org/E1>  <http://example.org/connectedTo>  <http://example.org/E2> .
<http://example.org/E2>  <http://example.org/connectedTo>  <http://example.org/E3> .

The results seem to be only binding for the first VALUES list.

The same scenario is evaluated correctly in Virtuoso version 08.03.3328 (348f8243fe) on Linux (x86_64-ubuntu_focal-linux-gnu-glibc2.31) Single Server Edition.

@HughWilliams
Copy link
Collaborator

@julianrojas87 We have been able to recreate this issue which has been reported to development to look into and fix ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants