private static OClass getOClass(OWLClass clExpression, OntologyVocabularyCategory<OClass> voc) { String uri = clExpression.getIRI().toString(); return voc.get(uri); }
private static AnnotationProperty getPropertyExpression(OWLAnnotationProperty ap, OntologyVocabularyCategory<AnnotationProperty> voc) { return voc.get(ap.getIRI().toString()); }
private static DataPropertyExpression getPropertyExpression(OWLDataPropertyExpression dpeExpression, OntologyVocabularyCategory<DataPropertyExpression> voc) { assert (dpeExpression instanceof OWLDataProperty); return voc.get(dpeExpression.asOWLDataProperty().getIRI().toString()); }
/** * ObjectPropertyExpression := ObjectProperty | InverseObjectProperty * InverseObjectProperty := 'ObjectInverseOf' '(' ObjectProperty ')' */ private static ObjectPropertyExpression getPropertyExpression(OWLObjectPropertyExpression opeExpression, OntologyVocabularyCategory<ObjectPropertyExpression> voc) { if (opeExpression instanceof OWLObjectProperty) { return voc.get(opeExpression.asOWLObjectProperty().getIRI().toString()); } else { assert(opeExpression instanceof OWLObjectInverseOf); OWLObjectInverseOf aux = (OWLObjectInverseOf) opeExpression; return voc.get(aux.getInverse().asOWLObjectProperty().getIRI().toString()).getInverse(); } }
private void setIndex(String iri, int type, int idx) { if (type == CLASS_TYPE) { OClass c = reasonerDag.classes().get(iri); if (reasonerDag.classesDAG().getVertex(c) == null) throw new RuntimeException("UNKNOWN CLASS: " + iri); ObjectPropertyExpression ope = reasonerDag.objectProperties().get(iri); if (cacheSI.getEntry(ope) != null) { DataPropertyExpression dpe = reasonerDag.dataProperties().get(iri); if (reasonerDag.dataPropertiesDAG().getVertex(dpe) != null) { if (cacheSI.getEntry(dpe) != null) DataPropertyExpression dpe = reasonerDag.dataProperties().get(iri); if (reasonerDag.dataPropertiesDAG().getVertex(dpe) != null) { if (cacheSI.getEntry(dpe) != null)
.filter(i -> reasoner.objectProperties().contains(i)) .isPresent()) { ObjectPropertyExpression prop = reasoner.objectProperties().get(optionalPropertyIRIString.get()); if (!root.equals(a.getTerm(0))) prop = prop.getInverse();
public Intersection<ClassExpression> getSubConcepts(Collection<Function> atoms) { Intersection<ClassExpression> subc = new Intersection<>(reasoner.classesDAG()); for (Function a : atoms) { Optional<IRI> optionalClassIRI = extractClassIRI(a); if (!optionalClassIRI.isPresent()) { subc.setToBottom(); // binary predicates R(x,x) cannot be matched to the anonymous part break; } IRI classIRI = optionalClassIRI.get(); if (reasoner.classes().contains(classIRI)) subc.intersectWith(reasoner.classes().get(classIRI)); else subc.setToBottom(); if (subc.isBottom()) break; } return subc; }
OClass c = reasoner.classes().get(classIRI.get()); OClass equivalent = (OClass)reasoner.classesDAG().getCanonicalForm(c); if (equivalent != null && !equivalent.equals(c)) { ObjectPropertyExpression ope = reasoner.objectProperties().get(propertyIRI.get()); ObjectPropertyExpression equivalent = reasoner.objectPropertiesDAG().getCanonicalForm(ope); if (equivalent != null && !equivalent.equals(ope)) { DataPropertyExpression dpe = reasoner.dataProperties().get(propertyIRI.get()); DataPropertyExpression equivalent = reasoner.dataPropertiesDAG().getCanonicalForm(dpe); if (equivalent != null && !equivalent.equals(dpe)) {