Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLAxiom


    @Nonnull
    private OWLOntology createOriginalOntology(@Nonnull String ns,
            @Nonnull OWLClass c, @Nonnull String chinese)
            throws OWLOntologyCreationException {
        OWLOntology ontology = m.createOntology(IRI(ns));
        OWLAxiom annotationAxiom = AnnotationAssertion(RDFSLabel(), c.getIRI(),
                Literal(chinese));
        m.addAxiom(ontology, annotationAxiom);
        return ontology;
    }
View Full Code Here


    @Test
    public void testInverse() {
        OWLOntology ont = getOWLOntology("Ont");
        OWLObjectProperty propP = ObjectProperty(iri("p"));
        OWLObjectProperty propQ = ObjectProperty(iri("q"));
        OWLAxiom ax = InverseObjectProperties(propP, propQ);
        ont.getOWLOntologyManager().addAxiom(ont, ax);
        Collection<OWLObjectPropertyExpression> inverses = inverse(
                ont.getInverseObjectPropertyAxioms(propP), propP);
        assertTrue(inverses.contains(propQ));
        assertFalse(inverses.contains(propP));
View Full Code Here

    @Test
    public void testInverseSelf() {
        OWLOntology ont = getOWLOntology("Ont");
        OWLObjectProperty propP = ObjectProperty(iri("p"));
        OWLAxiom ax = InverseObjectProperties(propP, propP);
        ont.getOWLOntologyManager().addAxiom(ont, ax);
        assertTrue(inverse(ont.getInverseObjectPropertyAxioms(propP), propP)
                .contains(propP));
    }
View Full Code Here

            return false;
        }
        if (!(obj instanceof OWLAxiom)) {
            return false;
        }
        OWLAxiom other = (OWLAxiom) obj;
        // for OWLAxiomImpl comparisons, do not create wrapper objects
        if (other instanceof OWLAxiomImplWithEntityAndAnonCaching) {
            return annotations
                    .equals(((OWLAxiomImplWithEntityAndAnonCaching) other).annotations);
        }
        return getAnnotations().equals(other.getAnnotations());
    }
View Full Code Here

    @Nonnull
    @Override
    protected Set<? extends OWLAxiom> createAxioms() {
        OWLAnnotationProperty prop = RDFSComment();
        OWLAxiom ax = df.getOWLAnnotationPropertyDomainAxiom(prop,
                IRI("http://ont.com#A"));
        return singleton(ax);
    }
View Full Code Here

    }

    @Override
    public OWLAxiom getNNF() {
        NNF con = new NNF(new OWLDataFactoryImpl());
        OWLAxiom nnf = accept(con);
        return verifyNotNull(nnf);
    }
View Full Code Here

        String ns = "http://protege.org/ontologies";
        OWLClass b = Class(IRI(ns + "#B"));
        OWLClass c = Class(IRI(ns + "#C"));
        OWLObjectProperty p = ObjectProperty(IRI(ns + "#p"));
        OWLObjectProperty q = ObjectProperty(IRI(ns + "#q"));
        OWLAxiom axiomToAdd = EquivalentClasses(Class(IRI(ns + "#A")),
                ObjectSomeValuesFrom(p, b), ObjectSomeValuesFrom(q, c));
        OWLOntology ontology = m.createOntology();
        ontology.getOWLOntologyManager().addAxiom(ontology, axiomToAdd);
        // when
        ontology = roundTrip(ontology);
View Full Code Here

    @Test
    public void shouldParseCorrectlydecimalNotSpecified()
            throws OWLOntologyCreationException {
        // given
        OWLAxiom expected = df.getOWLDataPropertyRangeAxiom(df
                .getOWLDataProperty(IRI.create("urn:a")), df.getOWLDataOneOf(df
                .getOWLLiteral("1.2", OWL2Datatype.XSD_DECIMAL)));
        String input = "Ontology:\n DataProperty: <urn:a>\n Range: {1.2}";
        OWLOntology o = loadOntologyFromString(input);
        Set<OWLLogicalAxiom> axioms = o.getLogicalAxioms();
View Full Code Here

                shortFormProvider);
        parser.setOWLEntityChecker(owlEntityChecker);
        parser.setDefaultOntology(o);
        // when
        // finally parse
        OWLAxiom axiom = parser.parseAxiom();
        // then
        assertEquals(df.getOWLSubClassOfAxiom(a, b), axiom);
    }
View Full Code Here

        applyEquivalentsRoundtrip(axioms1, axioms2, ontologyFormat);
        if (ontologyFormat instanceof ManchesterSyntaxDocumentFormat) {
            // drop GCIs from the expected axioms, they won't be there
            Iterator<OWLAxiom> it = axioms1.iterator();
            while (it.hasNext()) {
                OWLAxiom next = it.next();
                if (next instanceof OWLSubClassOfAxiom) {
                    if (((OWLSubClassOfAxiom) next).getSubClass().isAnonymous()
                            && ((OWLSubClassOfAxiom) next).getSuperClass()
                                    .isAnonymous()) {
                        it.remove();
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.