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

Language strings are not handled correctly in delete queries #2

Open
abeforgit opened this issue Oct 27, 2020 · 2 comments
Open

Language strings are not handled correctly in delete queries #2

abeforgit opened this issue Oct 27, 2020 · 2 comments

Comments

@abeforgit
Copy link

abeforgit commented Oct 27, 2020

This was noticed in the context of a PATCH request sent to mu-cl-resources. The incoming query from resources is correct, so it must be something here

Incoming query from mu-cl-resources

 DELETE {
     GRAPH <http://mu.semte.ch/application> {
         <http://data.lblod.info/id/stemmingen/5F98570FA38AFA0008000011> besluit:aantalOnthouders ?gensym0.
     <http://data.lblod.info/id/stemmingen/5F98570FA38AFA0008000011> besluit:aantalTegenstanders ?gensym1.
     <http://data.lblod.info/id/stemmingen/5F98570FA38AFA0008000011> besluit:aantalVoorstanders ?gensym2.
     <http://data.lblod.info/id/stemmingen/5F98570FA38AFA0008000011> besluit:geheim ?gensym3.
     <http://data.lblod.info/id/stemmingen/5F98570FA38AFA0008000011> besluit:gevolg ?gensym4.
     <http://data.lblod.info/id/stemmingen/5F98570FA38AFA0008000011> besluit:onderwerp ?gensym5.
 }
 } WHERE {
     GRAPH <http://mu.semte.ch/application> {
         OPTIONAL {     <http://data.lblod.info/id/stemmingen/5F98570FA38AFA0008000011> besluit:aantalOnthouders ?gensym0.
  }
     OPTIONAL {     <http://data.lblod.info/id/stemmingen/5F98570FA38AFA0008000011> besluit:aantalTegenstanders ?gensym1.
  }
     OPTIONAL {     <http://data.lblod.info/id/stemmingen/5F98570FA38AFA0008000011> besluit:aantalVoorstanders ?gensym2.
  }
     OPTIONAL {     <http://data.lblod.info/id/stemmingen/5F98570FA38AFA0008000011> besluit:geheim ?gensym3.
  }
     OPTIONAL {     <http://data.lblod.info/id/stemmingen/5F98570FA38AFA0008000011> besluit:gevolg ?gensym4.
  }
     OPTIONAL {     <http://data.lblod.info/id/stemmingen/5F98570FA38AFA0008000011> besluit:onderwerp ?gensym5.
  }
 }
 };
 INSERT DATA
 {
     GRAPH <http://mu.semte.ch/application> {
         <http://data.lblod.info/id/stemmingen/5F98570FA38AFA0008000011> besluit:aantalOnthouders """0"""^^xsd:decimal.
     <http://data.lblod.info/id/stemmingen/5F98570FA38AFA0008000011> besluit:aantalTegenstanders """0"""^^xsd:decimal.
     <http://data.lblod.info/id/stemmingen/5F98570FA38AFA0008000011> besluit:aantalVoorstanders """0"""^^xsd:decimal.
     <http://data.lblod.info/id/stemmingen/5F98570FA38AFA0008000011> besluit:geheim """false"""^^typedLiterals:boolean.
     <http://data.lblod.info/id/stemmingen/5F98570FA38AFA0008000011> besluit:gevolg """asdf"""@nl.
     <http://data.lblod.info/id/stemmingen/5F98570FA38AFA0008000011> besluit:onderwerp """asdfasdfasdf"""@nl.
 }
 }

Expected outgoing (pseudo) example query:

DELETE DATA{
   GRAPH <http://mu.semte.ch/graphs/organizations/974816591f269bb7d74aa1720922651529f3d3b2a787f5c60b73e5a0384950a4>
   {
     <http://data.lblod.info/id/stemmingen/5F98570FA38AFA0008000011> <http://data.vlaanderen.be/ns/besluit#onderwerp> """oldval"""@nl
   }
}
INSERT DATA{
   GRAPH <http://mu.semte.ch/graphs/organizations/974816591f269bb7d74aa1720922651529f3d3b2a787f5c60b73e5a0384950a4>
   {
     <http://data.lblod.info/id/stemmingen/5F98570FA38AFA0008000011> <http://data.vlaanderen.be/ns/besluit#onderwerp> """newval"""@nl
   }
}

Actual outgoing query

Notice the @nl is missing

DELETE DATA{
   GRAPH <http://mu.semte.ch/graphs/organizations/974816591f269bb7d74aa1720922651529f3d3b2a787f5c60b73e5a0384950a4>
   {
     <http://data.lblod.info/id/stemmingen/5F98570FA38AFA0008000011> <http://data.vlaanderen.be/ns/besluit#onderwerp> """oldval"""
   }
}
INSERT DATA{
   GRAPH <http://mu.semte.ch/graphs/organizations/974816591f269bb7d74aa1720922651529f3d3b2a787f5c60b73e5a0384950a4>
   {
     <http://data.lblod.info/id/stemmingen/5F98570FA38AFA0008000011> <http://data.vlaanderen.be/ns/besluit#onderwerp> """newval"""@nl
   }
}

Resulting bug:

Instead of updating, multiple triples are entered for the predicate in question, leading to non-deterministic behavior when querying for that data

@abeforgit
Copy link
Author

This might actually be fixed by setting DATABASE_COMPATIBILITY since the problem was on the value side of the query
Depends on how the delete query is rewritten

@erikap
Copy link
Member

erikap commented Nov 23, 2023

Seems to be fixed in release v0.6.0-beta.8. Can you confirm @abeforgit ?

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