pyontoenv

Crates.iopyontoenv
lib.rspyontoenv
version0.1.10-a1
sourcesrc
created_at2024-04-26 22:17:04.22401
updated_at2024-10-08 14:59:54.010872
descriptionCommand line tool to manage ontologies and their imports in a local environment
homepagehttps://github.com/gtfierro/ontoenv-rs
repositoryhttps://github.com/gtfierro/ontoenv-rs
max_upload_size
id1221959
size37,043
Gabe Fierro (gtfierro)

documentation

README

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")
Commit count: 146

cargo fmt