1

Some entities/classes present in knowledge-graphs have operations performed on them like 'Union', 'Intersection' etc. Below is one ontology file which has has lots of union operations on various of its classes.

ontology -> Link

Problem : I wanted to extract all the classes involved with the same union operation. If for example Classes A,B and C are associated with an union operation. I would want them together.

Tried so far : I have tried using rdflib and went through all the triples. But none of the triples contain the union info, even though there are union operation in the file.

I have also tried with owlready2, it has a method to list all the disjoint classes, but no functionality to get to union of classes.

It would be great help if there is a way to get the classes involved in a particular union operation.

PS : I am using python for my project

Zenmate
  • 41
  • 4
  • 1
    1) rdflib works on RDF level, OWL union is encoded via an RDF blank node and an RDF list, so you have to find the triple which attaches the list - here you can see how OWL is encoded in terms of RDF triples: https://www.w3.org/TR/owl2-mapping-to-rdf/ , just search for `owl:unionOf` – UninformedUser Feb 15 '22 at 09:43
  • 1
    2) the union must be contain in some OWL axiom, like subclassOf or equivalentClass - it works for disjointclasses because in OWL there is a special axiom `AllDisjoint` for classes to denote pairwise disjointness - – UninformedUser Feb 15 '22 at 09:48
  • 1
    for union this doesn't make sense as it would not be an axiom itself. For example, having `A subClassOf (B or C)` is an axiom, a statement, it can be true or false. On the other hand `A or B` is no axiom, it just defines a set of individuals, a complex concept. In owlready you have to find the class which is denoted as a union of those classes or maybe you have to find the role filler which is defined as a union of classes. – UninformedUser Feb 15 '22 at 09:49

0 Answers0