Refine search
@Override public Set<OWLLiteral> getValues() { return CollectionFactory .getCopyOnRequestSetFromImmutableCollection(values); }
/** * @param source the collection to lazily copy * @param <T> axiom type * @return a lazy defensive copy for source; the source collection will not be copied until a * method that modifies the collection gets called, e.g., add(), addAll() */ public static <T> Set<T> getCopyOnRequestSet(Collection<T> source) { return getCopyOnRequestSetFromMutableCollection(source); }
/** * @param f filter lambda * @param types axiom types to filter on */ public AxiomFilter(Filter<A> f, AxiomType<?>... types) { this.types = CollectionFactory.list(types); filter = f; }
@Override public Set<OWLAnonymousIndividual> getAnonymousIndividuals() { return CollectionFactory.getCopyOnRequestSetFromImmutableCollection(CollectionFactory .<OWLAnonymousIndividual> emptySet()); }
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 Set<RDFTriple> getTriplesForMainNode(IRI n, IRI... augmentingTypes) { Set<RDFTriple> triples = createLinkedSet(); getPredicatesBySubject(n).forEach(p -> { getResourceObjects(n, p).forEach(o -> triples.add(getRDFTriple(n, p, o))); getLiteralObjects(n, p).forEach(object -> triples.add(getRDFTriple(n, p, object))); }); Stream.of(augmentingTypes).forEach(t -> triples.add(getRDFTriple(n, RDF_TYPE.getIRI(), t))); return triples; }
protected OWLClassAxiom createAxiom(OWLClassExpression editedObject) { if (getAxiom() instanceof OWLSubClassOfAxiom) { return getOWLDataFactory().getOWLSubClassOfAxiom(getRoot(), editedObject); } else { return getOWLDataFactory().getOWLEquivalentClassesAxiom(CollectionFactory.createSet(getRoot(), editedObject)); } }
@Override public void visit(OWLSubClassOfAxiom axiom) { // A and not (B) OWLClassExpression complement = dataFactory.getOWLObjectComplementOf(axiom.getSuperClass()); desc = dataFactory.getOWLObjectIntersectionOf( CollectionFactory.createSet(axiom.getSubClass(), complement)); }
private void createEquivalentClass(OWLClassExpression classExpression) { OWLAxiom ax = getDataFactory() .getOWLEquivalentClassesAxiom(CollectionFactory.createSet(getCurrentClass(), classExpression)); getOWLOntologyManager().applyChange(new AddAxiom(ontology, ax)); }
@Override public void handle(String currentId, String value, String qualifierBlock, String comment) { OWLAxiom ax = getDataFactory() .getOWLDisjointClassesAxiom(CollectionFactory.createSet(getCurrentClass(), getOWLClass(value))); applyChange(new AddAxiom(getOntology(), ax)); } }
/** * @param individual individual * @return a same individuals axiom with specified individuals */ default OWLSameIndividualAxiom getOWLSameIndividualAxiom(OWLIndividual... individual) { checkIterableNotNull(individual, "individuals cannot be null", true); return getOWLSameIndividualAxiom(createSet(individual)); }
@Override public void handleTriple(IRI subject, IRI predicate, IRI object) throws UnloadableImportException { if(getConsumer().isDataProperty(subject) && getConsumer().isDataProperty(object)) { addAxiom(getDataFactory().getOWLDisjointDataPropertiesAxiom(CollectionFactory.createSet(translateDataProperty(subject), translateDataProperty(object)), getPendingAnnotations())); consumeTriple(subject, predicate, object); } if(getConsumer().isObjectProperty(subject) && getConsumer().isObjectProperty(object)) { addAxiom(getDataFactory().getOWLDisjointObjectPropertiesAxiom(CollectionFactory.createSet(translateObjectProperty(subject), translateObjectProperty(object)), getPendingAnnotations())); consumeTriple(subject, predicate, object); } }
@Override public OWLDatatypeRestriction getOWLDatatypeRestriction(OWLDatatype dataType, OWLFacet facet, OWLLiteral typedLiteral) { checkNotNull(dataType, DATATYPE_CANNOT_BE_NULL); checkNotNull(facet, FACET_CANNOT_BE_NULL); checkNotNull(typedLiteral, TYPED_CONSTANT_CANNOT_BE_NULL); return new OWLDatatypeRestrictionImpl(dataType, CollectionFactory.createSet(getOWLFacetRestriction(facet, typedLiteral))); }
protected OWLEquivalentObjectPropertiesAxiom createAxiom(OWLObjectPropertyExpression editedObject) { return getOWLDataFactory().getOWLEquivalentObjectPropertiesAxiom(CollectionFactory.createSet(getRoot(), editedObject)); }
final public OWLAxiom parseSameIndividual() throws ParseException { OWLIndividual indA; OWLIndividual indB; indA = parseIndividualId(); jj_consume_token(EXACT); indB = parseIndividualId(); return factory.getOWLSameIndividualAxiom(CollectionFactory.createSet(indA, indB)); }
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; }
/** * Records an annotation of an anonymous node (either an annotation of an annotation, or an * annotation of an axiom for example). * * @param annotatedAnonSource The source that the annotation annotates * @param annotationMainNode The annotations */ public void addAnnotatedSource(IRI annotatedAnonSource, IRI annotationMainNode) { annotatedAnonSource2AnnotationMap .computeIfAbsent(annotatedAnonSource, x -> createLinkedSet()).add(annotationMainNode); }
private Set<RDFTriple> getTriplesForMainNode(IRI n, IRI... augmentingTypes) { Set<RDFTriple> triples = createLinkedSet(); getPredicatesBySubject(n).forEach(p -> { getResourceObjects(n, p).forEach(o -> triples.add(getRDFTriple(n, p, o))); getLiteralObjects(n, p).forEach(object -> triples.add(getRDFTriple(n, p, object))); }); Stream.of(augmentingTypes).forEach(t -> triples.add(getRDFTriple(n, RDF_TYPE.getIRI(), t))); return triples; }