Skip to content

Language strings are not handled correctly in delete queries #2

@abeforgit

Description

@abeforgit

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions