zazuko / rdf-validate-shacl

Validate RDF data purely in JavaScript. An implementation of the W3C SHACL specification on top of the RDFJS stack.
MIT License
98 stars 13 forks source link

fix: using property shapes in logical constraints #141

Open tpluscode opened 2 months ago

tpluscode commented 2 months ago

This improves the handling of Property Shapes nested inside logical constraints, such as sh:and

@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <http://schema.org/> .
@prefix ex: <http://example.com/> .

ex:PersonAddressShape
    a sh:NodeShape ;
    sh:targetClass schema:Person ;
    sh:property ex:ps3 .

ex:ps1  a sh:PropertyShape ;
        sh:minCount 1 .

ex:ps3  a sh:PropertyShape ;
        sh:path schema:age ;
        sh:and ( ex:ps1 ) .

By the SHACL spec, ex:ps1 is not a valid Property Shape because it lacks sh:path. However, since the Java TopQuadrant implementation handle such cases we could also try to support them

changeset-bot[bot] commented 2 months ago

🦋 Changeset detected

Latest commit: f49bdc06f8e68389d01cf9e9e504debce233e51b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------------------ | ----- | | rdf-validate-shacl | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

codecov[bot] commented 2 months ago

Codecov Report

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

Project coverage is 98.80%. Comparing base (378f3db) to head (f49bdc0).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #141 +/- ## ========================================== + Coverage 98.77% 98.80% +0.02% ========================================== Files 12 12 Lines 1881 1917 +36 ========================================== + Hits 1858 1894 +36 Misses 23 23 ```

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