Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.AddOntologyAnnotation


                            unescapeTagValue(value));
                    OWLAnnotationProperty property = getDataFactory()
                            .getOWLAnnotationProperty(getIRIFromTagName(tag));
                    OWLAnnotation anno = getDataFactory().getOWLAnnotation(
                            property, con);
                    owlOntologyManager.applyChange(new AddOntologyAnnotation(
                            ontology, anno));
                }
            } else if (currentId != null) {
                // Add as annotation
                if (configuration.isLoadAnnotationAxioms()) {
View Full Code Here


                                        .getOntology(), decl));
                            }
                            for (OWLAnnotation anno : importedOntology
                                    .getAnnotations()) {
                                assert anno != null;
                                man.applyChange(new AddOntologyAnnotation(
                                        consumer.getOntology(), anno));
                            }
                            for (OWLAxiom ax : importedOntology.getAxioms()) {
                                consumer.addAxiom(ax);
                            }
View Full Code Here

    void handleChild(AbstractClassExpressionElementHandler h) {}

    @Override
    void handleChild(@Nonnull OWLAnnotationElementHandler h) {
        handler.getOWLOntologyManager().applyChange(
                new AddOntologyAnnotation(handler.getOntology(), h
                        .getOWLObject()));
    }
View Full Code Here

        OWLAnnotation anno = df.getOWLAnnotation(df
                .getOWLAnnotationProperty(OWLRDFVocabulary.OWL_VERSION_INFO
                        .getIRI()), lit);
        // Now we can add this as an ontology annotation Apply the change in the
        // usual way
        man.applyChange(new AddOntologyAnnotation(ont, anno));
        // The pizza ontology has labels attached to most classes which are
        // translations of class names into Portuguese (pt) we can access these
        // and print them out. At this point, it is worth noting that constants
        // can be typed or untyped. If constants are untyped then they can have
        // language tags, which are optional - typed constant cannot have
View Full Code Here

                .getOWLAnnotationProperty(OWLRDFVocabulary.OWL_VERSION_INFO
                        .getIRI());
        OWLAnnotation anno = df.getOWLAnnotation(owlAnnotationProperty, lit);
        // Now we can add this as an ontology annotation
        // Apply the change in the usual way
        m.applyChange(new AddOntologyAnnotation(o, anno));
    }
View Full Code Here

            OWLOntology ont = m.createOntology();
            OWLAnnotationProperty prop = AnnotationProperty(IRI("http://www.semanticweb.org/ontologies/test/annotationont#prop"));
            OWLLiteral value = Literal(33);
            OWLAnnotation annotation = df.getOWLAnnotation(prop, value);
            ont.getOWLOntologyManager().applyChange(
                    new AddOntologyAnnotation(ont, annotation));
            ont.getOWLOntologyManager().addAxiom(ont, Declaration(prop));
            return ont;
        } catch (OWLOntologyCreationException e) {
            throw new OWLRuntimeException(e);
        }
View Full Code Here

    }

    @Test
    public void testCreateOntologyChange() {
        AddOntologyAnnotationData data = createData();
        AddOntologyAnnotation change = data.createOntologyChange(mockOntology);
        assertEquals(mockOntology, change.getOntology());
        assertEquals(mockAnnotation, change.getAnnotation());
    }
View Full Code Here

    }

    @Test
    public void testOntologyChangeSymmetry() {
        AddOntologyAnnotationData data = createData();
        AddOntologyAnnotation change = new AddOntologyAnnotation(mockOntology,
                mockAnnotation);
        assertEquals(change.getChangeData(), data);
    }
View Full Code Here

        OWLAnnotationProperty ap = AnnotationProperty(iri("prop"));
        OWLLiteral val = Literal("Test");
        OWLAnnotation anno = df.getOWLAnnotation(ap, val);
        OWLOntology ont = getOWLOntology("Ont");
        ont.getOWLOntologyManager().applyChange(
                new AddOntologyAnnotation(ont, anno));
        assertTrue(ont.containsAnnotationPropertyInSignature(anno.getProperty()
                .getIRI(), EXCLUDED));
        assertTrue(ont.getAnnotationPropertiesInSignature(EXCLUDED).contains(
                anno.getProperty()));
    }
View Full Code Here

        // annotation to the ontology
        getConsumer().setDefaultNamespaceTagValue(value);
        // Add an annotation to the ontology
        OWLAnnotation annotation = getAnnotationForTagValuePair(
                OBOVocabulary.DEFAULT_NAMESPACE.getName(), value);
        applyChange(new AddOntologyAnnotation(getOntology(), annotation));
    }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.model.AddOntologyAnnotation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.