Recent Releases of py-horned-owl

py-horned-owl - v1.2.1

What's Changed

  • String representation by @b-gehrke in https://github.com/ontology-tools/py-horned-owl/pull/39
  • Update horned-dependency

Full Changelog: https://github.com/ontology-tools/py-horned-owl/compare/v1.2.0...v1.2.1

- Rust
Published by b-gehrke 8 months ago

py-horned-owl - v1.2.0

Breaking changes

  • Properties from and to of (ObjectProperty- DataProperty-, NegativeObjectProperty-, and NegativeDataProperty) have been renamed to source and target to avoid clashes with Python keywords

What's Changed

  • Fixing URI of object property in usage.rst by @cmungall in https://github.com/ontology-tools/py-horned-owl/pull/35
  • Fix typing for addaxiom arguments in _init__.pyi, #36 by @cmungall in https://github.com/ontology-tools/py-horned-owl/pull/37
  • Feature/models from template by @b-gehrke in https://github.com/ontology-tools/py-horned-owl/pull/38

Full Changelog: https://github.com/ontology-tools/py-horned-owl/compare/v1.1.0...v1.2.0

- Rust
Published by b-gehrke about 1 year ago

py-horned-owl - v1.1.0

Breaking Changes

  • Order of arguments in constructor of SubClassOf swapped. It now takes the subclass as a first argument and superclass as second argument to match Functional Syntax

Full Changelog: https://github.com/ontology-tools/py-horned-owl/compare/v1.0.2...v1.1.0

- Rust
Published by b-gehrke about 1 year ago

py-horned-owl - v1.0.2

What's Changed

  • Fixed hierarchy queries by @b-gehrke in https://github.com/ontology-tools/py-horned-owl/pull/33
  • Fix typos in usage.rst by @cmungall in https://github.com/ontology-tools/py-horned-owl/pull/29
  • Readded add_prefix_mapping in 887204d

Full Changelog: https://github.com/ontology-tools/py-horned-owl/compare/v1.0.1...v1.0.2

- Rust
Published by b-gehrke about 1 year ago

py-horned-owl - v1.0.1

What's Changed

  • Documentation updates by @b-gehrke in https://github.com/ontology-tools/py-horned-owl/pull/22
  • Performance improvements by @b-gehrke in https://github.com/ontology-tools/py-horned-owl/pull/26
  • IO tests by @b-gehrke in https://github.com/ontology-tools/py-horned-owl/pull/27
  • Added convenience methods for class expression creation by @b-gehrke in https://github.com/ontology-tools/py-horned-owl/pull/24
  • Integrate tests to CI by @b-gehrke in https://github.com/ontology-tools/py-horned-owl/pull/28

Full Changelog: https://github.com/ontology-tools/py-horned-owl/compare/v1.0.0...v1.1.0

- Rust
Published by b-gehrke over 1 year ago

py-horned-owl - v1.0.1.dev1

What's Changed

  • Added simple performance scripts by @b-gehrke in https://github.com/ontology-tools/py-horned-owl/pull/21
  • Documentation updates by @b-gehrke in https://github.com/ontology-tools/py-horned-owl/pull/22
  • Added documentation by @b-gehrke in https://github.com/ontology-tools/py-horned-owl/pull/23
  • Performance improvements by @b-gehrke in https://github.com/ontology-tools/py-horned-owl/pull/26

Full Changelog: https://github.com/ontology-tools/py-horned-owl/compare/v1.0.0...v1.0.1.dev1

- Rust
Published by b-gehrke over 1 year ago

py-horned-owl - v1.0.0

What's Changed

  • Support for horned-owl 1.0.0
  • More convenience functions to create components
  • Better support for CURIEs in all places
  • Adding ofn read support. by @cmungall in https://github.com/jannahastings/py-horned-owl/pull/19
  • Add load and save serialization options by @b-gehrke in https://github.com/jannahastings/py-horned-owl/pull/20

New Contributors

  • @cmungall made their first contribution in https://github.com/jannahastings/py-horned-owl/pull/19

