Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLDeclarationAxiom


            throws OWLOntologyCreationException, OWLOntologyStorageException {
        OWLOntology o = getOntologyWithPunnedInvalidDeclarations();
        OWLOntology reloaded = roundTrip(o, format);
        OWLAnnotationProperty ap = df
                .getOWLAnnotationProperty(iri("testProperty"));
        OWLDeclarationAxiom ax = df.getOWLDeclarationAxiom(ap);
        assertFalse("ap testProperty should not have been declared",
                reloaded.containsAxiom(ax));
    }
View Full Code Here


    }

    @Test
    public void shouldBuildDeclaration() {
        // given
        OWLDeclarationAxiom expected = df.getOWLDeclarationAxiom(ce,
                annotations);
        BuilderDeclaration builder = new BuilderDeclaration(expected, df);
        // when
        OWLObject built = builder.buildObject();
        // then
View Full Code Here

        OWLOntology ontology = manager
                .createOntology(IRI
                        .create("http://www.semanticweb.org/owlapi/ontologies/ontology"));
        // We can add a declaration axiom to the ontology, that essentially adds
        // the class to the signature of our ontology.
        OWLDeclarationAxiom declarationAxiom = factory
                .getOWLDeclarationAxiom(clsAMethodA);
        manager.addAxiom(ontology, declarationAxiom);
        // Note that it isn't necessary to add declarations to an ontology in
        // order to use an entity. For some ontology formats (e.g. the
        // Manchester Syntax), declarations will automatically be added in the
View Full Code Here

                    OWLAnnotation anno = getDataFactory().getOWLAnnotation(
                            property, con);
                    OWLAnnotationAssertionAxiom ax = getDataFactory()
                            .getOWLAnnotationAssertionAxiom(subject, anno);
                    owlOntologyManager.addAxiom(ontology, ax);
                    OWLDeclarationAxiom annotationPropertyDeclaration = getDataFactory()
                            .getOWLDeclarationAxiom(property);
                    owlOntologyManager.addAxiom(ontology,
                            annotationPropertyDeclaration);
                }
            }
View Full Code Here

     *        true if the axiom belongs to the parsed ones, false for the input
     * @return true if the axiom can be ignored
     */
    public boolean isIgnorableAxiom(OWLAxiom ax, boolean parse) {
        if (ax instanceof OWLDeclarationAxiom) {
            OWLDeclarationAxiom d = (OWLDeclarationAxiom) ax;
            if (parse) {
                // all extra declarations in the parsed ontology are fine
                return true;
            }
            // declarations of builtin and named individuals can be ignored
            return d.getEntity().isBuiltIn()
                    || d.getEntity().isOWLNamedIndividual();
        }
        return false;
    }
View Full Code Here

    @Test
    public void testCorrectAxioms() throws OWLOntologyCreationException {
        OWLOntology ont = createOntology();
        IRI clsIRI = IRI("http://owlapi.sourceforge.net/ontology#ClsA");
        OWLClass cls = Class(clsIRI);
        OWLDeclarationAxiom ax = Declaration(cls);
        assertTrue(ont.containsAxiom(ax));
    }
View Full Code Here

            // and the value may be not be explicitly declared. If it is not,
            // we assume it is a class
            IRI axValIRI = (IRI) ax.getValue();
            OWLClass axValClass = visitor.dataFactory.getOWLClass(axValIRI);
            if (inputOntology.getDeclarationAxioms(axValClass).isEmpty()) {
                OWLDeclarationAxiom newAx = visitor.dataFactory
                        .getOWLDeclarationAxiom(axValClass);
                manager.addAxiom(inputOntology, newAx);
                // we need to sync the MST entity checker with the new ontology
                // plus declarations;
                // we do this by creating a new MST - this is not particularly
View Full Code Here

        int totalAxioms = axioms.size();
        int workDone = 0;

        for (OWLAxiom axiom : axioms) {
            if (axiom instanceof OWLDeclarationAxiom) {
                OWLDeclarationAxiom a = (OWLDeclarationAxiom)axiom;
                OWLEntity ent = a.getEntity();
                if (ent.isOWLClass()) {
                    res.add(new ConceptInclusion(
                            new NamedConcept(ent.asOWLClass().toStringID()), NamedConcept.TOP_CONCEPT));
                } else if (ent.isOWLObjectProperty()) {
                    // Do nothing for now.
View Full Code Here

        OWLAnnotation oav = factory.getOWLAnnotation(oa, factory.getOWLStringLiteral(clazzlabel, "en"));
        OWLDatatype dt = factory.getOWLDatatype(IRI.create(DATATYPE));
        OWLNamedIndividual sub = factory.getOWLNamedIndividual(IRI.create(SUBJECT));
        OWLNamedIndividual obj = factory.getOWLNamedIndividual(IRI.create(OBJECT));
        OWLLiteral literal1 = factory.getOWLTypedLiteral(VALUE, dt);
        OWLDeclarationAxiom daxiomcls = factory.getOWLDeclarationAxiom(cls); // Classe
        OWLDeclarationAxiom daxiomop = factory.getOWLDeclarationAxiom(op); // obj prop
        OWLDeclarationAxiom daxiomdp = factory.getOWLDeclarationAxiom(dp); // data prop
        OWLDeclarationAxiom daxiomsub = factory.getOWLDeclarationAxiom(sub); // subject
        OWLDeclarationAxiom daxiomobj = factory.getOWLDeclarationAxiom(obj); // object

        OWLClassAssertionAxiom axiomsub = factory.getOWLClassAssertionAxiom(cls, sub); // Istanza
        OWLClassAssertionAxiom axiomobj = factory.getOWLClassAssertionAxiom(cls, obj); // Istanza
        OWLObjectPropertyAssertionAxiom axiomop = factory.getOWLObjectPropertyAssertionAxiom(op, sub, obj); // Obj
                                                                                                            // prop
View Full Code Here

        OWLAnnotation oav = factory.getOWLAnnotation(oa, factory.getOWLStringLiteral(clazzlabel, "en"));
        OWLDatatype dt = factory.getOWLDatatype(IRI.create(DATATYPE));
        OWLNamedIndividual sub = factory.getOWLNamedIndividual(IRI.create(SUBJECT));
        OWLNamedIndividual obj = factory.getOWLNamedIndividual(IRI.create(OBJECT));
        OWLLiteral literal1 = factory.getOWLTypedLiteral(VALUE, dt);
        OWLDeclarationAxiom daxiomcls = factory.getOWLDeclarationAxiom(cls); // Classe
        OWLDeclarationAxiom daxiomop = factory.getOWLDeclarationAxiom(op); // obj prop
        OWLDeclarationAxiom daxiomdp = factory.getOWLDeclarationAxiom(dp); // data prop
        OWLDeclarationAxiom daxiomsub = factory.getOWLDeclarationAxiom(sub); // subject
        OWLDeclarationAxiom daxiomobj = factory.getOWLDeclarationAxiom(obj); // object

        OWLClassAssertionAxiom axiomsub = factory.getOWLClassAssertionAxiom(cls, sub); // Istanza
        OWLClassAssertionAxiom axiomobj = factory.getOWLClassAssertionAxiom(cls, obj); // Istanza
        OWLObjectPropertyAssertionAxiom axiomop = factory.getOWLObjectPropertyAssertionAxiom(op, sub, obj); // Obj
                                                                                                            // prop
View Full Code Here

TOP

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

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.