Giter Site home page Giter Site logo

Comments (5)

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

Thanks for reporting!

from comunica.

jeswr avatar jeswr commented on June 12, 2024

Assuming you agree, I'd gladly try my hand at a first contribution, but I'd need some guidance. Unfamiliar as I am with the codebase, I naively think this might be as easy as a condition on the term type of the QPF request subject, if any.

It should be possible to implement this by adding a condition here which returns an empty set of quads if any of the terms do not match the expected term type (in particular you could enforce " The subject MUST either be a variable or an IRI; the predicate MUST either be a variable or an IRI; the object MUST either be a variable, an IRI, or a literal; the graph MUST either be a variable or an IRI").

To return an empty set of quads with the correct metadata you should use this logic. I would suggest refactoring that logic into a emptyWithMetadata function.

from comunica.

rubensworks avatar rubensworks commented on June 12, 2024

As of today, nothing I'm aware of prevents Comunica from working with generalized RDF.
As such, implementing the suggested change may restrict some valid use cases (e.g. querying over N3 files).

But the TPF spec does indeed make the explicit restriction, so we should handle at least that part.

I'm wondering if we should not go for a more high-level approach, and introduce a proper generalizedRdf option, which is false by default. And if false, we can modify our quadpattern query operation actor so that it always returns empty results when literals appear in non-object positions.
This would still enable users to force generalized RDF mode if they want to do so.

from comunica.

jeswr avatar jeswr commented on June 12, 2024

I'm wondering if we should not go for a more high-level approach, and introduce a proper generalizedRdf option, which is false by default. And if false, we can modify our quadpattern query operation actor so that it always returns empty results when literals appear in non-object positions.

Just to clarify - do you mean implement this in addition to doing an explicit restriction in the case of the TPF/QPF spec. I think the in addition to part is important in order to allow use-cases such as querying over the union of a TPF/QPF endpoint and an N3 document.

from comunica.

rubensworks avatar rubensworks commented on June 12, 2024

do you mean implement this in addition to doing an explicit restriction in the case of the TPF/QPF spec

No, I was referring to just applying this restriction at a higher level. To avoid us having to implement the same restriction at different places.

I think the in addition to part is important in order to allow use-cases such as querying over the union of a TPF/QPF endpoint and an N3 document.

But then we would be mixing regular RDF with generalized RDF, and crossing two formal boundaries, which would probably open up another can of worms. We may want to avoid going into this, without knowing for certain that this is a valid use case.

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.