Giter Site home page Giter Site logo

Comments (10)

rubensworks avatar rubensworks commented on June 12, 2024 1

@jitsedesmet Could you look into this one? Probably related to #1146.

from comunica.

rubensworks avatar rubensworks commented on June 12, 2024 1

In conclusion, yes we can apply this change.

Makes sense to me!

Just had a look at the spec as well, and it does indeed not say anything about if AFAICS, but we can indeed add support via operator extensibility.

So feel free to go ahead with making a PR @jitsedesmet! :-)

So concretely, we should make it so that the warning is not shown anymore. But plain strings and language-tagged strings will remain non-equal.

from comunica.

github-actions avatar github-actions commented on June 12, 2024

Thanks for reporting!

from comunica.

jitsedesmet avatar jitsedesmet commented on June 12, 2024

This is definitely a sparqlee issue. The in operator is a spacial operator in sparlee and for some reason it states:

This function doesn't require type promotion or subtype-substitution, everything works on TermExpression

I don't seem to remember why this is the case, so I'll need to look into that.
It might have to do with the fact that equality requires the types to be equal anyway? I'll look into this deeper next week.

from comunica.

jitsedesmet avatar jitsedesmet commented on June 12, 2024

My commend above was false. This behavior is what we/ I expected.
When resolving the issue, we had a conversation about comparing 2 strings that are not equal and whether this should raise an error. We concluded this discussion with "we will add support for language strings". This is true, we added support for language strings, so comparing 2 non-equal language strings would not throw an error. Nothing was said about comparing a language string with a normal string... And thus, an error is still thrown in this case.

We could easily allow comparing a string and a language string (it would even make the code easier), question is; do we want this?

from comunica.

rubensworks avatar rubensworks commented on June 12, 2024

Ok, a language-tagged string not being equal to a non-language-tagged string definitely makes sense.

I'm just wondering if the warning messages are correct here.
@jitsedesmet does the spec say that an error must be thrown when comparing a language-tagged string with a language-tagged string? If it doesn't say that, perhaps we can just make it return false without throwing the error?

from comunica.

jitsedesmet avatar jitsedesmet commented on June 12, 2024

The warning is correct since we don't implement an equality between a string and a language string, i.e. we don't find a fitting function.
I think it would make sense to just return false in this case instead of an error. (which we can do for the same reason as with the implementation of language string equality.)

Should I make a PR for this in sparqlee?

from comunica.

rubensworks avatar rubensworks commented on June 12, 2024

The warning is correct since we don't implement an equality between a string and a language string, i.e. we don't find a fitting function.
I think it would make sense to just return false in this case instead of an error. (which we can do for the same reason as with the implementation of language string equality.)

But what does the spec say?
Does the spec say that we should throw an error?
Or is this undefined behaviour in the spec?

from comunica.

jitsedesmet avatar jitsedesmet commented on June 12, 2024

I'm pretty sure the spec doesn't care. In your comment here: comunica/sparqlee#168 (comment) You mentioned the use of operator extensability. This can be used here too.

The operator in states:

The test is done with "=" operator, which tests for the same value, as determined by the operator mapping.

In conclusion, yes we can apply this change.

Please tell me if I misunderstood your question.

from comunica.

jitsedesmet avatar jitsedesmet commented on June 12, 2024

Yes, will do!

from comunica.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.