docs.rs failed to build ontoenv-python-0.5.0-a5
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
ontoenv-python-0.5.0-a1
OntoEnv Python Bindings
Installation
pip install ontoenv
Usage
# creates a new environment in the current directory, or loads
# an existing one. To use a different directory, pass the 'path'
# argument: OntoEnv(path="/path/to/env")
# OntoEnv() will discover ontologies in the current directory and
# its subdirectories
=
# add an ontology from a file path.
# env.add returns the name of the ontology, which is its URI
# e.g. "https://brickschema.org/schema/1.4-rc1/Brick"
=
# When you add from a URL whose declared ontology name differs (for example a
# versioned IRI served at a versionless URL), ontoenv records that alias. You
# can later refer to the ontology by either the canonical name or the original
# URL when resolving imports or querying.
# get the graph of the ontology we just added
# env.get_graph returns an rdflib.Graph
=
# get the full closure of the ontology, including all of its imports
# returns a tuple (rdflib.Graph, list[str])
, =
# you can also add ontologies from a URL
=
=
# if you have an rdflib.Graph with an owl:Ontology declaration,
# you can transitively import its dependencies into the graph
=
# this graph just has one triple: the ontology declaration for Brick
# this will load all of the owl:imports of the Brick ontology into 'g'
Custom graph store
If you want OntoEnv to write graphs into an existing Python-backed store, pass a graph_store
object that implements a small protocol:
...
...
...
...
... # optional, returns {"num_graphs": ..., "num_triples": ...}
Example:
=
=
graph_store is currently incompatible with recreate and create_or_use_cached.
CLI Entrypoint
Installing ontoenv also provides the Rust-backed ontoenv command-line tool:
pip install ontoenv
ontoenv --help
The CLI is identical to the standalone ontoenv-cli binary; see the top-level README for usage.