/** * Determines if this ontology contains the specified axiom, ignoring any annotations on this * axiom. * * @param axiom The axiom to test for. * @return <code>true</code> if this ontology contains this axiom with or without annotations. */ public boolean containsAxiomIgnoreAnnotations(OWLAxiom axiom) { if(axiom.isAnnotated()) { return logicalAxiom2AnnotatedAxiomMap.containsKey(axiom.getAxiomWithoutAnnotations()); } else { return containsAxiom(axiom) || logicalAxiom2AnnotatedAxiomMap.containsKey(axiom); } }
if (axiom.isAnnotated()) { axiomsToMerge.add(axiom); OWLAxiom strippedAxiom = axiom.getAxiomWithoutAnnotations();
if (axiom.isAnnotated()) { for (OWLAnnotation annotation : axiom.getAnnotations()) { if (annotations.contains(annotation)) { if (axiom.isAnnotated()) { for (OWLAnnotation annotation : axiom.getAnnotations()) { if (annotations.contains(annotation)) { if (axiom.isAnnotated()) { for (OWLAnnotation annotation : axiom.getAnnotations()) { if (annotations.contains(annotation)) { for (OWLAxiom axiom : ontology.getAxioms((OWLAnnotationProperty) object, Imports.EXCLUDED)) { if (axiom.isAnnotated()) { for (OWLAnnotation annotation : axiom.getAnnotations()) { if (annotations.contains(annotation)) { if (axiom.isAnnotated()) { for (OWLAnnotation annotation : axiom.getAnnotations()) { if (annotations.contains(annotation)) { if (axiom.isAnnotated()) { for (OWLAnnotation annotation : axiom.getAnnotations()) { if (annotations.contains(annotation)) { for (OWLAxiom axiom : ontology.getAxioms((OWLObjectPropertyExpression) object, Imports.EXCLUDED)) { if (axiom.isAnnotated()) {
if (axiom.isAnnotated()) { partialAxiomObjects = OntologyHelper.getObjects(axiom.getAxiomWithoutAnnotations());
if (axiom.isAnnotated()) { for (OWLAnnotation annotation : axiom.getAnnotations()) { objects.add(annotation.getProperty());
private void handleAxiomAdded(OWLAxiom axiom) { entityCollector.reset(); axiom.accept(entityCollector); for (OWLEntity object : entityCollector.getObjects()) { referenceAdder.setAxiom(axiom); object.accept(referenceAdder); } for(OWLAnonymousIndividual ind : entityCollector.getAnonymousIndividuals()) { addToIndexedSet(ind, owlAnonymousIndividualReferences, axiom); } if(axiom.isAnnotated()) { addToIndexedSet(axiom.getAxiomWithoutAnnotations(), logicalAxiom2AnnotatedAxiomMap, axiom); } }
private void handleAxiomRemoved(OWLAxiom axiom) { entityCollector.reset(); axiom.accept(entityCollector); for (OWLEntity object : entityCollector.getObjects()) { referenceRemover.setAxiom(axiom); object.accept(referenceRemover); } for(OWLAnonymousIndividual ind : entityCollector.getAnonymousIndividuals()) { removeAxiomFromSet(ind, owlAnonymousIndividualReferences, axiom, true); } if(axiom.isAnnotated()) { removeAxiomFromSet(axiom.getAxiomWithoutAnnotations(), logicalAxiom2AnnotatedAxiomMap, axiom, true); } }
/** * Adds the representation of an axiom to the RDF graph where the axiom has a SINGLE MAIN TRIPLE * (specified by the subject, predicate, object parameters). The triple specified by the * subject, predicate and object parameters will be added to the graph. If the axiom has any * annotations on it then extra triples will be added. These will consist of three triples, that * "reify" (not in the RDF sense) the specified triple using the OWL 2 annotation vocabulary: * owl:annotatedSource, owl:annotatedProperty, owl:annotatedTarget, and other triples to encode * the annotations. * * @param ax The axiom that the triple specified as subject, pred, obj represents. * @param subject The subject of the triple representing the axiom * @param predicate The predicate of the triple representing the axiom * @param object The object of the triple representing the axiom */ private void addSingleTripleAxiomRPN(OWLAxiom ax, R subject, P predicate, N object) { // Base triple addTriple(subject, predicate, object); if (!ax.isAnnotated()) { return; } // The axiom has annotations and we therefore need to reify the axiom in // order to add the annotations translateAnonymousNode(ax); addTriple(getNode(ax), getPredicateNode(RDF_TYPE.getIRI()), getResourceNode(OWL_AXIOM.getIRI())); addTriple(getNode(ax), getPredicateNode(OWL_ANNOTATED_SOURCE.getIRI()), subject); addTriple(getNode(ax), getPredicateNode(OWL_ANNOTATED_PROPERTY.getIRI()), predicate); addTriple(getNode(ax), getPredicateNode(OWL_ANNOTATED_TARGET.getIRI()), object); translateAnnotations(ax); }
/** * Adds the representation of an axiom to the RDF graph where the axiom has a SINGLE MAIN TRIPLE * (specified by the subject, predicate, object parameters). The triple specified by the * subject, predicate and object parameters will be added to the graph. If the axiom has any * annotations on it then extra triples will be added. These will consist of three triples, that * "reify" (not in the RDF sense) the specified triple using the OWL 2 annotation vocabulary: * owl:annotatedSource, owl:annotatedProperty, owl:annotatedTarget, and other triples to encode * the annotations. * * @param ax The axiom that the triple specified as subject, pred, obj represents. * @param subject The subject of the triple representing the axiom * @param predicate The predicate of the triple representing the axiom * @param object The object of the triple representing the axiom */ private void addSingleTripleAxiomRPN(OWLAxiom ax, R subject, P predicate, N object) { // Base triple addTriple(subject, predicate, object); if (!ax.isAnnotated()) { return; } // The axiom has annotations and we therefore need to reify the axiom in // order to add the annotations translateAnonymousNode(ax); addTriple(getNode(ax), getPredicateNode(RDF_TYPE.getIRI()), getResourceNode(OWL_AXIOM.getIRI())); addTriple(getNode(ax), getPredicateNode(OWL_ANNOTATED_SOURCE.getIRI()), subject); addTriple(getNode(ax), getPredicateNode(OWL_ANNOTATED_PROPERTY.getIRI()), predicate); addTriple(getNode(ax), getPredicateNode(OWL_ANNOTATED_TARGET.getIRI()), object); translateAnnotations(ax); }
/** * Adds the representation of an axiom to the RDF graph where the axiom has a SINGLE MAIN TRIPLE * (specified by the subject, predicate, object parameters). The triple specified by the * subject, predicate and object parameters will be added to the graph. If the axiom has any * annotations on it then extra triples will be added. These will consist of three triples, that * "reify" (not in the RDF sense) the specified triple using the OWL 2 annotation vocabulary: * owl:annotatedSource, owl:annotatedProperty, owl:annotatedTarget, and other triples to encode * the annotations. * * @param ax The axiom that the triple specified as subject, pred, obj represents. * @param subject The subject of the triple representing the axiom * @param predicate The predicate of the triple representing the axiom * @param object The object of the triple representing the axiom */ private void addSingleTripleAxiomRPN(OWLAxiom ax, R subject, P predicate, N object) { // Base triple addTriple(subject, predicate, object); if (!ax.isAnnotated()) { return; } // The axiom has annotations and we therefore need to reify the axiom in // order to add the annotations translateAnonymousNode(ax); addTriple(getNode(ax), getPredicateNode(RDF_TYPE.getIRI()), getResourceNode(OWL_AXIOM.getIRI())); addTriple(getNode(ax), getPredicateNode(OWL_ANNOTATED_SOURCE.getIRI()), subject); addTriple(getNode(ax), getPredicateNode(OWL_ANNOTATED_PROPERTY.getIRI()), predicate); addTriple(getNode(ax), getPredicateNode(OWL_ANNOTATED_TARGET.getIRI()), object); translateAnnotations(ax); }
/** * Adds the representation of an axiom to the RDF graph where the axiom has a SINGLE MAIN TRIPLE * (specified by the subject, predicate, object parameters). The triple specified by the * subject, predicate and object parameters will be added to the graph. If the axiom has any * annotations on it then extra triples will be added. These will consist of three triples, that * "reify" (not in the RDF sense) the specified triple using the OWL 2 annotation vocabulary: * owl:annotatedSource, owl:annotatedProperty, owl:annotatedTarget, and other triples to encode * the annotations. * * @param ax The axiom that the triple specified as subject, pred, obj represents. * @param subject The subject of the triple representing the axiom * @param predicate The predicate of the triple representing the axiom * @param object The object of the triple representing the axiom */ private void addSingleTripleAxiomRPN(OWLAxiom ax, R subject, P predicate, N object) { // Base triple addTriple(subject, predicate, object); if (!ax.isAnnotated()) { return; } // The axiom has annotations and we therefore need to reify the axiom in // order to add the annotations translateAnonymousNode(ax); addTriple(getNode(ax), getPredicateNode(RDF_TYPE.getIRI()), getResourceNode(OWL_AXIOM.getIRI())); addTriple(getNode(ax), getPredicateNode(OWL_ANNOTATED_SOURCE.getIRI()), subject); addTriple(getNode(ax), getPredicateNode(OWL_ANNOTATED_PROPERTY.getIRI()), predicate); addTriple(getNode(ax), getPredicateNode(OWL_ANNOTATED_TARGET.getIRI()), object); translateAnnotations(ax); }