ontoportal-lirmm / goo

Graph Oriented Objects (GOO) for Ruby. A RDF/SPARQL based ORM.
http://ncbo.github.io/goo/
Other
0 stars 4 forks source link

Fix: enforce to use str() when doing a filter with a string value #57

Closed syphax-bouazzouni closed 6 months ago

syphax-bouazzouni commented 6 months ago

Issue

Saving the value of a triple as T021"^^xsd:string is not the same as "T021" (in 4store at least), the first one get be get using this query

  ?id <http://www.w3.org/2004/02/skos/core#notation> ?v .
  FILTER(?v = "T021")

and the latter

  ?id <http://www.w3.org/2004/02/skos/core#notation> ?v .
  FILTER(?v = "T021"^^xsd:string)

Solution

To handle both cases this PR enforce the usage of str() in SPARQL filters,

  ?id <http://www.w3.org/2004/02/skos/core#notation> ?v .
  FILTER(str(?v) = "T021")
codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 85.88%. Comparing base (cd5bc31) to head (6f06a79).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## development #57 +/- ## =============================================== + Coverage 85.87% 85.88% +0.01% =============================================== Files 41 41 Lines 2698 2700 +2 =============================================== + Hits 2317 2319 +2 Misses 381 381 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.