Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLClass


            IRI propIRI = getConsumer().getRelationIRIFromSymbolicIdOrOBOId(
                    matcher.group(1));
            IRI fillerIRI = getIRIFromOBOId(matcher.group(2));
            OWLObjectProperty prop = getDataFactory().getOWLObjectProperty(
                    propIRI);
            OWLClass filler = getDataFactory().getOWLClass(fillerIRI);
            OWLClassExpression restriction = getDataFactory()
                    .getOWLObjectSomeValuesFrom(prop, filler);
            OWLClass subCls = getDataFactory().getOWLClass(
                    getIRIFromOBOId(currentId));
            applyChange(new AddAxiom(getOntology(), getDataFactory()
                    .getOWLSubClassOfAxiom(subCls, restriction)));
            applyChange(new AddAxiom(getOntology(), getDataFactory()
                    .getOWLDeclarationAxiom(prop)));
View Full Code Here


        }

        @Override
        public void handleTriple(IRI subject, IRI predicate, IRI object) {
            OWLIndividual ind = df.getOWLNamedIndividual(subject);
            OWLClass skosConcept = df.getOWLClass(object);
            addAxiom(df.getOWLClassAssertionAxiom(skosConcept, ind));
        }
View Full Code Here

    public NodeSet<OWLNamedIndividual> getInstances(
            @Nonnull OWLClassExpression ce, boolean direct) {
        ensurePrepared();
        DefaultNodeSet<OWLNamedIndividual> result = new OWLNamedIndividualNodeSet();
        if (!ce.isAnonymous()) {
            OWLClass cls = ce.asOWLClass();
            Set<OWLClass> clses = new HashSet<>();
            clses.add(cls);
            if (!direct) {
                clses.addAll(getSubClasses(cls, false).getFlattened());
            }
View Full Code Here

            boolean showBottomNode) {
        if (!showBottomNode && cls.isBottomNode()) {
            return;
        }
        printIndent(level);
        OWLClass representative = cls.getRepresentativeElement();
        System.out.println(getEquivalentClasses(representative));
        for (Node<OWLClass> subCls : getSubClasses(representative, true)) {
            assert subCls != null;
            dumpClassHierarchy(subCls, level + 1, showBottomNode);
        }
View Full Code Here

        }

        @Override
        public void handleTriple(IRI subject, IRI predicate, IRI object) {
            if (!consumer.isAnonymousNode(subject)) {
                OWLClass cls = (OWLClass) translateClassExpression(subject);
                Set<OWLClassExpression> classExpressions = consumer.translatorAccessor
                        .translateToClassExpressionSet(object);
                addAxiom(df.getOWLDisjointUnionAxiom(cls, classExpressions,
                        getPendingAnnotations()));
                consumeTriple(subject, predicate, object);
View Full Code Here

        @SuppressWarnings("null")
        SimpleHierarchyExample simpleHierarchy = new SimpleHierarchyExample(
                (OWLReasonerFactory) Class.forName(reasonerFactoryClassName)
                        .newInstance(), ontology);
        // Get Thing
        OWLClass clazz = manager.getOWLDataFactory().getOWLThing();
        System.out.println("Class       : " + clazz);
        // Print the hierarchy below thing
        simpleHierarchy.printHierarchy(clazz);
    }
View Full Code Here

    public void shouldCreateViolationForOWLDisjointUnionAxiomInOWL2DLProfile()
            throws Exception {
        OWLOntology o = createOnto();
        OWLOntologyManager m = o.getOWLOntologyManager();
        declare(o, OP);
        OWLClass otherfakeclass = Class(IRI("urn:test#otherfakeclass"));
        declare(o, CL);
        declare(o, otherfakeclass);
        m.addAxiom(o, DisjointUnion(CL, otherfakeclass));
        OWL2DLProfile profile = new OWL2DLProfile();
        int expected = 1;
View Full Code Here

    @Test
    public void testAddAxioms() throws OWLException {
        OWLOntologyManager m = create();
        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
View Full Code Here

    @Test
    public void testAssertedSuperclasses() throws OWLException {
        OWLOntologyManager m = create();
        OWLOntology o = loadPizzaOntology(m);
        OWLClass quokkaCls = df.getOWLClass(IRI.create(KOALA_IRI + "#Quokka"));
        Collection<OWLSubClassOfAxiom> classes = o
                .getSubClassAxiomsForSubClass(quokkaCls);
        // for each superclass there will be a corresponding axiom
        // the ontology indexes axioms in a variety of ways
        assertEquals(2, classes.size());
View Full Code Here

    @Test
    public void testSWRL() throws OWLException {
        OWLOntologyManager m = create();
        OWLOntology o = m.createOntology(EXAMPLE_IRI);
        // Get hold of references to class A and class B.
        OWLClass clsA = df.getOWLClass(IRI.create(EXAMPLE_IRI + "#A"));
        OWLClass clsB = df.getOWLClass(IRI.create(EXAMPLE_IRI + "#B"));
        SWRLVariable var = df.getSWRLVariable(IRI.create(EXAMPLE_IRI + "#x"));
        Set<SWRLClassAtom> body = Collections.singleton(df.getSWRLClassAtom(
                clsA, var));
        Set<SWRLClassAtom> head = Collections.singleton(df.getSWRLClassAtom(
                clsB, var));
View Full Code Here

TOP

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

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.