-
Notifications
You must be signed in to change notification settings - Fork 44
Externalise Profiling's e.g.s #945
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 ; | ||
| . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 ; | ||
| . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 ; | ||
| . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> ; | ||
| . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| <SG1> | ||
| a prof:Profile ; | ||
| prof:isProfileOf <S1> ; | ||
| . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 ; | ||
| ] ; | ||
| . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" ; | ||
| ] ; | ||
| . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" ; | ||
| ] ; | ||
| . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| <DG1> dcterms:conformsTo <SG1> . # via RDFS or OWL-RL reasoning |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| <DG1> dcterms:conformsTo <SG1> . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| <SG1> prof:isProfileOf <S1> . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| <DG1> dcterms:conformsTo <S1> . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 ; | ||
| . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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#> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import sys | ||
| from rdflib import Graph | ||
|
|
||
| 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") | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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?
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.
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
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.
Ah, apologies, my approval comment went in between you posting this remark and it displaying for me.
I concur.