Full Changelog: https://github.com/jannahastings/py-horned-owl/compare/v0.3.2...v1.0.0

- Rust
Published by b-gehrke over 1 year ago

py-horned-owl - v0.3.2

What's Changed

  • Documentation and fixed python 3.8 typing error in python stubs added by @b-gehrke in https://github.com/jannahastings/py-horned-owl/pull/17

Full Changelog: https://github.com/jannahastings/py-horned-owl/compare/v0.3.1...v0.3.2

- Rust
Published by b-gehrke about 2 years ago

py-horned-owl - v0.3.1

What's Changed

  • Added proper conversions for references. Thus fixing infinite recursion in get_axioms_for_iri function.

Full Changelog: https://github.com/jannahastings/py-horned-owl/compare/v0.3.0...v0.3.1

- Rust
Published by b-gehrke about 2 years ago

py-horned-owl - v0.3.0

What's Changed

Overview - rust native types

Prior to version 0.3.0 axioms and other data types were expressed as S-Expressions-like lists of strings and converted to horned-owl types in rust. With the new version, local rust types (thin wrappers around horned-owl types) are exported directly, allowing a more pythonic way of interacting with the horned owl library. For example, consider the axiom

Class: Child SubClassOf: has_parent some Human

This axiom was previously written as

python [ 'SubClassOf', ':Child', [ 'ObjectSomeValuesFrom', ':has_parent', 'Human' ] ]

Now it is written as

python SubClassOf( Class(IRI.parse(':Child')), ObjectSomeValuesFrom( ObjectProperty(IRI.parse(':has_parent')), Class(IRI.parse(':Human')) ) )

In contrast to the S-Expression way, we now use proper types and classes. Datatypes can be created by invoking their constructor or (in case of IRI) their factory method. This does not only improve the readability but also allows type checkers to spot problems.

Type support

In addition to the types theirselves, version 0.3.0 adds python stubs for all classes, their fields and methods, and other functions. They can be used up by language servers and IDEs to further improve the developer experience.

Instance checking

With native rust types being exposed as python classes checking which kind of axiom or class expression is now as easy as checking the runtime type of any other python type using isinstanceof.

Completeness

While previously the conversation between rust and python objects was implemented manually for only a subset of all types in version 0.3.0 the conversion logic is generated by macros for each datatype. Hence, all datatypes occuring in an ontology are now accessible and manipulatable from python.

Performance

A quick comparison of performance shows major improvements in interacting with axioms: For this test, the chebi_core ontology was loaded (three times and then averaged). Then, the number of axioms was counted by iteration over all axioms in the ontology. Lastly 100.000 axioms were added to an empty ontology. Additionally, the performance of horned-owl was recorded as a baseline. Below are the performance results.

| Task | 0.2.2 | 0.3.0 | horned-owl |---|---|---|---| | Loading chebi | 26.2704s | 27.5580s | 9.9989s | Iterating axioms | 2.7132s | 1.1928s | 3.6232 | Adding 100.000 axioms | 4.3871s | 0.6688s | 0.04929ms

It is unclear, why iterating all axioms is slower in native horned-owl.

Alternative approache using JSON or other serializations

Using other serializations like serde(-json) would require creating similar wrappers as now with pyo3. Furthermore, to add the same level of type support, python classes and functions would have to be created or generated to serialize and deserialize on the python side.

Examples

```python import pyhornedowl from pyhornedowl.model import *

filename = "/path/to/ontology.owl" onto = pyhornedowl.openontology(filename) # open and load an ontology classes = onto.getclasses() # get all defined classes axioms = onto.get_axioms() # get all axioms

axiom = SubClassOf(Class(onto.iri("http://example.com/A")), Class(onto.iri('http://example.com/B'))) # define a new axiom onto.add_axiom(axiom) # add axiom to ontology

subclassaxioms = [a for a in axioms if isinstance(a.axiom, SubClassOf)] # get all SubClassOf axioms

```

Full Changelog: https://github.com/jannahastings/py-horned-owl/compare/v0.2.2...v0.3.0

- Rust
Published by github-actions[bot] about 2 years ago

py-horned-owl - v0.3.0rc1

Version 0.3.0rc1

Overview - rust native types

Prior to version 0.3.0 axioms and other data types were expressed as S-Expressions-like lists of strings and converted to horned-owl types in rust. With the new version, local rust types (thin wrappers around horned-owl types) are exported directly, allowing a more pythonic way of interacting with the horned owl library. For example, consider the axiom

Class: Child SubClassOf: has_parent some Human

This axiom was previously written as

python [ 'SubClassOf', ':Child', [ 'ObjectSomeValuesFrom', ':has_parent', 'Human' ] ]

Now it is written as

python SubClassOf( Class(IRI.parse(':Child')), ObjectSomeValuesFrom( ObjectProperty(IRI.parse(':has_parent')), Class(IRI.parse(':Human')) ) )

In contrast to the S-Expression way, we now use proper types and classes. Datatypes can be created by invoking their constructor or (in case of IRI) their factory method. This does not only improve the readability but also allows type checkers to spot problems.

Type support

In addition to the types theirselves, version 0.3.0 adds python stubs for all classes, their fields and methods, and other functions. They can be used up by language servers and IDEs to further improve the developer experience.

Instance checking

With native rust types being exposed as python classes checking which kind of axiom or class expression is now as easy as checking the runtime type of any other python type using isinstanceof.

Completeness

While previously the conversation between rust and python objects was implemented manually for only a subset of all types in version 0.3.0 the conversion logic is generated by macros for each datatype. Hence, all datatypes occuring in an ontology are now accessible and manipulatable from python.

Performance

A quick comparison of performance shows major improvements in interacting with axioms: For this test, the chebi_core ontology was loaded (three times and then averaged). Then, the number of axioms was counted by iteration over all axioms in the ontology. Lastly 100.000 axioms were added to an empty ontology. Additionally, the performance of horned-owl was recorded as a baseline. Below are the performance results.

| Task | 0.2.2 | 0.3.0 | horned-owl |---|---|---|---| | Loading chebi | 26.2704s | 27.5580s | 9.9989s | Iterating axioms | 2.7132s | 1.1928s | 3.6232 | Adding 100.000 axioms | 4.3871s | 0.6688s | 0.04929ms

It is unclear, why iterating all axioms is much slower on

Alternative approache using JSON or other serializations

Using other serializations like serde(-json) would require creating similar wrappers as now with pyo3. Furthermore, to add the same level of type support, python classes and functions would have to be created or generated to serialize and deserialize on the python side.

Full Changelog: https://github.com/jannahastings/py-horned-owl/compare/v0.2.2...v0.3.0rc.1

- Rust
Published by b-gehrke over 2 years ago

py-horned-owl - v0.2.2

What's Changed

  • Updated horned owl dependency to latest stable release by @areleu in https://github.com/jannahastings/py-horned-owl/pull/12

New Contributors

  • @areleu made their first contribution in https://github.com/jannahastings/py-horned-owl/pull/12

Full Changelog: https://github.com/jannahastings/py-horned-owl/compare/v0.2.1...v0.2.2

- Rust
Published by b-gehrke over 2 years ago

py-horned-owl - v0.2.1

What's Changed

  • Added ParserConfiguration to open function by @Eugenio2192 in https://github.com/jannahastings/py-horned-owl/pull/1
  • Add build scripts by @Eugenio2192 in https://github.com/jannahastings/py-horned-owl/pull/3
  • Add more py axioms by @Eugenio2192 in https://github.com/jannahastings/py-horned-owl/pull/5
  • Add version and ontology IRI by @Eugenio2192 in https://github.com/jannahastings/py-horned-owl/pull/7
  • Patch actions by @Eugenio2192 in https://github.com/jannahastings/py-horned-owl/pull/4

New Contributors

  • @Eugenio2192 made their first contribution in https://github.com/jannahastings/py-horned-owl/pull/1

Full Changelog: https://github.com/jannahastings/py-horned-owl/commits/v0.2.1

- Rust
Published by b-gehrke over 2 years ago