Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLAxiom


        OWLObjectProperty first = getOWLObjectProperty(currentId);
        OWLObjectProperty second = getOWLObjectProperty(value);
        List<OWLObjectProperty> chain = new ArrayList<>();
        chain.add(first);
        chain.add(second);
        OWLAxiom ax = getDataFactory().getOWLSubPropertyChainOfAxiom(chain,
                first);
        applyChange(new AddAxiom(getOntology(), ax));
    }
View Full Code Here


    public void handle(String currentId, String value, String qualifierBlock,
            String comment) {
        if (Boolean.parseBoolean(value)) {
            OWLObjectProperty prop = getDataFactory().getOWLObjectProperty(
                    getIRIFromOBOId(currentId));
            OWLAxiom ax = getDataFactory().getOWLTransitiveObjectPropertyAxiom(
                    prop);
            applyChange(new AddAxiom(getOntology(), ax));
        }
    }
View Full Code Here

                getDataFactory(), map);
        for (OWLOntology ont : ontologies) {
            assert ont != null;
            for (OWLAxiom ax : ont.getLogicalAxioms()) {
                assert ax != null;
                OWLAxiom dupAx = replacer.duplicateObject(ax);
                if (!ax.equals(dupAx)) {
                    addChange(new RemoveAxiom(ont, ax));
                    addChange(new AddAxiom(ont, dupAx));
                }
            }
View Full Code Here

        }
        createEquivalentClass(equivalentClass);
    }

    private void createEquivalentClass(OWLClassExpression classExpression) {
        OWLAxiom ax = getDataFactory()
                .getOWLEquivalentClassesAxiom(
                        CollectionFactory.createSet(getCurrentClass(),
                                classExpression));
        getOWLOntologyManager().applyChange(new AddAxiom(ontology, ax));
    }
View Full Code Here

        }
    }

    @Override
    void handleChild(@Nonnull AbstractOWLAxiomElementHandler h) {
        OWLAxiom axiom = h.getOWLObject();
        if (!axiom.isAnnotationAxiom()
                || handler.getConfiguration().isLoadAnnotationAxioms()) {
            handler.getOWLOntologyManager().applyChange(
                    new AddAxiom(handler.getOntology(), axiom));
        }
    }
View Full Code Here

        OWLOntology o = m.createOntology(KOALA_IRI);
        // class A and class B
        OWLClass clsA = df.getOWLClass(IRI.create(KOALA_IRI + "#A"));
        OWLClass clsB = df.getOWLClass(IRI.create(KOALA_IRI + "#B"));
        // Now create the axiom
        OWLAxiom axiom = df.getOWLSubClassOfAxiom(clsA, clsB);
        // add the axiom to the ontology.
        AddAxiom addAxiom = new AddAxiom(o, axiom);
        // We now use the manager to apply the change
        m.applyChange(addAxiom);
        // remove the axiom from the ontology
View Full Code Here

        OWLClass quokkaCls = df.getOWLClass(IRI.create(KOALA_IRI + "#Quokka"));
        // the content of our comment: a string and a language tag
        OWLAnnotation commentAnno = df.getOWLAnnotation(df.getRDFSComment(),
                df.getOWLLiteral("A class which represents Quokkas", "en"));
        // Specify that the pizza class has an annotation
        OWLAxiom ax = df.getOWLAnnotationAssertionAxiom(quokkaCls.getIRI(),
                commentAnno);
        // Add the axiom to the ontology
        m.applyChange(new AddAxiom(o, ax));
        // add a version info annotation to the ontology
    }
View Full Code Here

        // does not contain class A or classB, we simply get references to
        // objects from a data factory that represent class A and class B
        OWLClass clsA = factory.getOWLClass(IRI.create(ontologyIRI + "#A"));
        OWLClass clsB = factory.getOWLClass(IRI.create(ontologyIRI + "#B"));
        // Now create the axiom
        OWLAxiom axiom = factory.getOWLSubClassOfAxiom(clsA, clsB);
        // We now add the axiom to the ontology, so that the ontology states
        // that A is a subclass of B. To do this we create an AddAxiom change
        // object. At this stage neither classes A or B, or the axiom are
        // contained in the ontology. We have to add the axiom to the ontology.
        AddAxiom addAxiom = new AddAxiom(ontology, axiom);
View Full Code Here

        OWLDatatype integerDatatype = factory
                .getOWLDatatype(OWL2Datatype.XSD_INTEGER.getIRI());
        // Create a typed literal. We type the literal "51" with the datatype
        OWLLiteral literal = factory.getOWLLiteral("51", integerDatatype);
        // Create the property assertion and add it to the ontology
        OWLAxiom ax = factory.getOWLDataPropertyAssertionAxiom(hasAge, john,
                literal);
        manager.addAxiom(ontology, ax);
        // Dump the ontology to System.out
        manager.saveOntology(ontology, new StreamDocumentTarget(
                new ByteArrayOutputStream()));
View Full Code Here

        OWLAnnotation commentAnno = df.getOWLAnnotation(df.getRDFSComment(),
                df.getOWLLiteral("A class which represents pizzas", "en"));
        // Specify that the pizza class has an annotation - to do this we attach
        // an entity annotation using an entity annotation axiom (remember,
        // classes are entities)
        OWLAxiom ax = df.getOWLAnnotationAssertionAxiom(pizzaCls.getIRI(),
                commentAnno);
        // Add the axiom to the ontology
        man.applyChange(new AddAxiom(ont, ax));
        // Now lets add a version info annotation to the ontology. There is no
        // 'standard' OWL 1.1 annotation object for this, like there is for
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.