Skip to content

Issue 415: Use sh:memberShape in SHACL SHACL #417

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: gh-pages
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 26 additions & 36 deletions shacl12-vocabularies/shacl-shacl.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,16 @@ shsh:ShapeShape
sh:maxCount 1 ; # deactivated-maxCount
sh:datatype xsd:boolean ; # deactivated-datatype
] ;

sh:property [
sh:path sh:and ;
sh:node shsh:ListShape ; # and-node
sh:memberShape shsh:ShapeShape ; # and-memberShape
] ;
sh:property [
sh:path sh:class ;
sh:nodeKind sh:IRI ; # class-nodeKind
sh:or (
[ sh:nodeKind sh:IRI ]
[ sh:memberShape [ sh:nodeKind sh:IRI ] ]
) ; # class-nodeKind
] ;
sh:property [
sh:path sh:closed ;
Expand All @@ -137,16 +139,16 @@ shsh:ShapeShape
] ;
sh:property [
sh:path sh:ignoredProperties ;
sh:node shsh:ListShape ; # ignoredProperties-node
sh:maxCount 1 ; # multiple-parameters
] ;
sh:property [
sh:path ( sh:ignoredProperties [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ;
sh:nodeKind sh:IRI ; # ignoredProperties-members-nodeKind
sh:memberShape [ sh:nodeKind sh:IRI ] ; # ignoredProperties-memberShape
sh:minListLength 1 ; # ignoredProperties-minListLength
sh:maxCount 1 ; # multiple-parameters
] ;
sh:property [
sh:path sh:datatype ;
sh:nodeKind sh:IRI ; # datatype-nodeKind
sh:or (
[ sh:nodeKind sh:IRI ]
[ sh:memberShape [ sh:nodeKind sh:IRI ] ]
) ; # datatype-nodeKind
sh:maxCount 1 ; # datatype-maxCount
] ;
sh:property [
Expand All @@ -159,17 +161,15 @@ shsh:ShapeShape
] ;
sh:property [
sh:path sh:in ;
sh:maxCount 1 ; # in-maxCount
sh:node shsh:ListShape ; # in-node
sh:maxCount 1 ; # in-maxCount
sh:minListLength 1 ; # in-minListLength
sh:memberShape [ a sh:NodeShape ] ; # in-memberShape
] ;
sh:property [
sh:path sh:languageIn ;
sh:maxCount 1 ; # languageIn-maxCount
sh:node shsh:ListShape ; # languageIn-node
] ;
sh:property [
sh:path ( sh:languageIn [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ;
sh:datatype xsd:string ; # languageIn-members-datatype
sh:maxCount 1 ; # languageIn-maxCount
sh:minListLength 1 ; # languageIn-minListLength
sh:memberShape [ sh:datatype xsd:string ] ; # languageIn-memberShape
] ;
sh:property [
sh:path sh:lessThan ;
Expand All @@ -183,7 +183,7 @@ shsh:ShapeShape
sh:path sh:maxCount ;
sh:datatype xsd:integer ; # maxCount-datatype
sh:maxCount 1 ; # maxCount-maxCount
sh:minInclusive 0 ; # maxCount-minInclusive
sh:minInclusive 0 ; # maxCount-minInclusive
] ;
sh:property [
sh:path sh:maxExclusive ;
Expand Down Expand Up @@ -230,7 +230,7 @@ shsh:ShapeShape
] ;
sh:property [
sh:path sh:or ;
sh:node shsh:ListShape ; # or-node
sh:memberShape shsh:ShapeShape ; # or-memberShape
] ;
sh:property [
sh:path sh:pattern ;
Expand Down Expand Up @@ -272,7 +272,7 @@ shsh:ShapeShape
] ;
sh:property [
sh:path sh:xone ;
sh:node shsh:ListShape ; # xone-node
sh:memberShape shsh:ShapeShape ; # xone-memberShape
] .

shsh:NodeShapeShape
Expand Down Expand Up @@ -323,11 +323,7 @@ shsh:ShapesListShape
sh:targetObjectsOf sh:and ; # and-members-node
sh:targetObjectsOf sh:or ; # or-members-node
sh:targetObjectsOf sh:xone ; # xone-members-node
sh:property [
sh:path ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ;
sh:node shsh:ShapeShape ;
] .

sh:memberShape shsh:ShapeShape .

# A path of blank node path syntax, used to simulate recursion
_:PathPath
Expand All @@ -354,13 +350,15 @@ shsh:PathNodeShape
sh:xone ( # path-metarule
[ sh:nodeKind sh:IRI ] # 2.3.1.1: Predicate path
[ sh:nodeKind sh:BlankNode ; # 2.3.1.2: Sequence path
sh:node shsh:PathListWithAtLeast2Members ;
sh:memberShape shsh:PathShape ; # sequence-memberShape
sh:minListLength 2 ; # sequence-minListLength
]
[ sh:nodeKind sh:BlankNode ; # 2.3.1.3: Alternative path
sh:closed true ;
sh:property [
sh:path sh:alternativePath ;
sh:node shsh:PathListWithAtLeast2Members ;
sh:memberShape shsh:PathShape ; # alternativePath-memberShape
sh:minListLength 2 ; # alternativePath-minListLength
sh:minCount 1 ;
sh:maxCount 1 ;
]
Expand Down Expand Up @@ -399,14 +397,6 @@ shsh:PathNodeShape
]
) .

shsh:PathListWithAtLeast2Members
a sh:NodeShape ;
sh:node shsh:ListShape ;
sh:property [
sh:path [ sh:oneOrMorePath rdf:rest ] ;
sh:minCount 2 ; # 1 other list node plus rdf:nil
] .

shsh:ShapesGraphShape
a sh:NodeShape ;
sh:targetObjectsOf sh:shapesGraph ;
Expand Down