public void addTriple(IRI subject, IRI predicate, IRI object) { ConcurrentMap<IRI, IRI> subjObjMap = singleValuedResTriplesByPredicate.get(predicate); if (subjObjMap != null) { IRI putIfAbsent = subjObjMap.putIfAbsent(subject, object); if(putIfAbsent != null) { logger.error("Attempted to overwrite a value for a single valued resource triple: {} {}", subject, predicate); } } else { ConcurrentMap<IRI, Collection<IRI>> map = resTriplesBySubject.get(subject); if (map == null) { map = CollectionFactory.createSyncMap(); ConcurrentMap<IRI,Collection<IRI>> putIfAbsent = resTriplesBySubject.putIfAbsent(subject, map); if(putIfAbsent != null) { map = putIfAbsent; } } Collection<IRI> objects = map.get(predicate); if (objects == null) { objects = CollectionFactory.createSyncSet(); Collection<IRI> putIfAbsent = map.putIfAbsent(predicate, objects); if(putIfAbsent != null) { objects = putIfAbsent; } } objects.add(object); } }
public void addTriple(IRI subject, IRI predicate, OWLLiteral con) { ConcurrentMap<IRI, OWLLiteral> subjObjMap = singleValuedLitTriplesByPredicate.get(predicate); if (subjObjMap != null) { OWLLiteral putIfAbsent = subjObjMap.putIfAbsent(subject, con); if(putIfAbsent != null) { logger.error("Attempted to overwrite a value for a single valued literal triple: {} {}", subject, predicate); } } else { ConcurrentMap<IRI, Collection<OWLLiteral>> map = litTriplesBySubject.get(subject); if (map == null) { map = CollectionFactory.createSyncMap(); ConcurrentMap<IRI,Collection<OWLLiteral>> putIfAbsent = litTriplesBySubject.putIfAbsent(subject, map); if(putIfAbsent != null) { map = putIfAbsent; } } Collection<OWLLiteral> objects = map.get(predicate); if (objects == null) { objects = CollectionFactory.createSyncSet(); Collection<OWLLiteral> putIfAbsent = map.putIfAbsent(predicate, objects); if(putIfAbsent != null) { objects = putIfAbsent; } } objects.add(con); } }
classExpressionIRIs = CollectionFactory.createSyncSet(); objectPropertyExpressionIRIs = CollectionFactory.createSyncSet(); dataPropertyExpressionIRIs = CollectionFactory.createSyncSet(); individualIRIs = CollectionFactory.createSyncSet(); annotationPropertyIRIs = CollectionFactory.createSyncSet(); for (IRI iri : OWLRDFVocabulary.BUILT_IN_ANNOTATION_PROPERTY_IRIS) { annotationPropertyIRIs.add(iri); annotationIRIs = CollectionFactory.createSyncSet(); dataRangeIRIs = CollectionFactory.createSyncSet(); propertyIRIs = CollectionFactory.createSyncSet(); restrictionIRIs = CollectionFactory.createSyncSet(); ontologyIRIs = CollectionFactory.createSyncSet(); listFirstLiteralTripleMap = CollectionFactory.createSyncMap(); listFirstResourceTripleMap = CollectionFactory.createSyncMap(); swrlRules = CollectionFactory.createSyncSet(); swrlIndividualPropertyAtoms = CollectionFactory.createSyncSet(); swrlDataValuedPropertyAtoms = CollectionFactory.createSyncSet(); swrlClassAtoms = CollectionFactory.createSyncSet(); swrlDataRangeAtoms = CollectionFactory.createSyncSet(); swrlBuiltInAtoms = CollectionFactory.createSyncSet(); swrlVariables = CollectionFactory.createSyncSet(); swrlSameAsAtoms = CollectionFactory.createSyncSet(); swrlDifferentFromAtoms = CollectionFactory.createSyncSet();