Skip to content

First pass at SHACL #316#421

Merged
cmungall merged 5 commits intomainfrom
shacl-316
Oct 22, 2021
Merged

First pass at SHACL #316#421
cmungall merged 5 commits intomainfrom
shacl-316

Conversation

@cmungall
Copy link
Member

@cmungall cmungall commented Oct 18, 2021

Note: will be hard to do complete tests until we switch to rdflib6, see #291 (this is because pyshacl depends on rdflib6)

@cmungall cmungall requested a review from balhoff October 19, 2021 00:58
- adding order, name, description
- adding example
- docs
Copy link

@balhoff balhoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that the property constraints are propagated down to subclasses. The NamedThing shape has targetClass NamedThing. Some of the constraints there (e.g. name) are also stated for its subclass Person. I think that any instances of Person would also be "SHACL instances" of NamedThing via the built-in RDFS inference. Then would they automatically have the NamedThing constraints without duplicating them? Not sure how these interact.

@cmungall
Copy link
Member Author

Yes, we should eliminate the redundancy. It's possible for subclasses to refine ranges other other constraints but where there is no override we should avoid redundancy

can you also comment on the wisdom of "punning" class shape names and class_uris?

@cmungall cmungall merged commit e9dffc9 into main Oct 22, 2021
@cmungall cmungall deleted the shacl-316 branch October 22, 2021 01:29
@balhoff
Copy link

balhoff commented Oct 22, 2021

Yes, we should eliminate the redundancy. It's possible for subclasses to refine ranges other other constraints but where there is no override we should avoid redundancy

One thing to keep in mind is that without the redundancy, you need to provide both the data and the schema ontology (in addition to the SHACL file) to the validator. Probably a good idea though, to make sure sh:targetClass always works.

can you also comment on the wisdom of "punning" class shape names and class_uris?

I think it's fine; they have specific support for this: https://www.w3.org/TR/shacl/#implicit-targetClass

You shouldn't need to also state sh:targetClass in this case. However the spec mentions rdfs:Class and not owl:Class, so that may not work.

@@ -0,0 +1,324 @@
@prefix ns1: <http://www.w3.org/ns/shacl#> .
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to change this to @prefix sh: <http://www.w3.org/ns/shacl#> ., just to follow convention?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes this would be much better #429

iQuxLE pushed a commit that referenced this pull request Aug 18, 2025
…rage

Exclude vendored linkml-model from coverage reporting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants