Skip to content

Commit

Permalink
Add Object property characteristics, inverses, domains, ranges to bas…
Browse files Browse the repository at this point in the history
…e-irir

see #1108
  • Loading branch information
matentzn committed Mar 10, 2024
1 parent a26de24 commit e9bc206
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/examples/template-drop-axiom-filter.owl
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<obo:IAO_0000115 rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Weight of a mouse or rat in kilograms (kg).</obo:IAO_0000115>
<obo:IAO_0000117 rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Rebecca C Jackson</obo:IAO_0000117>
<rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string">weight in kilograms</rdfs:label>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#decimal"/>
</owl:DatatypeProperty>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,54 @@ private static Set<IRI> getAxiomSubjects(OWLAxiom axiom) {
for (OWLObjectPropertyExpression expr : spcAxiom.getPropertyChain()) {
iris.addAll(getIRIsFromEntities(expr.getSignature()));
}
} else if (axiom instanceof OWLObjectPropertyCharacteristicAxiom) {
OWLObjectPropertyCharacteristicAxiom chAxiom = (OWLObjectPropertyCharacteristicAxiom) axiom;
OWLObjectPropertyExpression subject = chAxiom.getProperty();
if (!subject.isAnonymous()) {
return Sets.newHashSet(subject.asOWLObjectProperty().getIRI());
} else {
iris.addAll(getIRIsFromEntities(subject.getSignature()));
}
} else if (axiom instanceof OWLObjectPropertyDomainAxiom) {
OWLObjectPropertyDomainAxiom domainAxiom = (OWLObjectPropertyDomainAxiom) axiom;
OWLObjectPropertyExpression subject = domainAxiom.getProperty();
if (!subject.isAnonymous()) {
return Sets.newHashSet(subject.asOWLObjectProperty().getIRI());
} else {
iris.addAll(getIRIsFromEntities(subject.getSignature()));
}
} else if (axiom instanceof OWLDataPropertyRangeAxiom) {
OWLDataPropertyRangeAxiom rangeAxiom = (OWLDataPropertyRangeAxiom) axiom;
OWLDataPropertyExpression subject = rangeAxiom.getProperty();
if (!subject.isAnonymous()) {
return Sets.newHashSet(subject.asOWLDataProperty().getIRI());
} else {
iris.addAll(getIRIsFromEntities(subject.getSignature()));
}
} else if (axiom instanceof OWLObjectPropertyDomainAxiom) {
OWLObjectPropertyDomainAxiom domainAxiom = (OWLObjectPropertyDomainAxiom) axiom;
OWLObjectPropertyExpression subject = domainAxiom.getProperty();
if (!subject.isAnonymous()) {
return Sets.newHashSet(subject.asOWLObjectProperty().getIRI());
} else {
iris.addAll(getIRIsFromEntities(subject.getSignature()));
}
} else if (axiom instanceof OWLDataPropertyRangeAxiom) {
OWLDataPropertyRangeAxiom rangeAxiom = (OWLDataPropertyRangeAxiom) axiom;
OWLDataPropertyExpression subject = rangeAxiom.getProperty();
if (!subject.isAnonymous()) {
return Sets.newHashSet(subject.asOWLDataProperty().getIRI());
} else {
iris.addAll(getIRIsFromEntities(subject.getSignature()));
}
} else if (axiom instanceof OWLInverseObjectPropertiesAxiom) {
OWLInverseObjectPropertiesAxiom iopAxiom = (OWLInverseObjectPropertiesAxiom) axiom;
OWLObjectPropertyExpression subject = iopAxiom.getFirstProperty();
if (!subject.isAnonymous()) {
return Sets.newHashSet(subject.asOWLObjectProperty().getIRI());
} else {
iris.addAll(getIRIsFromEntities(subject.getSignature()));
}
} else {
logger.warn("Axiom type not supported: " + axiom.getClass().toString());
}
Expand Down

0 comments on commit e9bc206

Please sign in to comment.