Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLAxiom


    @Test
    public void testOWLIndividualDeclarationAxiom()
            throws OWLOntologyCreationException {
        OWLNamedIndividual ind = createIndividual();
        OWLAxiom ax = Declaration(ind);
        OWLOntology ont = m.createOntology(OWLOntologyDocumentSourceBase
                .getNextDocumentIRI("urn:testontology"));
        m.applyChange(new AddAxiom(ont, ax));
        assertTrue(ont.getIndividualsInSignature().contains(ind));
    }
View Full Code Here


    @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(
                axiom));
        assertFalse(ont.getAxiomsIgnoreAnnotations(axiom, EXCLUDED).contains(
                axiom.getAxiomWithoutAnnotations()));
        assertTrue(ont.getAxiomsIgnoreAnnotations(
                axiom.getAxiomWithoutAnnotations(), EXCLUDED).contains(axiom));
        assertFalse(ont.getAxiomsIgnoreAnnotations(
                axiom.getAxiomWithoutAnnotations(), EXCLUDED).contains(
                axiom.getAxiomWithoutAnnotations()));
    }
View Full Code Here

        OWLObjectProperty propD = ObjectProperty(iri("propD"));
        List<OWLObjectProperty> props = new ArrayList<>();
        props.add(propA);
        props.add(propB);
        props.add(propC);
        OWLAxiom ax = SubPropertyChainOf(props, propD);
        addAxiom(ont, ax);
        return ont;
    }
View Full Code Here

        OWLClass cheese = Class(IRI(NS + "#CheeseTopping"));
        OWLObjectProperty hasTopping = df.getOWLObjectProperty(IRI(NS
                + "#hasTopping"));
        OWLAnonymousIndividual i = df.getOWLAnonymousIndividual();
        OWLLiteral lit = df.getOWLLiteral(ANONYMOUS_INDIVIDUAL_ANNOTATION);
        OWLAxiom annAss = df.getOWLAnnotationAssertionAxiom(df.getRDFSLabel(),
                i, lit);
        m.addAxiom(ontology, annAss);
        OWLAxiom classAss = df.getOWLClassAssertionAxiom(cheesy, i);
        m.addAxiom(ontology, classAss);
        OWLIndividual j = df.getOWLAnonymousIndividual();
        OWLAxiom classAssj = df.getOWLClassAssertionAxiom(cheese, j);
        m.addAxiom(ontology, classAssj);
        OWLAxiom objAss = df.getOWLObjectPropertyAssertionAxiom(hasTopping, i,
                j);
        m.addAxiom(ontology, objAss);
        roundTrip(ontology, new OWLXMLDocumentFormat());
    }
View Full Code Here

    public void shouldSearch() throws OWLOntologyCreationException {
        // given
        OWLOntology o = m.createOntology();
        OWLClass c = Class(IRI("urn:c"));
        OWLClass d = Class(IRI("urn:d"));
        OWLAxiom ax = SubClassOf(c, d);
        o.getOWLOntologyManager().addAxiom(o, ax);
        assertTrue(o.getAxioms(AxiomType.SUBCLASS_OF).contains(ax));
        assertTrue(o.getAxioms(c, EXCLUDED).contains(ax));
    }
View Full Code Here

        // given
        OWLNamedIndividual e1 = NamedIndividual(IRI("urn:test1"));
        OWLNamedIndividual e2 = NamedIndividual(IRI("urn:test2"));
        OWLNamedIndividual e3 = NamedIndividual(IRI("urn:test3"));
        // given
        OWLAxiom wrongAxiom = DifferentIndividuals(e1);
        OWLAxiom validAxiom = DifferentIndividuals(e2, e3);
        // when
        addAxioms(wrongAxiom, validAxiom);
        // then
        assertCorrectResult(wrongAxiom, validAxiom, saveAndReload());
    }
View Full Code Here

        // given
        OWLObjectProperty e1 = ObjectProperty(IRI("urn:test1"));
        OWLObjectProperty e2 = ObjectProperty(IRI("urn:test2"));
        OWLObjectProperty e3 = ObjectProperty(IRI("urn:test3"));
        // given
        OWLAxiom wrongAxiom = DisjointObjectProperties(e1);
        OWLAxiom validAxiom = DisjointObjectProperties(e2, e3);
        // when
        addAxioms(wrongAxiom, validAxiom);
        OWLOntology reloaded = saveAndReload();
        // then
        assertNotNull(reloaded);
View Full Code Here

        OWLObjectProperty c = ObjectProperty(IRI("urn:c"));
        OWLObjectProperty d = ObjectProperty(IRI("urn:d"));
        OWLObjectProperty e = ObjectProperty(IRI("urn:e"));
        OWLClass x = Class(IRI("urn:x"));
        OWLClass y = Class(IRI("urn:Y"));
        OWLAxiom ax = SubObjectPropertyOf(c, d);
        OWLAxiom ax2 = ObjectPropertyDomain(c, x);
        OWLAxiom ax3 = ObjectPropertyRange(c, y);
        OWLAxiom ax4 = EquivalentObjectProperties(c, e);
        o.getOWLOntologyManager().addAxiom(o, ax);
        o.getOWLOntologyManager().addAxiom(o, ax2);
        o.getOWLOntologyManager().addAxiom(o, ax3);
        o.getOWLOntologyManager().addAxiom(o, ax4);
        assertTrue(o.getAxioms(AxiomType.SUB_OBJECT_PROPERTY).contains(ax));
View Full Code Here

        // given
        OWLOntology o = m.createOntology();
        OWLDataProperty c = DataProperty(IRI("urn:c"));
        OWLDataProperty d = DataProperty(IRI("urn:d"));
        OWLDataProperty e = DataProperty(IRI("urn:e"));
        OWLAxiom ax = SubDataPropertyOf(c, d);
        OWLClass x = Class(IRI("urn:x"));
        OWLAxiom ax2 = DataPropertyDomain(c, x);
        OWLAxiom ax3 = DataPropertyRange(c, Boolean());
        OWLAxiom ax4 = EquivalentDataProperties(c, e);
        o.getOWLOntologyManager().addAxiom(o, ax);
        o.getOWLOntologyManager().addAxiom(o, ax2);
        o.getOWLOntologyManager().addAxiom(o, ax3);
        o.getOWLOntologyManager().addAxiom(o, ax4);
        assertTrue(o.getAxioms(AxiomType.SUB_DATA_PROPERTY).contains(ax));
View Full Code Here

        checkSingletonDisjointFixup(e1, DisjointClasses(e1, e1));
        checkSingletonDisjointFixup(OWLThing(),
                DisjointClasses(OWLThing(), OWLThing()));
        OWLDisjointClassesAxiom singleClassDisjointAxiom = DisjointClasses(e1);
        checkSingletonDisjointFixup(e1, singleClassDisjointAxiom);
        OWLAxiom validAxiom = DisjointClasses(e2, e3);
        // when
        addAxioms(singleClassDisjointAxiom, validAxiom);
        OWLOntology reloaded = roundTrip(o,
                new FunctionalSyntaxDocumentFormat());
        // then
View Full Code Here

TOP

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

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.