owl2shacl
A CLI tool that tries to convert simple OWL ontologies into SHACL shapes. OWL ontologies define logical relationships. SHACL shapes define a data scheme, and allow to validate data against them. Strictly speaking, as these are different things, such a conversion is thus illegal/wrong in the ideological/theoretical sense. Thus this tool is not generally applicable, but only under the circumstance, that the OWL ontology is actually written as a data specification - if it is understood as a kind of distributed database schema, rather then for logical inference. Not only that, but it also has to conform to certain, very narrow rules, and only a few basic properties are translated into SHACL; the rest is ignored.
Supported OWL ontologies
Roughly speaking, this tool supports a 25% subset of OWL Lite, plus some third party properties.
More specifically:
- OWL Lite
-
Class(Thing, Nothing) - `rdfs:subClassOf
-
rdf:Property -
rdfs:subPropertyOf -
rdfs:domain -
rdfs:range -
Individual -
equivalentClass -
equivalentProperty -
sameAs -
differentFrom -
AllDifferent -
distinctMembers -
ObjectProperty -
DatatypeProperty -
inverseOf -
TransitiveProperty -
SymmetricProperty -
FunctionalProperty -
InverseFunctionalProperty -
Restriction -
onProperty -
allValuesFrom -
someValuesFrom -
minCardinality -
maxCardinality -
cardinality -
Ontology -
imports -
intersectionOf -
versionInfo -
priorVersion -
backwardCompatibleWith -
incompatibleWith -
DeprecatedClass -
DeprecatedProperty -
rdfs:label -
rdfs:comment -
rdfs:seeAlso -
rdfs:isDefinedBy -
AnnotationProperty -
OntologyProperty -
xsddatatypes
-
- others
- domainIncludes
- rangeIncludes
How to compile
You need to install Rust(lang) and Cargo.
Then get the whole repo plus git sub-modules with:
Then you can run:
If all goes well, the executable can be found at target/release/owl2shacl.
Get the tool
As for now, you have two choices:
- Compile it yourself
- Download a Linux x86_64 statically linked binary from the releases page