Examples of OWLAnnotation


Examples of org.semanticweb.owlapi.model.OWLAnnotation

        ont1.getOWLOntologyManager().applyChange(
                new AddImport(ont2, ont2import));
        OWLAnnotationProperty annoProp = AnnotationProperty(iri("annoProp"));
        OWLAxiom axannoPropdecl = Declaration(annoProp);
        ont1.getOWLOntologyManager().addAxiom(ont1, axannoPropdecl);
        OWLAnnotation inont1anno = Annotation(annoProp, ont1iri);
        OWLAnnotation inont2anno = Annotation(annoProp, ont2iri);
        OWLClass a = Class(iri("A"));
        OWLAxiom axAdecl = Declaration(a, singleton(inont1anno));
        ont1.getOWLOntologyManager().addAxiom(ont1, axAdecl);
        OWLClass b = Class(iri("B"));
        OWLAxiom axBdecl = Declaration(b, singleton(inont2anno));
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotation

        ont2.getOWLOntologyManager().applyChange(
                new AddImport(ont2, ont2import));
        OWLAnnotationProperty annoProp = AnnotationProperty(iri("annoProp"));
        OWLAxiom axAnnoPropDecl = Declaration(annoProp);
        ont1.getOWLOntologyManager().addAxiom(ont1, axAnnoPropDecl);
        OWLAnnotation inOnt1Anno = Annotation(annoProp, ont1iri);
        OWLAnnotation inOnt2Anno = Annotation(annoProp, ont2iri);
        OWLClass a = Class(iri("A"));
        OWLAxiom axADecl = Declaration(a, singleton(inOnt1Anno));
        ont1.getOWLOntologyManager().addAxiom(ont1, axADecl);
        OWLClass b = Class(iri("B"));
        OWLAxiom axBDecl = Declaration(b, singleton(inOnt2Anno));
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotation

        SWRLVariable x = df.getSWRLVariable(IRI(NS + "#x"));
        SWRLAtom atom1 = df.getSWRLClassAtom(a, x);
        SWRLAtom atom2 = df.getSWRLClassAtom(b, x);
        Set<SWRLAtom> consequent = new TreeSet<>();
        consequent.add(atom1);
        OWLAnnotation annotation = df.getOWLAnnotation(RDFSComment(),
                Literal("Not a great rule"));
        Set<OWLAnnotation> annotations = new TreeSet<>();
        annotations.add(annotation);
        Set<SWRLAtom> body = new TreeSet<>();
        body.add(atom2);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotation

    public void testPositiveUTF8roundTrip() throws Exception {
        String ns = "http://protege.org/UTF8.owl";
        OWLOntology ontology = m.createOntology(IRI(ns));
        OWLClass a = Class(IRI(ns + "#A"));
        m.addAxiom(ontology, df.getOWLDeclarationAxiom(a));
        OWLAnnotation ann = df.getOWLAnnotation(df.getRDFSLabel(),
                df.getOWLLiteral("Chinese=處方"));
        OWLAxiom axiom = df.getOWLAnnotationAssertionAxiom(a.getIRI(), ann);
        m.addAxiom(ontology, axiom);
        ontology = roundTrip(ontology, new FunctionalSyntaxDocumentFormat());
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotation

        OWLAnonymousIndividual h = AnonymousIndividual();
        OWLAnonymousIndividual i = AnonymousIndividual();
        OWLAnnotationProperty p = AnnotationProperty(IRI(ns + "#p"));
        OWLObjectProperty q = ObjectProperty(IRI(ns + "#q"));
        OWLOntology ontology = m.createOntology(IRI(ns));
        OWLAnnotation annotation1 = df.getOWLAnnotation(p, h);
        m.addAxiom(ontology,
                df.getOWLAnnotationAssertionAxiom(a.getIRI(), annotation1));
        m.addAxiom(ontology, ClassAssertion(a, h));
        m.addAxiom(ontology, ObjectPropertyAssertion(q, h, i));
        OWLAnnotation annotation2 = df.getOWLAnnotation(df.getRDFSLabel(),
                Literal("Second", "en"));
        m.addAxiom(ontology, df.getOWLAnnotationAssertionAxiom(h, annotation2));
        roundTrip(ontology, new ManchesterSyntaxDocumentFormat());
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotation

    protected OWLOntology createOntology() {
        try {
            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) {
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotation

                .getIRI());
        Set<OWLAnnotation> toReturn = new HashSet<>();
        for (OWLAnnotation a : anns) {
            Optional<OWLLiteral> asLiteral = a.getValue().asLiteral();
            if (asLiteral.isPresent() && asLiteral.get().isRDFPlainLiteral()) {
                OWLAnnotation replacement = df.getOWLAnnotation(
                        a.getProperty(), df.getOWLLiteral(asLiteral.get()
                                .getLiteral(), stringType));
                toReturn.add(replacement);
            } else {
                toReturn.add(a);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotation

    @Test
    public void testGetAxiomsIgnoringAnnoations() {
        OWLLiteral annoLiteral = Literal("value");
        OWLAnnotationProperty annoProp = AnnotationProperty(iri("annoProp"));
        OWLAnnotation anno = df.getOWLAnnotation(annoProp, annoLiteral);
        OWLAxiom axiom = df.getOWLSubClassOfAxiom(Class(iri("A")),
                Class(iri("B")), singleton(anno));
        OWLOntology ont = getOWLOntology("testont");
        ont.getOWLOntologyManager().addAxiom(ont, axiom);
        assertTrue(ont.getAxiomsIgnoreAnnotations(axiom, EXCLUDED).contains(
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotation

    @Test
    public void testContainsReferenceForAxiomAnnotation() {
        OWLAnnotationProperty ap = AnnotationProperty(iri("prop"));
        OWLLiteral val = Literal("Test", "");
        OWLAnnotation anno = df.getOWLAnnotation(ap, val);
        OWLSubClassOfAxiom ax = df.getOWLSubClassOfAxiom(Class(iri("A")),
                Class(iri("B")), singleton(anno));
        OWLOntology ont = getOWLOntology("Ont");
        ont.getOWLOntologyManager().addAxiom(ont, ax);
        assertTrue(ont.containsAnnotationPropertyInSignature(anno.getProperty()
                .getIRI(), EXCLUDED));
        assertTrue(ont.getAnnotationPropertiesInSignature(EXCLUDED).contains(
                anno.getProperty()));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnnotation

    @Test
    public void testContainsReferenceForOntologyAnnotation() {
        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
TOP
Copyright © 2018 www.massapi.com. 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.