Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLDataCardinalityRestriction


    @Test
    public void testEqualsNegativeDataMax() {
        OWLDataProperty prop = DP(IRI());
        // Different cardinality
        OWLDataCardinalityRestriction restA = testSubject
                .getOWLDataMaxCardinality(3, prop, testSubject.getTopDatatype());
        OWLDataCardinalityRestriction restB = testSubject
                .getOWLDataMaxCardinality(4, prop, testSubject.getTopDatatype());
        assertFalse(restA.equals(restB));
        // Different property
        OWLDataCardinalityRestriction restC = testSubject
                .getOWLDataMaxCardinality(3, DP(IRI()),
                        testSubject.getTopDatatype());
        OWLDataCardinalityRestriction restD = testSubject
                .getOWLDataMaxCardinality(3, DP(IRI()),
                        testSubject.getTopDatatype());
        assertFalse(restC.equals(restD));
        // Different filler
        OWLDataCardinalityRestriction restE = testSubject
                .getOWLDataMaxCardinality(3, prop, D(IRI()));
        OWLDataCardinalityRestriction restF = testSubject
                .getOWLDataMaxCardinality(3, prop, D(IRI()));
        assertFalse(restE.equals(restF));
        assertEquals(restA.getProperty(), prop);
    }
View Full Code Here


    @Test
    public void testHashCodeDataMax() {
        OWLDataProperty prop = DP(IRI());
        int cardinality = 3;
        OWLDataRange dataRange = D(IRI());
        OWLDataCardinalityRestriction restA = testSubject
                .getOWLDataMaxCardinality(cardinality, prop, dataRange);
        OWLDataCardinalityRestriction restB = testSubject
                .getOWLDataMaxCardinality(cardinality, prop, dataRange);
        assertEquals(restA, restB);
        assertEquals(restA.getProperty(), prop);
    }
View Full Code Here

        return false;
    }

    @Override
    protected int compareObjectOfSameType(OWLObject object) {
        OWLDataCardinalityRestriction other = (OWLDataCardinalityRestriction) 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

TOP

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

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.