Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLObjectCardinalityRestriction


    @Test
    public void testEqualsPositiveMinCard() {
        OWLObjectProperty prop = OP(IRI());
        int cardinality = 3;
        OWLObjectCardinalityRestriction restA = testSubject
                .getOWLObjectMinCardinality(cardinality, prop,
                        testSubject.getOWLThing());
        OWLObjectCardinalityRestriction restB = testSubject
                .getOWLObjectMinCardinality(cardinality, prop,
                        testSubject.getOWLThing());
        assertEquals(restA, restB);
        OWLClassExpression cls = C(IRI());
        OWLObjectCardinalityRestriction restC = testSubject
                .getOWLObjectMinCardinality(cardinality, prop, cls);
        OWLObjectCardinalityRestriction restD = testSubject
                .getOWLObjectMinCardinality(cardinality, prop, cls);
        assertEquals(restC, restD);
    }
View Full Code Here


    @Test
    public void testEqualsNegativeMinCard() {
        OWLObjectProperty prop = OP(IRI());
        // Different cardinality
        OWLObjectCardinalityRestriction restA = testSubject
                .getOWLObjectMinCardinality(3, prop, testSubject.getOWLThing());
        OWLObjectCardinalityRestriction restB = testSubject
                .getOWLObjectMinCardinality(4, prop, testSubject.getOWLThing());
        assertFalse(restA.equals(restB));
        // Different property
        OWLObjectCardinalityRestriction restC = testSubject
                .getOWLObjectMinCardinality(3, OP(IRI()),
                        testSubject.getOWLThing());
        OWLObjectCardinalityRestriction restD = testSubject
                .getOWLObjectMinCardinality(3, OP(IRI()),
                        testSubject.getOWLThing());
        assertFalse(restC.equals(restD));
        // Different filler
        OWLObjectCardinalityRestriction restE = testSubject
                .getOWLObjectMinCardinality(3, prop, C(IRI()));
        OWLObjectCardinalityRestriction restF = testSubject
                .getOWLObjectMinCardinality(3, prop, C(IRI()));
        assertFalse(restE.equals(restF));
    }
View Full Code Here

    @Test
    public void testHashCodeMinCard() {
        OWLObjectProperty prop = OP(IRI());
        int cardinality = 3;
        OWLClassExpression cls = C(IRI());
        OWLObjectCardinalityRestriction restA = testSubject
                .getOWLObjectMinCardinality(cardinality, prop, cls);
        OWLObjectCardinalityRestriction restB = testSubject
                .getOWLObjectMinCardinality(cardinality, prop, cls);
        assertEquals(restA.hashCode(), restB.hashCode());
    }
View Full Code Here

        return false;
    }

    @Override
    protected int compareObjectOfSameType(OWLObject object) {
        OWLObjectCardinalityRestriction other = (OWLObjectCardinalityRestriction) object;
        int diff = getProperty().compareTo(other.getProperty());
        if (diff != 0) {
            return diff;
        }
        diff = getCardinality() - other.getCardinality();
        if (diff != 0) {
            return diff;
        }
        return getFiller().compareTo(other.getFiller());
    }
View Full Code Here

        Map<OWLObjectAllValuesFrom,OWLClassExpression> replacedDescriptions=new HashMap<OWLObjectAllValuesFrom,OWLClassExpression>();
        for (OWLClassExpression[] inclusion : axioms.m_conceptInclusions) {
            for (int index=0;index<inclusion.length;index++) {
                OWLClassExpression classExpression=inclusion[index];
                if (classExpression instanceof OWLObjectCardinalityRestriction) {
                    OWLObjectCardinalityRestriction objectCardinalityRestriction=(OWLObjectCardinalityRestriction)inclusion[index];
                    OWLObjectPropertyExpression objectPropertyExpression=objectCardinalityRestriction.getProperty();
                    if (axioms.m_complexObjectPropertyExpressions.contains(objectPropertyExpression))
                        throw new IllegalArgumentException("Non-simple property '"+objectPropertyExpression+"' or its inverse appears in a number restriction '"+objectCardinalityRestriction+"'.");
                }
                if (classExpression instanceof OWLObjectAllValuesFrom) {
                    OWLObjectAllValuesFrom objectAll=(OWLObjectAllValuesFrom)classExpression;
View Full Code Here

TOP

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

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.