Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLAnnotationProperty


        OWLOntology ont = m.createOntology();
        OWLClass clsA = Class(IRI("http://ont.com#A"));
        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);
        OWLAnnotationPropertyRangeAxiom annoAx3 = df
                .getOWLAnnotationPropertyRangeAxiom(rdfsComment, clsB.getIRI());
        m.addAxiom(ont, annoAx3);
        OWLAnnotationProperty myComment = AnnotationProperty(IRI("http://ont.com#myComment"));
        OWLSubAnnotationPropertyOfAxiom annoAx4 = df
                .getOWLSubAnnotationPropertyOfAxiom(myComment, rdfsComment);
        m.addAxiom(ont, annoAx4);
        reload(ont, new RDFXMLDocumentFormat());
        reload(ont, new OWLXMLDocumentFormat());
View Full Code Here


        List<OWLObjectProperty> props = new ArrayList<>();
        props.add(propA);
        props.add(propB);
        props.add(propC);
        Set<OWLAnnotation> annos = new HashSet<>();
        OWLAnnotationProperty annoPropA = AnnotationProperty(iri("annoPropA"));
        OWLAnnotationProperty annoPropB = AnnotationProperty(iri("annoPropB"));
        annos.add(Annotation(annoPropA, Literal("Test", "en")));
        annos.add(Annotation(annoPropB, Literal("Test", "")));
        OWLAxiom ax = SubPropertyChainOf(props, propD, annos);
        Set<OWLAxiom> axioms = new HashSet<>();
        axioms.add(ax);
View Full Code Here

public class GetAxiomsIgnoringAnnotationsTestCase extends TestBase {

    @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);
View Full Code Here

        AbstractRoundTrippingTestCase {

    @Override
    protected OWLOntology createOntology() {
        OWLOntology ont = getOWLOntology("OntA");
        OWLAnnotationProperty prop = AnnotationProperty(OWLRDFVocabulary.RDFS_LABEL
                .getIRI());
        addAxiom(ont, Declaration(prop));
        Set<OWLAnnotation> annotations = new HashSet<>();
        for (int i = 0; i < 2; i++) {
            OWLLiteral lit = Literal("Annotation " + (i + 1));
View Full Code Here

        IRI ap = IRI.create("http://localhost#", "ap");
        List<? extends OWLEntity> entities = Arrays.asList(df.getOWLClass(a),
                df.getOWLDatatype(a), df.getOWLAnnotationProperty(a),
                df.getOWLDataProperty(a), df.getOWLObjectProperty(a),
                df.getOWLNamedIndividual(a));
        OWLAnnotationProperty annotationProperty = df
                .getOWLAnnotationProperty(ap);
        for (OWLEntity e1 : entities) {
            for (OWLEntity e2 : entities) {
                testFormats(annotationProperty, e1, e2);
            }
View Full Code Here

    @Test
    public void testMultiPun() throws Exception {
        IRI a = IRI.create("http://localhost#", "a");
        IRI ap = IRI.create("http://localhost#", "ap");
        OWLAnnotationProperty annotationProperty = df
                .getOWLAnnotationProperty(ap);
        testFormats(annotationProperty, df.getOWLClass(a),
                df.getOWLDatatype(a), df.getOWLAnnotationProperty(a),
                df.getOWLDataProperty(a), df.getOWLObjectProperty(a),
                df.getOWLNamedIndividual(a));
View Full Code Here

        AbstractRoundTrippingTestCase {

    @Override
    protected OWLOntology createOntology() {
        OWLClass cls = Class(IRI("http://owlapi.sourceforge.net/ontology#A"));
        OWLAnnotationProperty prop = AnnotationProperty(IRI("http://owlapi.sourceforge.net/ontology#prop"));
        OWLLiteral lit1 = Literal(getEscape());
        OWLLiteral lit2 = Literal("Start" + getEscape());
        OWLLiteral lit3 = Literal(getEscape() + "End");
        OWLLiteral lit4 = Literal("Start" + getEscape() + "End");
        OWLAnnotationAssertionAxiom ax1 = AnnotationAssertion(prop,
View Full Code Here

@SuppressWarnings("javadoc")
public class AnnotationPropertyReferencesTestCase extends TestBase {

    @Test
    public void testContainsReferenceForAnnotationAssertion() {
        OWLAnnotationProperty ap = AnnotationProperty(iri("prop"));
        OWLLiteral val = Literal("Test", "");
        OWLAnnotationSubject subject = Class(iri("A")).getIRI();
        OWLAnnotationAssertionAxiom ax = AnnotationAssertion(ap, subject, val);
        OWLOntology ont = getOWLOntology("Ont");
        ont.getOWLOntologyManager().addAxiom(ont, ax);
        assertTrue(ont.containsAnnotationPropertyInSignature(ap.getIRI(),
                EXCLUDED));
        assertTrue(ont.getAnnotationPropertiesInSignature(EXCLUDED)
                .contains(ap));
    }
View Full Code Here

                .contains(ap));
    }

    @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");
View Full Code Here

                anno.getProperty()));
    }

    @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));
View Full Code Here

TOP

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

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.