Ontologies with Python, Jean-Baptiste Lamy, Apress Éditions, 350 pages Python et les ontologies, Jean-Baptiste Lamy, ENI Éditions, 310 pages Sombre comme l'Aurore, Jean-Baptiste Lamy, Éditions 38, 466 pages

The blog and personal site of Jean-Baptiste Lamy (Jiba).

My French novel "Sombre comme l'Aurore - La légende de Tienn Halidenn" has been published by Éditions du 38!

My book on Python and ontologies is available in English (Ontologies with Python) and French (Python et les ontologies).

Good reading!

Owlready2 0.38 has been released!

Owlready is a Python module for ontology-oriented programming. It can load OWL 2.0 ontologies and manipulate them transparently in Python.

Here are the changes:

  • Accepts localized language codes, such as fr_FR or fr_BE, and wildcard fr_any

  • Add 'update_is_a' optional args to Ontology.destroy()

  • Bugfixes: - Fix individual.INVERSE_prop update when prop is functional - Fix performance regression on complex SPARQL queries with OPTIONAL - Fix declare_datatype after a World has been closed - Fix Pellet reasoning on blank nodes (ignoring them) - Fix Pellet reasoning on strings data property that include comma "," - Fix boolean constant 'true' and 'false' in SPARQL engine - Fix INSERT SPARQL queries with UNION that insert RDF triples without variables - Fix SPARQL queries with only a FILTER NOT EXISTS in the WHERE part - Accept empty lines at the beginning of NTriple files - Support non-ASCII characters when parsing SWRL rules

The new version be downloaded from PyPI (Python Package Index): https://pypi.python.org/pypi/Owlready2

New journal paper "Decision-support systems for managing polypharmacy in the elderly"

I have published a new journal paper:

journalif [j72] Mouazer A, Tsopra R, Sedki K, Letord C, Lamy JB. Decision-support systems for managing polypharmacy in the elderly: A scoping review. Journal of Biomedical Informatics 2022;accepted

Owlready2 0.37 has been released!

Owlready is a Python module for ontology-oriented programming. It can load OWL 2.0 ontologies and manipulate them transparently in Python.

Here are the changes:

  • Add World.forget_reference(entity)

  • Add NamedIndividual (for SPARQL results on rdf:type)

  • Add 'update_relation' optional args to Ontology.destroy()

  • Add Ontology.set_base_iri() and Ontology.base_iri = "new_base_iri"

  • Bugfixes: - Fix SPARQL queries having a UNION but using no variable from the UNION - Fix SPARQL queries on read only quadstores - Fix SPARQL queries mixing OPTIONAL and VALUES / STATIC - Fix property defined as a subproperty of TransitiveProperty (and the like), but not of type ObjectProperty - Fix importlib.reload(owlready2) - Fix RDF/XML serialization of individuals whose class name start by a digit - Fix RDF/XML serialization when ontology base IRI ends with / - Fix Or.Classes = ... and And.Classes = ... - Fix ONLY class properties with more than two values

The new version be downloaded from PyPI (Python Package Index): https://pypi.python.org/pypi/Owlready2

Happy new year 2022!

_images/voeux_2022.png

Owlready2 0.36 has been released!

Owlready is a Python module for ontology-oriented programming. It can load OWL 2.0 ontologies and manipulate them transparently in Python.

Here are the changes:

  • Support xsd:duration, including DATETIME_DIFF(), DATETIME_ADD(), DATETIME_SUB() SPARQL non-standard functions

  • Faster ontology operation (e.g. ontology deletion) on big quadstores

  • Automatically add .owl, .rdf or .xml to ontology IRI if the IRI itself does not yield an OWL file

  • Bugfixes: - Fix FusionClasses (= individuals belonging to several classes, i.e. multiple instanciation) when using several worlds - Fix OPTIONAL SPARQL clause when guessing variable types - Fix typo in undo entity destruction (thanks Lukas Westhofen) - Fix IRI from OWL namespace in SWRL rules - Fix Pellet explanation on inconsistent ontology - Fix MEDDRA parent-child relation of LLT in PyMedTermino2 - Make sure the filename is a file before returning (Thanks Nicolas Rouquette)

The new version be downloaded from PyPI (Python Package Index): https://pypi.python.org/pypi/Owlready2

New journal paper "Automating clinical practice guideline recommendations for hereditary cancer risk using chatbots and ontologies"

I have published a new journal paper:

journal [j70] Ritchie JB, Frey L, Lamy JB, Bellcross C, Morrison H, Schiffman JD, Welch BM. Automating clinical practice guideline recommendations for hereditary cancer risk using chatbots and ontologies: System description. JMIR Cancer 2022

Owlready2 0.35 has been released!

Owlready is a Python module for ontology-oriented programming. It can load OWL 2.0 ontologies and manipulate them transparently in Python.

Here are the changes:

  • SPARQL optimizations

  • Support for VALUES in SPARQL

  • Add STATIC optimization keyword extension to SPARQL

  • Accept GROUP BY, HAVING, LIMIT in INSERT and DELETE SPARQL query

  • Add the STORID(iri), DATE(), TIME() and DATETIME() SPARQL function

  • UMLS CUI are now hierarchized by Semnatic Types (TUI)

  • Improved parallelism

  • Bugfixes: - Fix 'sqlite3.OperationalError: circular reference: prelim1_objs' in .instances(), caused by a bug in old versions of SQLite3 - Fix SPARQL INSERT query with data parameters in the INSERT clause - Fix RDF list parsing when the list includes the integer number 5 - Fix nb_parameter in SPARQL query when numbered parameters are used - Fix ObjectProperty.subclasses(), ObjectProperty.descendants(), Property.subclasses(), DataProperty.descendants(), AnnotationProperty.subclasses(), AnnotationProperty.descendants() - Fix declare_datatype() for datatype already used in Owlready, such as AnyURI - Fix Pellet on properties having annotations that are not declared in the loaded ontologies

