#environment #ontoenv #graph #format #pyontoenv #onto-env

pyontoenv

Command line tool to manage ontologies and their imports in a local environment

26 releases

new 0.2.0-a8 Apr 18, 2025
0.2.0-a1 Mar 19, 2025
0.1.10-a1 Oct 8, 2024
0.1.9-a6 Jul 31, 2024

#156 in Science

Download history 1/week @ 2025-02-01 2/week @ 2025-02-15 13/week @ 2025-02-22 100/week @ 2025-03-15 29/week @ 2025-03-22 100/week @ 2025-04-05 259/week @ 2025-04-12

398 downloads per month

BSD-3-Clause

1MB
3K SLoC

PyOntoenv

Installation

pip install pyontoenv

Usage

from ontoenv import Config, OntoEnv
from rdflib import Graph

cfg = Config(["../brick"], strict=False, offline=True)

# make environment
env = OntoEnv(cfg)

g = Graph()
# put the transitive owl:imports closure into 'g'
env.get_closure("https://brickschema.org/schema/1.4-rc1/Brick", g)

# or, get the graph directly
g = env.get_closure("https://brickschema.org/schema/1.4-rc1/Brick")

brick = Graph()
brick.parse("Brick.ttl", format="turtle")
# transitively import dependencies into the 'brick' graph, using the owl:imports declarations
env.import_dependencies(brick)

# pull Brick graph out of environment
brick = env.get_graph("https://brickschema.org/schema/1.4-rc1/Brick")

# import graphs by name
env.import_graph(brick, "https://w3id.org/rec")

Dependencies

~33–49MB
~819K SLoC