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. Striclty 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 sircumstance, that the OWL ontolog 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.
Roughtly 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
- xsd datatypes
- others
- domainIncludes
- rangeIncludes
You need to install Rust(lang) and Cargo.
Then get the whole repo plus git sub-modules with:
git clone --recurse-submodules https://github.com/hoijui/owl2shacl.git
cd owl2shacl
Then you can run:
cargo build --release
If all goes well, the executable can be found at target/release/owl2shacl
.
As for now, you have two choices:
- Compile it yourself
- Download a Linux x86_64 statically linked binary from the releases page