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

Improve handling of rdf:nil when using not() WOQL construct with sys:subdocument #2075

Open
hoijnet opened this issue Dec 29, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@hoijnet
Copy link

hoijnet commented Dec 29, 2023

Describe the bug
There is a bug where operations with the not() operator does not behave according to expectation.

When querying for document, I often want to select only documents, not subdocuments. I often forget that rdf:nil is not treated the same way when using the not() construct.

Here are the four cases, of which I think the last one misbehaves, and should work the same as number 3. My reasoning is that the handling in example 2 and example 4 should work the same way, just in the inverse. The reason I think that this is a bug, at least it goes against expectations, when running example 1, the v:unbound variable is set to rdf:nil.

  1. Find all subdocuments, returns expected documents (with unbound variable)
and(
  triple("v:doc","rdf:type","v:type"),
  quad("v:type","sys:subdocument","v:unbound","schema")
)
  1. Find all subdocuments, returns expected documents (with rdf:nil)
and(
  triple("v:doc","rdf:type","v:type"),
  quad("v:type","sys:subdocument","rdf:nil","schema")
)
  1. Find all documents (i.e. not subdocs), returns expected documents (with unbound variable)
and(
  triple("v:doc","rdf:type","v:type"),
  not().quad("v:type","sys:subdocument","v:unbound","schema")
)
  1. Find all documents (i.e. not subdocs), does not return expected documents (with rdf:nil)
and(
  triple("v:doc","rdf:type","v:type"),
  not().quad("v:type","sys:subdocument","rdf:nil","schema")
)

To Reproduce
Steps to reproduce the behavior:

  1. Create a subdocument type
  2. Create a data product with a type that inherits from another type, and put the subtype as a mandatory property.
  3. Create documents to test with
  4. Try examples 1, 2, 3, 4
  5. Notice how example 4 does not return document references

Expected behavior
The expectation is that the result of example 3 and example 4 should be the same.

Screenshots
N/A

Info (please complete the following information):

Additional context
N/A

@hoijnet hoijnet added the bug Something isn't working label Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant