Skip to content

v3.4.0-beta

Compare
Choose a tag to compare
@urbanmatthias urbanmatthias released this 04 Aug 13:16
0da7b0c

OWL is now integrated in osp-core.

Use pico install emmo to install EMMO. To integrate your own owl ontology create a file similar to osp/core/ontology/docs/emmo.yml.

Small example:

>>> from osp.core.namespaces import math
>>> math.Numerical.attributes
{<OntologyAttribute math.hasNumericalData>: None}
>>> x = math.Numerical(hasNumericalData=12)
>>> x
<math.Numerical: c11cc272-cdcf-421a-8838-5f177b065746,  CoreSession: @0x7f1987173190>
>>> x.hasNumericalData
12

The changes are mostly backwards compatible, although you will probably get some warnings. To get rid of the warnings:

  • from osp.core import namespace is now from osp.core.namespaces import namespace
  • In the YAML ontology, the entity names need no longer be ALL_CAPS
  • If you reference entities from code, you have to match the case of the entities as defined in the ontology.