Examples of OWLSubClassOfAxiom


Examples of org.semanticweb.owlapi.model.OWLSubClassOfAxiom

    @Test
    public void testContainsReferenceForAxiomAnnotation() {
        OWLAnnotationProperty ap = AnnotationProperty(iri("prop"));
        OWLLiteral val = Literal("Test", "");
        OWLAnnotation anno = df.getOWLAnnotation(ap, val);
        OWLSubClassOfAxiom ax = df.getOWLSubClassOfAxiom(Class(iri("A")),
                Class(iri("B")), singleton(anno));
        OWLOntology ont = getOWLOntology("Ont");
        ont.getOWLOntologyManager().addAxiom(ont, ax);
        assertTrue(ont.containsAnnotationPropertyInSignature(anno.getProperty()
                .getIRI(), EXCLUDED));
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLSubClassOfAxiom

    public void testParsedAxioms() throws OWLOntologyCreationException {
        OWLOntology ontology = createOntology();
        Set<OWLSubClassOfAxiom> axioms = ontology
                .getAxioms(AxiomType.SUBCLASS_OF);
        assertEquals(1, axioms.size());
        OWLSubClassOfAxiom ax = axioms.iterator().next();
        OWLClass subCls = Class(SUBCLASS_IRI);
        assertEquals(subCls, ax.getSubClass());
        OWLClassExpression supCls = ax.getSuperClass();
        assertTrue(supCls instanceof OWLObjectSomeValuesFrom);
        OWLObjectSomeValuesFrom someValuesFrom = (OWLObjectSomeValuesFrom) supCls;
        OWLObjectProperty property = ObjectProperty(PROPERTY_IRI);
        OWLClass fillerCls = Class(FILLER_IRI);
        assertEquals(property, someValuesFrom.getProperty());
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLSubClassOfAxiom

            if (diff != 0) {
                return diff;
            }
            if (ax1 instanceof OWLSubClassOfAxiom
                    && ax2 instanceof OWLSubClassOfAxiom) {
                OWLSubClassOfAxiom sc1 = (OWLSubClassOfAxiom) ax1;
                OWLSubClassOfAxiom sc2 = (OWLSubClassOfAxiom) ax2;
                return sc1.getSuperClass().compareTo(sc2.getSuperClass());
            }
            return 1;
        }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLSubClassOfAxiom

        // 18 - i.e. Adult is a subclass of hasAge some int[>= 18] Obtain a
        // reference to the Adult class
        OWLClass adult = factory.getOWLClass(IRI.create(base + "#Adult"));
        // Now make adult a subclass of the things that have an age greater to
        // or equal to 18
        OWLSubClassOfAxiom ax = factory.getOWLSubClassOfAxiom(adult,
                thingsWithAgeGreaterOrEqualTo18);
        // Add our axiom to the ontology
        man.applyChange(new AddAxiom(ont, ax));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLSubClassOfAxiom

        // We now want to state that Head is a subclass of hasPart some Nose, to
        // do this we create a subclass axiom, with head as the subclass and
        // "hasPart some Nose" as the superclass (remember, restrictions are
        // also classes - they describe classes of individuals -- they are
        // anonymous classes).
        OWLSubClassOfAxiom ax = factory.getOWLSubClassOfAxiom(head,
                hasPartSomeNose);
        // Add the axiom to our ontology
        AddAxiom addAx = new AddAxiom(ont, ax);
        man.applyChange(addAx);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLSubClassOfAxiom

    @Test
    public void testIgnoreAnnotations() throws Exception {
        OWLOntology ont = m.createOntology();
        OWLClass clsA = Class(IRI("http://ont.com#A"));
        OWLClass clsB = Class(IRI("http://ont.com#B"));
        OWLSubClassOfAxiom sca = SubClassOf(clsA, clsB);
        m.addAxiom(ont, sca);
        OWLAnnotationProperty rdfsComment = RDFSComment();
        OWLLiteral lit = Literal("Hello world");
        OWLAnnotationAssertionAxiom annoAx1 = AnnotationAssertion(rdfsComment,
                clsA.getIRI(), lit);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLSubClassOfAxiom

    public void testIsGCIMethod() {
        OWLClass clsA = Class(iri("A"));
        OWLClass clsB = Class(iri("B"));
        OWLClass clsC = Class(iri("C"));
        OWLClassExpression desc = ObjectIntersectionOf(clsA, clsC);
        OWLSubClassOfAxiom ax1 = SubClassOf(clsA, clsB);
        assertFalse(ax1.isGCI());
        OWLSubClassOfAxiom ax2 = SubClassOf(desc, clsB);
        assertTrue(ax2.isGCI());
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLSubClassOfAxiom

            return false;
        }
        if (super.equals(obj)) {
            // superclass is responsible for null, identity, owlaxiom type and
            // annotations
            OWLSubClassOfAxiom other = (OWLSubClassOfAxiom) obj;
            return other.getSubClass().equals(subClass)
                    && other.getSuperClass().equals(superClass);
        }
        return false;
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLSubClassOfAxiom

        return AxiomType.SUBCLASS_OF;
    }

    @Override
    protected int compareObjectOfSameType(OWLObject object) {
        OWLSubClassOfAxiom other = (OWLSubClassOfAxiom) object;
        int diff = subClass.compareTo(other.getSubClass());
        if (diff != 0) {
            return diff;
        }
        return superClass.compareTo(other.getSuperClass());
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLSubClassOfAxiom

    @Override
    public OWLClassExpression visit(OWLDataPropertyAssertionAxiom axiom) {
        OWLClassExpression sub = oneOf(axiom.getSubject());
        OWLClassExpression sup = factory.getOWLDataHasValue(
                axiom.getProperty(), axiom.getObject());
        OWLSubClassOfAxiom ax = factory.getOWLSubClassOfAxiom(sub, sup);
        return ax.accept(this);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.