Examples of OWLAxiom


Examples of org.semanticweb.owlapi.model.OWLAxiom

    @Test
    public void shouldParseOntologyThatBroke()
            throws OWLOntologyCreationException {
        // given
        String input = "@prefix f:    <urn:test/> . f:r f:p f: .";
        OWLAxiom expected = df.getOWLAnnotationAssertionAxiom(
                df.getOWLAnnotationProperty(IRI("urn:test/p")),
                IRI("urn:test/r"), IRI("urn:test/"));
        // when
        OWLOntology o = loadOntologyFromString(input);
        // then
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAxiom

        OWLObjectProperty prop = ObjectProperty(iri("propP"));
        OWLClass clsA = Class(iri("A"));
        OWLClass clsB = Class(iri("B"));
        OWLClassExpression desc = ObjectSomeValuesFrom(prop,
                ObjectSomeValuesFrom(prop, clsB));
        OWLAxiom ax = SubClassOf(clsA, desc);
        addAxiom(ont, ax);
        addAxiom(ont, Declaration(clsA));
        addAxiom(ont, Declaration(clsB));
        return ont;
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAxiom

    @Nonnull
    private OWLOntology createOntology(@Nonnull OWLAnnotationProperty p)
            throws OWLOntologyCreationException {
        OWLClass a = Class(IRI("http://test.org/MissingDeclaration.owl#A"));
        OWLOntology ontology = m.createOntology();
        OWLAxiom axiom = AnnotationAssertion(p, a.getIRI(), Literal("Hello"));
        m.addAxiom(ontology, axiom);
        return ontology;
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAxiom

    protected Set<OWLAxiom> getAxioms() {
        Set<OWLIndividual> individuals = new HashSet<>();
        for (int i = 0; i < 5; i++) {
            individuals.add(createIndividual());
        }
        OWLAxiom ax = df.getOWLDifferentIndividualsAxiom(individuals);
        return singleton(ax);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAxiom

        OWLClassExpression descA = df.getOWLObjectSomeValuesFrom(prop,
                df.getOWLThing());
        Set<OWLClassExpression> classExpressions = new HashSet<>();
        classExpressions.add(clsA);
        classExpressions.add(descA);
        OWLAxiom ax = df.getOWLEquivalentClassesAxiom(classExpressions);
        return singleton(ax);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAxiom

    @Test
    public void testCommasOnDisjointThree() {
        OWLClass a = df.getOWLClass(IRI.create("urn:A"));
        OWLClass b = df.getOWLClass(IRI.create("urn:B"));
        OWLClass c = df.getOWLClass(IRI.create("urn:C"));
        OWLAxiom ax = df.getOWLDisjointClassesAxiom(a, b, c);
        DLSyntaxObjectRenderer visitor = new DLSyntaxObjectRenderer();
        String render = visitor.render(ax);
        assertEquals("A ⊑ ¬ B, A ⊑ ¬ C, B ⊑ ¬ C", render);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAxiom

    @Test
    public void testCommasOnDisjointTwo() {
        OWLClass a = df.getOWLClass(IRI.create("urn:A"));
        OWLClass b = df.getOWLClass(IRI.create("urn:B"));
        OWLAxiom ax = df.getOWLDisjointClassesAxiom(a, b);
        DLSyntaxObjectRenderer visitor = new DLSyntaxObjectRenderer();
        String render = visitor.render(ax);
        assertEquals("A ⊑ ¬ B", render);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAxiom

    public void testCommasOnDisjointFour() {
        OWLClass a = df.getOWLClass(IRI.create("urn:A"));
        OWLClass b = df.getOWLClass(IRI.create("urn:B"));
        OWLClass c = df.getOWLClass(IRI.create("urn:C"));
        OWLClass d = df.getOWLClass(IRI.create("urn:D"));
        OWLAxiom ax = df.getOWLDisjointClassesAxiom(a, b, c, d);
        DLSyntaxObjectRenderer visitor = new DLSyntaxObjectRenderer();
        String render = visitor.render(ax);
        assertEquals("A ⊑ ¬ B, A ⊑ ¬ C, A ⊑ ¬ D, B ⊑ ¬ C, B ⊑ ¬ D, C ⊑ ¬ D",
                render);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAxiom

    @Nonnull
    @Override
    protected Set<OWLAxiom> getAxioms() {
        OWLIndividual ind = createIndividual();
        OWLClass cls = createClass();
        OWLAxiom ax = df.getOWLClassAssertionAxiom(cls, ind);
        return singleton(ax);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAxiom

                AnnotationProperty(iri("myOuterLabel")),
                Literal("Outer label"), outerOuterAnnos);
        OWLAnnotation annoInner = df.getOWLAnnotation(
                AnnotationProperty(iri("myLabel")), Literal("Label"),
                singleton(annoOuter));
        OWLAxiom ax = df.getOWLSubClassOfAxiom(Class(iri("A")),
                Class(iri("B")), singleton(annoInner));
        axioms.add(ax);
        return axioms;
    }
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.