-
Notifications
You must be signed in to change notification settings - Fork 0
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: SHACL derived from map #126
base: issue_115_shapes
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ base "https://schema.example.org/" | |
|
||
// this sample is inspired by https://w3c.github.io/shacl/shacl-compact-syntax/#example | ||
|
||
node-shape PersonNodeShape { | ||
node-shape PersonNodeShape from PersonMapping { | ||
// deactivated | ||
|
||
target-classes | ||
|
@@ -14,26 +14,29 @@ node-shape PersonNodeShape { | |
rdf.^type | ||
|
||
properties | ||
ex.ssn node-kind Literal [0..1] { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed |
||
ex.ssn { | ||
cardinality [0..1] | ||
datatype xsd.string | ||
pattern "^\\\\d{3}-\\\\d{2}-\\\\d{4}$" | ||
} | ||
|
||
ex.worksFor node-kind IRI [0..*] { | ||
ex.worksFor { | ||
cardinality [0..*] | ||
classes ex.Company | ||
pattern "^https://data.example.org/" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed because |
||
} | ||
|
||
ex.address node-kind BlankNode [0..1] { | ||
ex.address { | ||
cardinality [0..1] | ||
node-shapes AddressNodeShape | ||
} | ||
|
||
// this shows the union of all attributes in the expected order of appearance. note that combining all attributes like this doesn't make much sense. | ||
ex.hasAnything node-kind Any [0..*] { | ||
ex.hasAnything { | ||
node-kind Any | ||
cardinality [0..*] | ||
Comment on lines
+35
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I propose to move |
||
classes ex.Company | ||
datatype xsd.string | ||
node-shapes EmptyNodeShape | ||
pattern "^https://data.example.org/" | ||
} | ||
|
||
// alternatively to embedded property shapes, also support the use of externalized property shapes | ||
|
@@ -43,24 +46,33 @@ node-shape PersonNodeShape { | |
|
||
node-shape AddressNodeShape { | ||
properties | ||
ex.city node-kind Literal [1..1] { | ||
ex.city { | ||
node-kind Literal | ||
cardinality [1..1] | ||
datatype xsd.string | ||
} | ||
|
||
ex.postalCode node-kind Literal [1..1] { | ||
ex.postalCode { | ||
node-kind Literal | ||
cardinality [1..1] | ||
datatype xsd.string | ||
} | ||
} | ||
|
||
node-shape EmptyNodeShape { | ||
} | ||
|
||
property-shape EmptyPropertyShape node-kind Any [0..*] { | ||
property-shape EmptyPropertyShape { | ||
node-kind Any | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that |
||
cardinality [0..*] | ||
} | ||
|
||
property-shape AddressPropertyShape node-kind BlankNode [0..1] { | ||
property-shape AddressPropertyShape { | ||
deactivated | ||
|
||
node-kind BlankNode | ||
cardinality [0..1] | ||
|
||
path ex.address | ||
|
||
node-shapes AddressNodeShape | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Main change, which would have multiple effects:
PersonMapping
would automatically generate a Property Shape, even if not listed hereproperties
types