Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions shacl12-profiling/examples/01.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ex:ont-M
a sh:ShapesGraph ;
.

ex:shape-1
a sh:NodeShape ;
rdfs:isDefinedBy ex:ont-M ;
.
14 changes: 14 additions & 0 deletions shacl12-profiling/examples/02.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 'Ontology M' uses a Shape defined by 'Ontology Other'
ex:ont-M
a sh:ShapesGraph ;
rdfs:member ex:shape-1 ;
.

ex:ont-Other
a sh:ShapesGraph ;
.

ex:shape-1
a sh:NodeShape ;
rdfs:isDefinedBy ex:ont-Other ;
.
9 changes: 9 additions & 0 deletions shacl12-profiling/examples/03.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 'Ontology N' imports 'Ontology M'
ex:ont-M
a owl:Ontology ;
.

ex:ont-N
a owl:Ontology ;
owl:imports ex:ont-M ;
.
26 changes: 26 additions & 0 deletions shacl12-profiling/examples/04.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# declaration of the Core profile
<http://www.w3.org/ns/shacl/profile/core>
a prof:Profile ;
prof:isProfileOf <https://www.w3.org/TR/shacl/> ;
prof:hasResource
<https://www.w3.org/TR/shacl12-core/> ,
<http://www.w3.org/ns/shacl-shacl/core> ;
.

# Core specification
<https://www.w3.org/TR/shacl12-core/>
a prof:ResourceDescriptor ;
prof:hasRole role:Specification ;
dcterms:format "text/html" ;
dcterms:conformsTo <http://www.w3.org/TR/html5/> ;
prof:hasArtifact <https://www.w3.org/TR/shacl12-core/> ;
.

# Core validator
<http://www.w3.org/ns/shacl-shacl/core>
a prof:ResourceDescriptor ;
prof:hasRole role:Validation ;
dcterms:format "text/turtle" ;
dcterms:conformsTo <https://www.w3.org/TR/shacl/> ;
prof:hasArtifact <http://www.w3.org/ns/shacl-shacl/core> ;
.
4 changes: 4 additions & 0 deletions shacl12-profiling/examples/05.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<SG1>
a prof:Profile ;
prof:isProfileOf <S1> ;
.
8 changes: 8 additions & 0 deletions shacl12-profiling/examples/06.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<SG1>
a prof:Profile ;
prof:isProfileOf <S1> ;
prof:hasResource [
prof:hasArtifact <SG1> ;
prof:hasRole role:validation ;
] ;
.
10 changes: 10 additions & 0 deletions shacl12-profiling/examples/07.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<SG1>
a prof:Profile ;
prof:isProfileOf <S1> ;
prof:hasResource [
prof:hasArtifact <S1> ;
prof:hasRole role:validation ;
dcterms:conformsTo <https://www.w3.org/TR/shacl12-core/> ;
dcterms:format "text/turtle" ;
] ;
.
13 changes: 13 additions & 0 deletions shacl12-profiling/examples/08.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<SG1>
a prof:Profile ;
prof:isProfileOf <S1> ;
prof:hasResource [
prof:hasArtifact <S1> ;
prof:hasRole
role:constraints ,
role:specification ,
role:validation ;
dcterms:conformsTo <https://www.w3.org/TR/shacl12-core/> ;
dcterms:format "text/turtle" ;
] ;
.
1 change: 1 addition & 0 deletions shacl12-profiling/examples/09.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<DG1> dcterms:conformsTo <SG1> . # via RDFS or OWL-RL reasoning
1 change: 1 addition & 0 deletions shacl12-profiling/examples/10.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<DG1> dcterms:conformsTo <SG1> .
1 change: 1 addition & 0 deletions shacl12-profiling/examples/11.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<SG1> prof:isProfileOf <S1> .
1 change: 1 addition & 0 deletions shacl12-profiling/examples/12.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<DG1> dcterms:conformsTo <S1> .
19 changes: 19 additions & 0 deletions shacl12-profiling/examples/13.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<http://www.w3.org/ns/shacl/profile/cd1>
a
owl:Ontology ,
prof:Profile ;
prof:isProfileOf sh: ;
rdfs:label "CD1 Profile of SHACL"@en ;
rdfs:comment """This is a Profile of SHACL 1.2 that excludes shapes found to
be computationally intensive.

Vocabulary elements of SHACL that are not listed as members of this profile may
not be used for implementations claiming conformance to this profile."""@en ;
rdfs:member
sh:AbstractResult ,
sh:AndConstraintComponent ,
# ... many skipped members
sh:xone ,
sh:zeroOrMorePath ,
sh:zeroOrOnePath ;
.
17 changes: 17 additions & 0 deletions shacl12-profiling/examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Examples

This directory contains example files in pseudo-Turtle format used within the Profiling HTML document.

All examples are included using ReSpec commands like this:

`<div class="turtle" data-include="examples/01.ttl" data-include-format="text"></div>`

## Validation

To validate an example you will need Python installed and the [rdflib](https://pypi.org/project/rdflib/) package installed. You cna then run `validate.py` with any example file as an argument, e.g.:

```bash
python check-rdf.py 01.ttl
```

The script will print "OK" if there are no syntax errors or else an error message.
8 changes: 8 additions & 0 deletions shacl12-profiling/examples/_prefixes.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX ex: <http://example.com/ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX prof: <http://www.w3.org/ns/dx/prof/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX role: <http://www.w3.org/ns/dx/prof/role/>
PREFIX sh: <http://www.w3.org/ns/shacl#>
PREFIX shpr: <http://www.w3.org/ns/shpr#>
11 changes: 11 additions & 0 deletions shacl12-profiling/examples/check-rdf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import sys
from rdflib import Graph

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Confirming - it's OK to have this dependency? I know we're not running this in CI at the moment.

Hm. Should we run this in CI?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We might only use this example checking for our doc development and not when the doc is published, so I think it's overkill to automate

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah, apologies, my approval comment went in between you posting this remark and it displaying for me.

I concur.


prefixes = open("_prefixes.ttl").read()
example_data = open(sys.argv[1]).read()

total = prefixes + "\n\n" + example_data

# print(total)
g = Graph().parse(data=total, format="turtle")
print("ok")
Loading
Loading