Coder Social home page Coder Social logo

Enable sh:pattern on IRIs about pyshacl HOT 5 CLOSED

rdflib avatar rdflib commented on May 20, 2024 2
Enable sh:pattern on IRIs

from pyshacl.

Comments (5)

ashleysommer avatar ashleysommer commented on May 20, 2024

I don't believe there is need for separate 'relaxed' mode for this change. Changing sh:pattern to work on IRIs as well as strings does not cause any of tests in the SHACL test suite to fail.

from pyshacl.

dr-shorthair avatar dr-shorthair commented on May 20, 2024

FWIW it looks like the TQ SHACL implementation is here: https://github.com/TopQuadrant/shacl

from pyshacl.

HolgerKnublauch avatar HolgerKnublauch commented on May 20, 2024

The spec is IMHO clear that IRIs can be checked too.

from pyshacl.

ashleysommer avatar ashleysommer commented on May 20, 2024

@HolgerKnublauch
Yes you're right. Re-reading the relevant sections I see it is pretty obvious. I think it was this part which threw me off:

The values of sh:pattern in a shape are literals with datatype xsd:string

I originally read that as "the focusnodes of sh:pattern constraint are literals with datatype xsd:string" so thought it excluded IRIs.

However, just looking at implementing this feature in pySHACL I see it is already implemented. All string-based constraint operations already work on IRIs, and not by accident, there is even a method in there for all string-based constraints to turn an IRI to a string before evaluating. So the spec must've been clear to me back when I wrote that code too.

So can close this as not a bug.

from pyshacl.

dr-shorthair avatar dr-shorthair commented on May 20, 2024

@HolgerKnublauch It is explicit on sh:minLength and sh:maxLength with the phrase "This can be applied to any literals and IRIs, but not to blank nodes.". Not explicit on sh:pattern (this briefly threw us off the trail), but not excluded either.

from pyshacl.

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.