The new version be downloaded from PyPI (Python Package Index): https://pypi.python.org/pypi/Owlready2

Owlready2 0.34 has been released!

Owlready is a Python module for ontology-oriented programming. It can load OWL 2.0 ontologies and manipulate them transparently in Python.

Here are the changes:

  • NEW FORUM ADDRESS: http://owlready.306.s1.nabble.com

  • Support SPARQL property path expressions with parentheses without sequences, repeats or negative property set nested inside repeats

  • Add define_datatype_in_ontology() global function for defining a new user-defined datatype in an ontology

  • Class.instances() now takes into account equivalent classes (like other class methods such as .descendants())

  • Add the LOADED(iri) SPARQL function

  • Support Thing.is_a.append(...)

  • Faster loading of very large quadstores

  • list(onto.metadata) now lists the annotations present on the ontology

  • Add OntologyClass and NamespaceClass argument to get_ontology() and get_namespace(), allowing the use of custom classes

  • Bugfixes: - Accept UTF8 and latin encoding from reasoners (thanks Francesco Compagno) - Fix SPARQL query with a UNION without variables - Fix semantic type support in UMLS

The new version be downloaded from PyPI (Python Package Index): https://pypi.python.org/pypi/Owlready2

Owlready2 0.33 has been released!

Owlready is a Python module for ontology-oriented programming. It can load OWL 2.0 ontologies and manipulate them transparently in Python.

Here are the changes:

  • Bugfixes: - Fix 'sqlite3.OperationalError: no such table: sqlite_schema' with SQLite3 < 0.33

The new version be downloaded from PyPI (Python Package Index): https://pypi.python.org/pypi/Owlready2

Owlready2 0.32 has been released!

Owlready is a Python module for ontology-oriented programming. It can load OWL 2.0 ontologies and manipulate them transparently in Python.

Here are the changes:

  • Add scripts to import OMOP-CDM as an ontology (see directory pymedtermino2/omop_cdm/)

  • SPARQL engine optimization

  • Bugfixes: - Fix name clash when creating individuals from classes whose names end with a number, e.g. "c1" + "1" vs "c" + "11" - Fix block with only a FILTER in SPARQL

The new version be downloaded from PyPI (Python Package Index): https://pypi.python.org/pypi/Owlready2

Owlready2 0.31 has been released!

Owlready is a Python module for ontology-oriented programming. It can load OWL 2.0 ontologies and manipulate them transparently in Python.

This version can open SPARQL endpoints, with the new SPARQL engine, and fixes several bogues, in particular in the SPARQL engine.

Here are the changes:

  • Can open SPARQL endpoints (see module owlready2.sparql.endpoint and doc)

  • Support ClaML file format in PyMedTermino2 for French ICD10

  • Bugfixes: - Fix prefix in SPARQL that does not correspond to an existing ontology - Fix ! in SPARQL FILTER - Fix Thing.subclasses() so as it now returns classes that have parent constructs but no parent named classes - Fix metaclass of FusionClass when creating individuals belonging to several classes, including one from PyMedTermino - Fix Prop[individual] for functional properties with no relation for the given individual

The new version be downloaded from PyPI (Python Package Index): https://pypi.python.org/pypi/Owlready2

Owlready2 0.30 has been released!

Owlready is a Python module for ontology-oriented programming. It can load OWL 2.0 ontologies and manipulate them transparently in Python.

This version brings two new features:

  • a SPARQL engine which translates the queries into SQL. This engine is much faster than RDFlib (around 60x), it has no dependencies and a shorter loading time. It currently supports a subset of SPARQL: SELECT, INSERT and DELETE queries, sub-queries, UNION, OPTIONAL, FILTER, BIND, FILTER EXISTS, FILTER NOT EXISTS, all functions of SPARQL, blank node notation with square brackets, e.g. ‘[a XXX]’, and property path expressions except those with parentheses.

    This new SPARQL engine can be used as follows (see documentation):

    list(default_world.sparql("""<query>"""))
  • Dublin Core support via integrated OWL translation. It is possible to load Dublin Core directly as follows:

    dc = get_ontology("http://purl.org/dc/elements/1.1").load()

Here are the changes:

  • New native SPARQL engine that translates SPARQL queries to SQL

  • Direct support for Dublin Core via the integration of an OWL translation

  • Bugfixes: - Fix RecursionError when saving very deep ontologies to RDF/XML - Fix IRI of the form 'urn:uuid:...' - Fix loading ontologies that modify an imported property

The new version be downloaded from PyPI (Python Package Index): https://pypi.python.org/pypi/Owlready2

New journal paper "A data science approach to drug safety"

I have published a new journal paper:

journalif [j66] Lamy JB. A data science approach to drug safety: Semantic and visual mining of adverse drug events from clinical trials of pain treatments. Artificial Intelligence in Medicine 2021;115:102074

Owlready2 0.29 has been released!

Owlready is a Python module for ontology-oriented programming. It can load OWL 2.0 ontologies and manipulate them transparently in Python.

Here are the changes:

  • Bugfixes: - Fix installation as a requirement of another Python module

The new version be downloaded from PyPI (Python Package Index): https://pypi.python.org/pypi/Owlready2