Python tools for validating and rendering iSamples vocabularies.
Valid vocabulary:
$ vocab validate example/data/example.ttl
Loaded vocabulary https://example.net/my/minimal/vocab
SHACL conformance: True
Vocabulary with no top concept:
$ vocab validate example/data/example_notop.ttl
SHACL conformance: False
Validation Report
Conforms: False
Results (2):
20 of 21 applied.
Constraint Violation in OrConstraintComponent (http://www.w3.org/ns/shacl#OrConstraintComponent):
Severity: sh:Violation
Source Shape: skos:VocabularyShape
Focus Node: eg:vocab
Value Node: eg:vocab
Message: Node eg:vocab does not conform to one or more shapes in skos:ExtensionVocabularyShape , skos:BaseVocabularyShape
Constraint Violation in OrConstraintComponent (http://www.w3.org/ns/shacl#OrConstraintComponent):
Severity: sh:Violation
Source Shape: skos:VocabularyConceptShape
Focus Node: eg:thing
Value Node: eg:thing
Message: Node eg:thing does not conform to one or more shapes in skos:NarrowerConceptShape , skos:TopConceptShape
Vocabulary not in conformance. Skipping further tests.
$ vocab markdown example/data/example.ttl > example/example.md
Where a vocabulary is made up from multiple parts (e.g. one or more extensions), all vocabulary parts may be loaded and documented as a single markdown file by including all the source files in the command. e.g.:
$ vocab markdown example/data/example.ttl \
example/data/extension_example.ttl \
example/data/extension_extension.ttl \
example/data/beer.ttl > example/example.qmd
Use poetry for development work.
For other use, create a python virtual environment and
pip install git+https://github.com/isamplesorg/vocab_tools.git@main
To enable the SPARQL service endpoint, also install uvicorn
and rdflib-endpoint
:
pip install uvicorn git+https://github.com/vemonet/rdflib-endpoint.git@main