Skip to content

Instantly share code, notes, and snippets.

@michaelcpuckett
Last active February 15, 2020 11:28
Show Gist options
  • Save michaelcpuckett/35bf9773df25e3639e55ae15299ae63e to your computer and use it in GitHub Desktop.
Save michaelcpuckett/35bf9773df25e3639e55ae15299ae63e to your computer and use it in GitHub Desktop.
shacl-transformation-example
{
"@context": {
"@vocab": "http://news.example/vocab/",
"news": "http://news.example/vocab/"
},
"@type": "news:Response",
"articles": [
{
"headline": "Example headline 1",
"author": "Alice Jones"
},
{
"headline": "Example headline 2",
"author": "John Doe"
}
]
}
{
"@context": {
"@vocab": "http://www.w3.org/ns/shacl#",
"ex": "http://example.com/",
"sh": "http://www.w3.org/ns/shacl#",
"schema": "http://schema.org/",
"news": "http://news.example/vocab/",
"owl": "http://www.w3.org/2002/07/owl#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"id": "@id",
"type": "@type",
"targetClass": {
"@type": "@id"
},
"path": {
"@type": "@id"
},
"predicate": {
"@type": "@id"
},
"subject": {
"@type": "@id"
},
"entailment": {
"@type": "@id"
},
"defines": {
"@reverse": "rdfs:isDefinedBy"
}
},
"type": "owl:Ontology",
"entailment": "sh:Rules",
"defines": [
{
"id": "ex:NewsResponseNodeShape",
"type": "sh:NodeShape",
"targetClass": "news:Response",
"rule": [
{
"type": "sh:TripleRule",
"subject": "sh:this",
"predicate": "rdf:type",
"object": {
"id": "schema:ItemList"
}
},
{
"type": "sh:TripleRule",
"subject": "sh:this",
"predicate": "schema:itemListElement",
"object": {
"path": "news:articles"
}
}
],
"property": [
{
"path": "schema:itemListElement",
"minCount": 1
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment