No project description provided
Project description
py-horned-owl
An experimental bridge from horned-owl to python using PyO3.
Installation
Published version
To install the published library:
pip install py_horned_owl
From sources
To build locally from sources, you will need Rust, PyO3 and Maturin.
Check out this repository:
git clone https://github.com/jannahastings/py-horned-owl/
In the directory py-horned-owl, create and activate a virtual Python environment:
virtualenv py-horned-owl
source bin/activate
Then you can get maturin to build the library and install it into the virtual Python environment with:
maturin develop
Usage
The library supports loading ontologies from .owl
(RDF-XML) and .owx
(OWL-XML) files via horned-owl's parsing functionality. ROBOT can transform ontologies that are in other OWL flavours into one of these formats using robot convert
.
Example of simple usage:
import pyhornedowl
ontoname = "family.owx"
onto = pyhornedowl.open_ontology(ontoname)
print (f"Loaded ontology has {len(onto.get_classes())} classes.")
print (f"Loaded ontology has {len(onto.get_axioms())} axioms.")
for c in onto.get_classes():
print(onto.get_axioms_for_iri(c))
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 Distributions
Built Distribution
Hashes for py_horned_owl-0.2.1-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 434ac23ab9aa31ee5f656a7149fe5aff6626b6e7def0ba97d174a0ed40e36d7d |
|
MD5 | 786a230ee280678180a2a9f1258404e6 |
|
BLAKE2b-256 | 6e58599600976abdcdb55a299fe8036367d827bcb376f251e112742ca5e2e925 |