Skip to main content

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


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.7a2.tar.gz (874.1 kB view hashes)

Uploaded Source

Built Distributions

pyontoenv-0.1.7a2-cp38-abi3-win_amd64.whl (5.2 MB view hashes)

Uploaded CPython 3.8+ Windows x86-64

pyontoenv-0.1.7a2-cp38-abi3-macosx_11_0_arm64.whl (5.6 MB view hashes)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

pyontoenv-0.1.7a2-cp38-abi3-macosx_10_13_x86_64.macosx_11_0_arm64.macosx_10_13_universal2.whl (11.5 MB view hashes)

Uploaded CPython 3.8+ macOS 10.13+ universal2 (ARM64, x86-64) macOS 10.13+ x86-64 macOS 11.0+ ARM64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page