public void retrieveSubObjectPropertyAxioms() { // this method is to perform a dual operation; it shall retrieve all the declarative object // properties categories' annotations, // thus filling the objPropCategories Set, while parallelly will, for each category entry // retrieve the object properties themselves // and adding their entries in the objPropEntries Set. Set<OWLSubObjectPropertyOfAxiom> tmpSet; OWLObjectPropertyExpression tempDeclarativePropertyClass = OWLFactory.getOWLObjectProperty(":DeclarativeProperty", topIxPrefixManager); tmpSet = topIxOnt.getObjectSubPropertyAxiomsForSuperProperty( tempDeclarativePropertyClass); // OWLFactory.getOWLObjectProperty(IRI.create("http://www.semanticweb.org/ontologies/ptyxiaki_v0.6/2011/5/Ontology1308067064597.owl#DeclarativeProperty"))); Set<OWLSubObjectPropertyOfAxiom> tmpSet2; Set<OWLAnnotationAssertionAxiom> tmpAnnSet1; Set<OWLAnnotationAssertionAxiom> tmpAnnSet2; // to become class variables. for (OWLSubObjectPropertyOfAxiom sopAx : tmpSet) { String tmpS = sopAx.getSubProperty().toString(); // categories... tmpAnnSet1 = topIxOnt.getAnnotationAssertionAxioms( IRI.create( tmpS.substring( 1, tmpS.indexOf('>')))); // this set only contains one annotation per entry for (OWLAnnotationAssertionAxiom aaAx : tmpAnnSet1) { String currentObjPropCatName = aaAx.getValue().toString().substring(1, aaAx.getValue().toString().indexOf('^') - 1); tmpSet2 = topIxOnt.getObjectSubPropertyAxiomsForSuperProperty( OWLFactory.getOWLObjectProperty(IRI.create(tmpS.substring(1, tmpS.length() - 1)))); for (OWLSubObjectPropertyOfAxiom sopAx2 : tmpSet2) { String tmpS2 = sopAx2.getSubProperty().toString(); tmpAnnSet2 = topIxOnt.getAnnotationAssertionAxioms( IRI.create(tmpS2.substring(1, tmpS2.length() - 1))); for (OWLAnnotationAssertionAxiom aaAx2 : tmpAnnSet2) { String currentObjPropEntryName = aaAx2 .getValue() .toString() .substring(1, aaAx2.getValue().toString().indexOf('^') - 1); propEntryNameToPropCatName.put(currentObjPropEntryName, currentObjPropCatName); propEntryNametoPropEntryIRI.put( currentObjPropEntryName, tmpS2.substring(1, tmpS2.length() - 1)); } } } } }
public void visit(OWLSubObjectPropertyOfAxiom axiom) { addChildParent(axiom.getSubProperty(), axiom.getSuperProperty(), axiom); }