/** * @param <T> set type * @return fresh threadsafe set */ public static <T> Set<T> createSyncSet() { ConcurrentHashMap<T, Boolean> internalMap = createSyncMap(); return Collections.newSetFromMap(internalMap); }
/** * @param <T> set type * @return fresh threadsafe set */ public static <T> Set<T> createSyncSet() { ConcurrentHashMap<T, Boolean> internalMap = createSyncMap(); return Collections.newSetFromMap(internalMap); }
/** * @param <T> set type * @return fresh threadsafe set */ public static <T> Set<T> createSyncSet() { ConcurrentHashMap<T, Boolean> internalMap = createSyncMap(); return Collections.newSetFromMap(internalMap); }
private void addSingleValuedResPredicate(OWLRDFVocabulary v) { ConcurrentMap<IRI, IRI> map = CollectionFactory.createSyncMap(); singleValuedResTriplesByPredicate.put(v.getIRI(), map); }
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); } }
private void setupSynonymMap() { // We can load legacy ontologies by providing synonyms for built in vocabulary // where the vocabulary has simply changed (e.g. DAML+OIL -> OWL) synonymMap = CollectionFactory.createSyncMap(); // Legacy protege-owlapi representation of QCRs synonymMap.put(IRI.create(Namespaces.OWL.toString(), "valuesFrom"), OWL_ON_CLASS.getIRI()); if (!configuration.isStrict()) { addDAMLOILVocabulary(); addIntermediateOWLSpecVocabulary(); } }
restrictionIRIs = CollectionFactory.createSyncSet(); ontologyIRIs = CollectionFactory.createSyncSet(); listFirstLiteralTripleMap = CollectionFactory.createSyncMap(); listFirstResourceTripleMap = CollectionFactory.createSyncMap(); listRestTripleMap = CollectionFactory.createSyncMap(); classExpressionListTranslator = new OptimisedListTranslator<OWLClassExpression>(this, new ClassExpressionListItemTranslator(this)); individualListTranslator = new OptimisedListTranslator<OWLIndividual>(this, new IndividualListItemTranslator(this)); builtInTypeTripleHandlers = CollectionFactory.createSyncMap(); setupTypeTripleHandlers(); setupPredicateHandlers();
private void setupPredicateHandlers() { predicateHandlers = CollectionFactory.createSyncMap(); addPredicateHandler(new TPDifferentFromHandler(this)); addPredicateHandler(new TPDisjointUnionHandler(this));