Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom


    public void shouldNotFailELBecauseOfBoolean()
            throws OWLOntologyCreationException {
        OWLOntology o = m.createOntology();
        OWLAnnotation ann = df.getOWLAnnotation(df.getRDFSLabel(),
                df.getOWLLiteral(true));
        OWLAnnotationAssertionAxiom ax = df.getOWLAnnotationAssertionAxiom(
                IRI.create("urn:test:ELProfile"), ann);
        m.addAxiom(o, ax);
        m.addAxiom(o, Declaration(OWL2Datatype.XSD_BOOLEAN.getDatatype(df)));
        checkProfile(o, new OWL2ELProfile(), true);
    }
View Full Code Here


    protected Set<? extends OWLAxiom> createAxioms() {
        Set<OWLAxiom> axioms = new HashSet<>();
        OWLAnonymousIndividual ind = AnonymousIndividual();
        OWLClass cls = Class(iri("A"));
        OWLAnnotationProperty prop = AnnotationProperty(iri("prop"));
        OWLAnnotationAssertionAxiom ax = AnnotationAssertion(prop,
                cls.getIRI(), ind);
        axioms.add(ax);
        axioms.add(Declaration(cls));
        return axioms;
    }
View Full Code Here

    }

    @Test
    public void testClassAccessor() {
        OWLOntology ont = getOWLOntology("ontology");
        OWLAnnotationAssertionAxiom ax = createAnnotationAssertionAxiom();
        ont.getOWLOntologyManager().addAxiom(ont, ax);
        assertTrue(ont.getAnnotationAssertionAxioms(SUBJECT).contains(ax));
        OWLClass cls = Class(SUBJECT);
        Set<OWLAnnotationAssertionAxiom> axioms = ont
                .getAnnotationAssertionAxioms(cls.getIRI());
        assertTrue(axioms.contains(ax));
        assertTrue(annotations(axioms).contains(ax.getAnnotation()));
    }
View Full Code Here

    }

    @Test
    public void testNamedIndividualAccessor() {
        OWLOntology ont = getOWLOntology("ontology");
        OWLAnnotationAssertionAxiom ax = createAnnotationAssertionAxiom();
        ont.getOWLOntologyManager().addAxiom(ont, ax);
        assertTrue(ont.getAnnotationAssertionAxioms(SUBJECT).contains(ax));
        OWLNamedIndividual cls = NamedIndividual(SUBJECT);
        Set<OWLAnnotationAssertionAxiom> axioms = ont
                .getAnnotationAssertionAxioms(cls.getIRI());
        assertTrue(axioms.contains(ax));
        assertTrue(annotations(axioms).contains(ax.getAnnotation()));
    }
View Full Code Here

    }

    @Test
    public void testObjectPropertyAccessor() {
        OWLOntology ont = getOWLOntology("ontology");
        OWLAnnotationAssertionAxiom ax = createAnnotationAssertionAxiom();
        ont.getOWLOntologyManager().addAxiom(ont, ax);
        assertTrue(ont.getAnnotationAssertionAxioms(SUBJECT).contains(ax));
        OWLObjectProperty cls = ObjectProperty(SUBJECT);
        Set<OWLAnnotationAssertionAxiom> axioms = ont
                .getAnnotationAssertionAxioms(cls.getIRI());
        assertTrue(axioms.contains(ax));
        assertTrue(annotations(axioms).contains(ax.getAnnotation()));
    }
View Full Code Here

    }

    @Test
    public void testDataPropertyAccessor() {
        OWLOntology ont = getOWLOntology("ontology");
        OWLAnnotationAssertionAxiom ax = createAnnotationAssertionAxiom();
        ont.getOWLOntologyManager().addAxiom(ont, ax);
        assertTrue(ont.getAnnotationAssertionAxioms(SUBJECT).contains(ax));
        OWLDataProperty cls = DataProperty(SUBJECT);
        Set<OWLAnnotationAssertionAxiom> axioms = ont
                .getAnnotationAssertionAxioms(cls.getIRI());
        assertTrue(axioms.contains(ax));
        assertTrue(annotations(axioms).contains(ax.getAnnotation()));
    }
View Full Code Here

    }

    @Test
    public void testDatatypeAccessor() {
        OWLOntology ont = getOWLOntology("ontology");
        OWLAnnotationAssertionAxiom ax = createAnnotationAssertionAxiom();
        ont.getOWLOntologyManager().addAxiom(ont, ax);
        assertTrue(ont.getAnnotationAssertionAxioms(SUBJECT).contains(ax));
        OWLDatatype cls = Datatype(SUBJECT);
        Set<OWLAnnotationAssertionAxiom> axioms = ont
                .getAnnotationAssertionAxioms(cls.getIRI());
        assertTrue(axioms.contains(ax));
        assertTrue(annotations(axioms).contains(ax.getAnnotation()));
    }
View Full Code Here

    public void testAnonAccessor() {
        OWLOntology ont = getOWLOntology("ontology");
        OWLAnnotationProperty prop = AnnotationProperty(iri("prop"));
        OWLAnnotationValue value = Literal("value");
        OWLAnonymousIndividual a = AnonymousIndividual();
        OWLAnnotationAssertionAxiom ax = AnnotationAssertion(prop, a, value);
        ont.getOWLOntologyManager().addAxiom(ont, ax);
        assertTrue(ont.getAnnotationAssertionAxioms(a).contains(ax));
    }
View Full Code Here

        OWLClass clsB = Class(IRI("http://ont.com#B"));
        OWLSubClassOfAxiom sca = SubClassOf(clsA, clsB);
        m.addAxiom(ont, sca);
        OWLAnnotationProperty rdfsComment = RDFSComment();
        OWLLiteral lit = Literal("Hello world");
        OWLAnnotationAssertionAxiom annoAx1 = AnnotationAssertion(rdfsComment,
                clsA.getIRI(), lit);
        m.addAxiom(ont, annoAx1);
        OWLAnnotationPropertyDomainAxiom annoAx2 = df
                .getOWLAnnotationPropertyDomainAxiom(rdfsComment, clsA.getIRI());
        m.addAxiom(ont, annoAx2);
View Full Code Here

            OWLLiteral lit = Literal("Annotation " + (i + 1));
            annotations.add(df.getOWLAnnotation(RDFSLabel(), lit));
        }
        OWLEntity entity = NamedIndividual(IRI("http://www.another.com/ont#peter"));
        addAxiom(ont, Declaration(entity));
        OWLAnnotationAssertionAxiom ax = df.getOWLAnnotationAssertionAxiom(
                prop, entity.getIRI(), Literal("X", "en"), annotations);
        addAxiom(ont, ax);
        return ont;
    }
View Full Code Here

TOP

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

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.