owlcs / owlapi

OWL API main repository
822 stars 315 forks source link

Question: How to Check Object Property contains super property of chain #1012

Closed shyamaW closed 2 years ago

shyamaW commented 3 years ago

Hi

I am working on OWL API 5.

Kindly assist me to get super property of (Chain) of a given object property OR How can I check an object property contains the axiom sub-property chain axiom.

By the way, I know to get all sub chain property axiom using this: o.getAxioms(AxiomType.SUB_PROPERTY_CHAIN_OF).

I need to get supPropertyOf chain axioms related to a particular object property

Thanking You Shyama

ignazio1977 commented 3 years ago

The axiom type OWLSubPropertyChainOfAxiom contains getSuperProperty() and getPropertyChain(), are these the methods you're after?

shyamaW commented 3 years ago

Many Thanks.. :) Got it..!!! ontology.getAxioms(AxiomType.SUB_PROPERTY_CHAIN_OF).forEach(s -> System.out.println("Super Property" + s.getSuperProperty()));