-
Notifications
You must be signed in to change notification settings - Fork 23
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
@default in @context in JSON-LD core syntax #328
Comments
Hi, I have an idea for a new feature. I see there is a feature freeze for 1.1 but do not know how to submit a feature for 1.2 I am working with W3C's SHACL and there can be deeply nested nodes and properties. Each sh:node is a sh:NodeShape and each sh:property is a sh:PropertyShape, and it gets very repetitive to write out those I would like to be able to define a default I have read a discussion before that JSON-LD core syntax is not for adding information, because that is only for framing. But I hope that can be reconsidered. In my opinion this is not adding, just rearranging, since the information is provided in the @context. (If this is impossible in the core syntax, even in a future 1.2 version, then perhaps there could be modifications made to framing to model infinite nesting.) Here's an example in 1.1 syntax: {
"@context": {
"schema": "http://schema.org/",
"sh": "https://www.w3.org/TR/shacl/",
"path": {
"@id": "sh:path",
"@type": "@id"
},
"class": {
"@id": "sh:class",
"@type": "@id"
},
"property": "sh:property",
"node": "sh:node"
},
"@type": "sh:NodeShape",
"class": "schema:Article",
"property": [{
"@type": "sh:PropertyShape",
"path": "schema:author"
}, {
"@type": "sh:PropertyShape",
"path": "schema:headline"
}, {
"@type": "sh:PropertyShape",
"path": "schema:interactionStatistic",
"node": {
"@type": "sh:NodeShape",
"class": "schema:InteractionCounter",
"property": [{
"@type": "PropertyShape",
"path": "schema:userInteractionCount"
}, {
"@type": "PropertyShape",
"path": "schema:interactionType",
"node": {
"class": "schema:CommentAction"
}
}]
}
}]
} And below would be my preferred syntax, with {
"@context": {
"schema": "http://schema.org/",
"sh": "https://www.w3.org/TR/shacl/",
"path": {
"@id": "sh:path",
"@type": "@id"
},
"class": {
"@id": "sh:class",
"@type": "@id"
},
"property": {
"@id": "sh:property",
"@type": "sh:class",
"@default": {
"@type": "sh:PropertyShape"
}
},
"node": {
"@id": "sh:node",
"@type": "sh:path",
"@default": {
"@type": "sh:NodeShape"
}
}
},
"@type": "sh:NodeShape",
"class": "schema:Article",
"property": [
"schema:author",
"schema:headline", {
"path": "schema:interactionStatistic",
"node": {
"class": "schema:InteractionCounter",
"property": [
"schema:userInteractionCount", {
"path": "schema:interactionType",
"node": "schema:CommentAction"
}
]
}
}
]
} |
This was considered in #76 and rejected as being out of scope. It certainly can be reconsidered in the future, as it is an often featured request. The solution for adding information to graphs is to use framing. See, example 23 which speaks to this specific use case. |
(See below)
The text was updated successfully, but these errors were encountered: