Skip to content
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

Open
wants to merge 1 commit into
base: issue_115_shapes
Choose a base branch
from
Open

Conversation

tpluscode
Copy link
Contributor

@tpluscode tpluscode commented Apr 13, 2023

re #125

@@ -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 {
Copy link
Contributor Author

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:

  1. every property mapped in the the PersonMapping would automatically generate a Property Shape, even if not listed here
  2. properties would be suggested from the predicates mapped in properties
  3. target classes would be suggested based on the mapping types

@@ -14,26 +14,29 @@ node-shape PersonNodeShape {
rdf.^type

properties
ex.ssn node-kind Literal [0..1] {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed node-kind because it would be implied from the the mapping itself

Comment on lines +35 to +36
node-kind Any
cardinality [0..*]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I propose to move node-kind and cardinality inside the block since I expect both would be optional

classes ex.Company
pattern "^https://data.example.org/"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed because sh:pattern actually does not work with URLs

datatype xsd.string
}
}

node-shape EmptyNodeShape {
}

property-shape EmptyPropertyShape node-kind Any [0..*] {
property-shape EmptyPropertyShape {
node-kind Any
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that node-kind Any could actually be skipped unless its purpose is to override the default output derived from the mapping.

@mchlrch
Copy link
Member

mchlrch commented Apr 19, 2023

This PR suggests to support filling shapes from existing mapping blocks.

An earlier idea #7 was the exact opposite: to write the shapes first and drive proposals shown in the mapping from the shape

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