protected void addTriple(IRI subject, IRI predicate, OWLLiteral con) { Map<IRI, OWLLiteral> subjObjMap = singleValuedLitTriplesByPredicate.get(predicate); if (subjObjMap != null) { subjObjMap.put(subject, con); } else { litTriplesBySubject.computeIfAbsent(subject, x -> createMap()) .computeIfAbsent(predicate, x -> createLinkedSet()).add(con); } } }
private void setupSinglePredicateMaps() { Stream .of(OWL_ON_PROPERTY, OWL_SOME_VALUES_FROM, OWL_ALL_VALUES_FROM, OWL_ON_CLASS, OWL_ON_DATA_RANGE) .forEach(v -> singleValuedResTriplesByPredicate.put(v.getIRI(), createMap())); }
protected void addTriple(IRI subject, IRI predicate, IRI object) { Map<IRI, IRI> subjObjMap = singleValuedResTriplesByPredicate.get(predicate); if (subjObjMap != null) { subjObjMap.put(subject, object); } else { resTriplesBySubject.computeIfAbsent(subject, x -> createMap()) .computeIfAbsent(predicate, x -> createLinkedSet()).add(object); } }
private void setupSinglePredicateMaps() { Stream .of(OWL_ON_PROPERTY, OWL_SOME_VALUES_FROM, OWL_ALL_VALUES_FROM, OWL_ON_CLASS, OWL_ON_DATA_RANGE) .forEach(v -> singleValuedResTriplesByPredicate.put(v.getIRI(), createMap())); }
protected void addTriple(IRI subject, IRI predicate, IRI object) { Map<IRI, IRI> subjObjMap = singleValuedResTriplesByPredicate.get(predicate); if (subjObjMap != null) { subjObjMap.put(subject, object); } else { resTriplesBySubject.computeIfAbsent(subject, x -> createMap()) .computeIfAbsent(predicate, x -> createLinkedSet()).add(object); } }
private void setupSinglePredicateMaps() { Stream .of(OWL_ON_PROPERTY, OWL_SOME_VALUES_FROM, OWL_ALL_VALUES_FROM, OWL_ON_CLASS, OWL_ON_DATA_RANGE) .forEach(v -> singleValuedResTriplesByPredicate.put(v.getIRI(), createMap())); }
private void setupSinglePredicateMaps() { Stream .of(OWL_ON_PROPERTY, OWL_SOME_VALUES_FROM, OWL_ALL_VALUES_FROM, OWL_ON_CLASS, OWL_ON_DATA_RANGE) .forEach(v -> singleValuedResTriplesByPredicate.put(v.getIRI(), createMap())); }
private <T extends OWLObjectPropertyCharacteristicAxiom> Map<OWLObjectPropertyExpression, Set<T>> buildObjectPropertyCharacteristicsIndex(AxiomType<T> type) { Map<OWLObjectPropertyExpression, Set<T>> map = createMap(); for(T ax : getAxiomsInternal(type)) { addToIndexedSet(ax.getProperty(), map, ax); } return map; }
public Set<OWLFunctionalDataPropertyAxiom> getFunctionalDataPropertyAxioms(OWLDataPropertyExpression property) { if (functionalDataPropertyAxiomsByProperty == null) { Map<OWLDataPropertyExpression, Set<OWLFunctionalDataPropertyAxiom>> functionalDataPropertyAxiomsByProperty = createMap(); // masks member declaration for(OWLFunctionalDataPropertyAxiom ax : getAxiomsInternal(FUNCTIONAL_DATA_PROPERTY)) { addToIndexedSet(ax.getProperty(), functionalDataPropertyAxiomsByProperty, ax); } this.functionalDataPropertyAxiomsByProperty=functionalDataPropertyAxiomsByProperty; } return getAxioms(property, functionalDataPropertyAxiomsByProperty); }
public Set<OWLSubObjectPropertyOfAxiom> getObjectSubPropertyAxiomsForSuperProperty(OWLObjectPropertyExpression property) { if (objectSubPropertyAxiomsByRHS == null) { Map<OWLObjectPropertyExpression, Set<OWLSubObjectPropertyOfAxiom>> objectSubPropertyAxiomsByRHS = createMap(); // masks member declaration for (OWLSubObjectPropertyOfAxiom axiom : getAxiomsInternal(SUB_OBJECT_PROPERTY)) { addToIndexedSet(axiom.getSuperProperty(), objectSubPropertyAxiomsByRHS, axiom); } this.objectSubPropertyAxiomsByRHS=objectSubPropertyAxiomsByRHS; } return getReturnSet(getAxioms(property, objectSubPropertyAxiomsByRHS)); }
public Set<OWLEquivalentDataPropertiesAxiom> getEquivalentDataPropertiesAxioms(OWLDataProperty property) { if (equivalentDataPropertyAxiomsByProperty == null) { Map<OWLDataPropertyExpression, Set<OWLEquivalentDataPropertiesAxiom>> equivalentDataPropertyAxiomsByProperty = createMap(); // masks member declaration for (OWLEquivalentDataPropertiesAxiom axiom : getAxiomsInternal(EQUIVALENT_DATA_PROPERTIES)) { for (OWLDataPropertyExpression prop : axiom.getProperties()) { addToIndexedSet(prop, equivalentDataPropertyAxiomsByProperty, axiom); } } this.equivalentDataPropertyAxiomsByProperty=equivalentDataPropertyAxiomsByProperty; } return getReturnSet(getAxioms(property, equivalentDataPropertyAxiomsByProperty)); }
public Set<OWLNegativeObjectPropertyAssertionAxiom> getNegativeObjectPropertyAssertionAxioms( OWLIndividual individual) { if (negativeObjectPropertyAssertionAxiomsByIndividual == null) { Map<OWLIndividual, Set<OWLNegativeObjectPropertyAssertionAxiom>> negativeObjectPropertyAssertionAxiomsByIndividual = createMap(); // masks member declaration for (OWLNegativeObjectPropertyAssertionAxiom axiom : getAxiomsInternal(NEGATIVE_OBJECT_PROPERTY_ASSERTION)) { addToIndexedSet(axiom.getSubject(), negativeObjectPropertyAssertionAxiomsByIndividual, axiom); } this.negativeObjectPropertyAssertionAxiomsByIndividual=negativeObjectPropertyAssertionAxiomsByIndividual; } return getReturnSet(getAxioms(individual, negativeObjectPropertyAssertionAxiomsByIndividual)); }
public Set<OWLSubDataPropertyOfAxiom> getDataSubPropertyAxiomsForSubProperty(OWLDataProperty lhsProperty) { if (dataSubPropertyAxiomsByLHS == null) { Map<OWLDataPropertyExpression, Set<OWLSubDataPropertyOfAxiom>> dataSubPropertyAxiomsByLHS = createMap(); // masks member declaration for (OWLSubDataPropertyOfAxiom axiom : getAxiomsInternal(SUB_DATA_PROPERTY)) { addToIndexedSet(axiom.getSubProperty(), dataSubPropertyAxiomsByLHS, axiom); } this.dataSubPropertyAxiomsByLHS=dataSubPropertyAxiomsByLHS; } return getReturnSet(getAxioms(lhsProperty, dataSubPropertyAxiomsByLHS)); }
public Set<OWLDisjointDataPropertiesAxiom> getDisjointDataPropertiesAxioms(OWLDataProperty property) { if (disjointDataPropertyAxiomsByProperty == null) { Map<OWLDataPropertyExpression, Set<OWLDisjointDataPropertiesAxiom>> disjointDataPropertyAxiomsByProperty = createMap(); // masks member declaration for (OWLDisjointDataPropertiesAxiom axiom : getAxiomsInternal(DISJOINT_DATA_PROPERTIES)) { for (OWLDataPropertyExpression prop : axiom.getProperties()) { addToIndexedSet(prop, disjointDataPropertyAxiomsByProperty, axiom); } } this.disjointDataPropertyAxiomsByProperty=disjointDataPropertyAxiomsByProperty; } return getReturnSet(getAxioms(property, disjointDataPropertyAxiomsByProperty)); }
public Set<OWLDataPropertyAssertionAxiom> getDataPropertyAssertionAxioms(OWLIndividual individual) { if (dataPropertyAssertionsByIndividual == null) { Map<OWLIndividual, Set<OWLDataPropertyAssertionAxiom>> dataPropertyAssertionsByIndividual = createMap(); // masks member declaration for (OWLDataPropertyAssertionAxiom axiom : getAxiomsInternal(DATA_PROPERTY_ASSERTION)) { addToIndexedSet(axiom.getSubject(), dataPropertyAssertionsByIndividual, axiom); } this.dataPropertyAssertionsByIndividual=dataPropertyAssertionsByIndividual; } return getReturnSet(getAxioms(individual, dataPropertyAssertionsByIndividual)); }
public Set<OWLObjectPropertyAssertionAxiom> getObjectPropertyAssertionAxioms(OWLIndividual individual) { if (objectPropertyAssertionsByIndividual == null) { Map<OWLIndividual, Set<OWLObjectPropertyAssertionAxiom>> objectPropertyAssertionsByIndividual = createMap(); // masks member declaration for (OWLObjectPropertyAssertionAxiom axiom : getAxiomsInternal(OBJECT_PROPERTY_ASSERTION)) { addToIndexedSet(axiom.getSubject(), objectPropertyAssertionsByIndividual, axiom); } this.objectPropertyAssertionsByIndividual=objectPropertyAssertionsByIndividual; } return getReturnSet(getAxioms(individual, objectPropertyAssertionsByIndividual)); }
public Set<OWLNegativeDataPropertyAssertionAxiom> getNegativeDataPropertyAssertionAxioms(OWLIndividual individual) { if (negativeDataPropertyAssertionAxiomsByIndividual == null) { Map<OWLIndividual, Set<OWLNegativeDataPropertyAssertionAxiom>> negativeDataPropertyAssertionAxiomsByIndividual = createMap(); // masks member declaration for (OWLNegativeDataPropertyAssertionAxiom axiom : getAxiomsInternal(NEGATIVE_DATA_PROPERTY_ASSERTION)) { addToIndexedSet(axiom.getSubject(), negativeDataPropertyAssertionAxiomsByIndividual, axiom); } this.negativeDataPropertyAssertionAxiomsByIndividual=negativeDataPropertyAssertionAxiomsByIndividual; } return getReturnSet(getAxioms(individual, negativeDataPropertyAssertionAxiomsByIndividual)); }
public Set<OWLDataPropertyDomainAxiom> getDataPropertyDomainAxioms(OWLDataProperty property) { if (dataPropertyDomainAxiomsByProperty == null) { Map<OWLDataPropertyExpression, Set<OWLDataPropertyDomainAxiom>> dataPropertyDomainAxiomsByProperty = createMap(); // masks member declaration for (OWLDataPropertyDomainAxiom axiom : getAxiomsInternal(DATA_PROPERTY_DOMAIN)) { addToIndexedSet(axiom.getProperty(), dataPropertyDomainAxiomsByProperty, axiom); } this.dataPropertyDomainAxiomsByProperty=dataPropertyDomainAxiomsByProperty; } return getReturnSet(getAxioms(property, dataPropertyDomainAxiomsByProperty)); }
public Set<OWLClassAssertionAxiom> getClassAssertionAxioms(OWLClass type) { if (classAssertionAxiomsByClass == null) { Map<OWLClass, Set<OWLClassAssertionAxiom>> classAssertionAxiomsByClass = createMap(); // masks member declaration for (OWLClassAssertionAxiom axiom : getAxiomsInternal(CLASS_ASSERTION)) { if (!axiom.getClassExpression().isAnonymous()) { addToIndexedSet((OWLClass) axiom.getClassExpression(), classAssertionAxiomsByClass, axiom); } } this.classAssertionAxiomsByClass=classAssertionAxiomsByClass; } return getReturnSet(getAxioms(type, classAssertionAxiomsByClass)); }
public Set<OWLHasKeyAxiom> getHasKeyAxioms(OWLClass cls) { if(hasKeyAxiomsByClass == null) { Map<OWLClass, Set<OWLHasKeyAxiom>> hasKeyAxiomsByClass = createMap(); // masks member declaration for(OWLHasKeyAxiom axiom : getAxiomsInternal(HAS_KEY)) { if (!axiom.getClassExpression().isAnonymous()) { addToIndexedSet(axiom.getClassExpression().asOWLClass(), hasKeyAxiomsByClass, axiom); } } this.hasKeyAxiomsByClass=hasKeyAxiomsByClass; } return getReturnSet(getAxioms(cls, hasKeyAxiomsByClass)); }