Skip to main content

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, which is currently only available for python 3.8.x on MacOS and Linux:

pip install py_horned_owl

From sources

To build locally from sources, you will need Rust, PyO3 and Maturin.

First check out the associated Python-compatible version of horned-owl: git clone https://github.com/jannahastings/horned-owl

Then 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

Currently the library only supports loading ontologies from .owx (OWL-XML) files. Some test files in this format are available in the owl-xml horned-owl folder. Alternatively, ROBOT can transform ontologies into this format 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

py_horned_owl-0.2.0-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.4 MB view hashes)

Uploaded PyPy manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.5+ x86-64

py_horned_owl-0.2.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.4 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.5+ x86-64

py_horned_owl-0.2.0-cp310-cp310-macosx_10_7_x86_64.whl (1.5 MB view hashes)

Uploaded CPython 3.10 macOS 10.7+ x86-64

py_horned_owl-0.2.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.4 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.5+ x86-64

py_horned_owl-0.2.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.4 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.5+ x86-64

py_horned_owl-0.2.0-cp38-cp38-macosx_10_7_x86_64.whl (558.2 kB view hashes)

Uploaded CPython 3.8 macOS 10.7+ x86-64

py_horned_owl-0.2.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.4 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.5+ x86-64

py_horned_owl-0.2.0-cp37-abi3-macosx_10_7_x86_64.whl (625.9 kB view hashes)

Uploaded CPython 3.7+ macOS 10.7+ x86-64

py_horned_owl-0.2.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.4 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.5+ x86-64

py_horned_owl-0.2.0-cp36-cp36m-macosx_10_7_x86_64.whl (546.1 kB view hashes)

Uploaded CPython 3.6m macOS 10.7+ x86-64

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