Command line tool to manage ontologies and their imports in a local environment
Project description
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()
# get the transitive owl:imports closure into 'g'
env.get_closure("https://brickschema.org/schema/1.4-rc1/Brick", g)
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")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyontoenv-0.1.4.tar.gz
(874.2 kB
view hashes)
Built Distributions
Close
Hashes for pyontoenv-0.1.4-cp38-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fb0f5354aa40dcdc374fc9923e5185ec411da0adbfc2601ebbe190f10ae7572 |
|
MD5 | 26ebd45b11d716ad80c59db588ef1e24 |
|
BLAKE2b-256 | 3309e4c99054b7d756f3a74d4df945262796f47e0ccab5276840d1751e0b24fb |
Close
Hashes for pyontoenv-0.1.4-cp38-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18219847507aa89deff8ee38d2b2c5a00786c25224b4b9b9466fff45a921f154 |
|
MD5 | 0ba7d2a216b4d8a6e530b6d1e42b0bd4 |
|
BLAKE2b-256 | 83d4aa9dbe38b6bf17464b3e196984782eb9bb9a5116188fac04bdd0063c5690 |