CLI reference
Synopsis
Section titled “Synopsis”uv run extractor <input> <output> [--shapes-base URL] [--root-classes FILE]Arguments
Section titled “Arguments”The ontology source. Accepts:
- A local file path (
.ttl,.rdf,.owl,.n3,.nt,.jsonld) - A local directory containing subdirectories with ontology files
- An HTTP or HTTPS URL pointing to a remote ontology
output
Section titled “output”Where to write the generated SHACL shapes. The output is always Turtle format.
--shapes-base
Section titled “--shapes-base”Override the base URL for the shapes namespace. Without this flag, the namespace is derived automatically:
- Modular directory input: defaults to
https://w3id.org/skg-if/shapes/ - Single file or URL: derived from the ontology IRI (e.g.,
https://example.org/myonto/shapes/) - If no ontology IRI is found: falls back to
http://example.org/shapes/
You typically need this flag for extension ontologies, where the auto-derived namespace doesn’t match the intended one.
--root-classes
Section titled “--root-classes”Path to a JSON file that explicitly sets which classes get sh:targetClass. The file maps module names to class URIs:
{ "agent": "http://xmlns.com/foaf/0.1/Agent", "grant": "http://purl.org/cerif/frapo/Grant"}Without this flag, root classes are detected automatically: any described class that no other described class points to as a target is treated as root. This heuristic fails when classes reference each other across modules (e.g., Agent referenced by Grant), in which case you need this flag.