Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLDataRange


                D(IRI()));
        OWLRestriction restB = testSubject.getOWLDataSomeValuesFrom(prop,
                D(IRI()));
        assertFalse(restA.equals(restB));
        // Different property
        OWLDataRange filler = D(IRI());
        OWLRestriction restC = testSubject.getOWLDataSomeValuesFrom(DP(IRI()),
                filler);
        OWLRestriction restD = testSubject.getOWLDataSomeValuesFrom(DP(IRI()),
                filler);
        assertFalse(restC.equals(restD));
View Full Code Here


    }

    @Test
    public void testHashCodeDataSome() {
        OWLDataProperty prop = DP(IRI());
        OWLDataRange filler = D(IRI());
        OWLRestriction restA = testSubject.getOWLDataSomeValuesFrom(prop,
                filler);
        OWLRestriction restB = testSubject.getOWLDataSomeValuesFrom(prop,
                filler);
        assertEquals(restA.hashCode(), restB.hashCode());
View Full Code Here

    }

    @Test
    public void testEqualsPositiveDataAll() {
        OWLDataProperty prop = DP(IRI());
        OWLDataRange filler = D(IRI());
        OWLRestriction restA = testSubject
                .getOWLDataAllValuesFrom(prop, filler);
        OWLRestriction restB = testSubject
                .getOWLDataAllValuesFrom(prop, filler);
        assertEquals(restA, restB);
View Full Code Here

                D(IRI()));
        OWLRestriction restB = testSubject.getOWLDataAllValuesFrom(prop,
                D(IRI()));
        assertFalse(restA.equals(restB));
        // Different property
        OWLDataRange filler = D(IRI());
        OWLRestriction restC = testSubject.getOWLDataAllValuesFrom(DP(IRI()),
                filler);
        OWLRestriction restD = testSubject.getOWLDataAllValuesFrom(DP(IRI()),
                filler);
        assertFalse(restC.equals(restD));
View Full Code Here

    }

    @Test
    public void testHashCodeDataAll() {
        OWLDataProperty prop = DP(IRI());
        OWLDataRange filler = D(IRI());
        OWLRestriction restA = testSubject
                .getOWLDataAllValuesFrom(prop, filler);
        OWLRestriction restB = testSubject
                .getOWLDataAllValuesFrom(prop, filler);
        assertEquals(restA.hashCode(), restB.hashCode());
View Full Code Here

        }

        private void translateEquivalentDataRanges(@Nonnull IRI subject,
                @Nonnull IRI predicate, @Nonnull IRI object) {
            OWLDatatype datatype = df.getOWLDatatype(subject);
            OWLDataRange dataRange = consumer.translateDataRange(object);
            OWLDatatypeDefinitionAxiom def = df.getOWLDatatypeDefinitionAxiom(
                    datatype, dataRange, getPendingAnnotations());
            addAxiom(def);
            consumeTriple(subject, predicate, object);
        }
View Full Code Here

        // Adults have an age greater than 18.
        OWLDataProperty hasAge = df.getOWLDataProperty(IRI.create(EXAMPLE_IRI
                + "hasAge"));
        // Create the restricted data range by applying the facet restriction
        // with a value of 18 to int
        OWLDataRange greaterThan18 = df.getOWLDatatypeRestriction(
                df.getIntegerOWLDatatype(), OWLFacet.MIN_INCLUSIVE,
                df.getOWLLiteral(18));
        // Now we can use this in our datatype restriction on hasAge
        OWLClassExpression adultDefinition = df.getOWLDataSomeValuesFrom(
                hasAge, greaterThan18);
View Full Code Here

            OWLDataPropertyExpression property = getConsumer()
                    .translateDataPropertyExpression(propertyIRI);
            IRI fillerIRI = getConsumer().getResourceObject(mainNode,
                    OWL_ALL_VALUES_FROM, true);
            assert fillerIRI != null;
            OWLDataRange filler = getConsumer().translateDataRange(fillerIRI);
            return getDataFactory().getOWLDataAllValuesFrom(property, filler);
        }
View Full Code Here

            IRI fillerIRI = getConsumer().getResourceObject(mainNode,
                    OWL_ON_DATA_RANGE, true);
            if (fillerIRI != null
                    && !getConsumer().getConfiguration().isStrict()) {
                // Be tolerant
                OWLDataRange filler = getConsumer().translateDataRange(
                        fillerIRI);
                return getDataFactory().getOWLDataExactCardinality(cardi,
                        property, filler);
            } else {
                return getDataFactory().getOWLDataExactCardinality(cardi,
View Full Code Here

public class DataUnionOfTestCase extends AbstractFileRoundTrippingTestCase {

    @Test
    public void testCorrectAxioms() {
        Set<OWLAxiom> axioms = new HashSet<>();
        OWLDataRange intdr = Integer();
        OWLDataRange floatdr = Float();
        OWLDataRange union = DataUnionOf(intdr, floatdr);
        OWLDataProperty p = DataProperty(iri("p"));
        OWLDataPropertyRangeAxiom ax = DataPropertyRange(p, union);
        axioms.add(ax);
        axioms.add(Declaration(p));
        assertEquals(getOnt().getAxioms(), axioms);
View Full Code Here

TOP

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

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.