Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLDataPropertyRangeAxiom


    }

    @Test
    public void shouldBuildDataPropertyRange() {
        // given
        OWLDataPropertyRangeAxiom expected = df.getOWLDataPropertyRangeAxiom(
                dp, d, annotations);
        BuilderDataPropertyRange builder = new BuilderDataPropertyRange(
                expected, df);
        // when
        OWLObject built = builder.buildObject();
View Full Code Here


        Set<OWLAxiom> axioms = new HashSet<>();
        OWLDataRange intdr = df.getIntegerOWLDatatype();
        OWLDataRange floatdr = df.getFloatOWLDatatype();
        OWLDataRange intersection = df.getOWLDataIntersectionOf(intdr, floatdr);
        OWLDataProperty p = DataProperty(iri("p"));
        OWLDataPropertyRangeAxiom ax = df.getOWLDataPropertyRangeAxiom(p,
                intersection);
        axioms.add(ax);
        axioms.add(Declaration(p));
        assertEquals(getOnt().getAxioms(), axioms);
    }
View Full Code Here

        // :hasAge data property to 18 or more we specify its range as this data
        // range
        PrefixManager pm = new DefaultPrefixManager(null, null,
                "http://www.semanticweb.org/ontologies/dataranges#");
        OWLDataProperty hasAge = factory.getOWLDataProperty(":hasAge", pm);
        OWLDataPropertyRangeAxiom rangeAxiom = factory
                .getOWLDataPropertyRangeAxiom(hasAge, integerGE18);
        OWLOntology ontology = manager.createOntology(IRI
                .create("http://www.semanticweb.org/ontologies/dataranges"));
        // Add the range axiom to our ontology
        manager.addAxiom(ontology, rangeAxiom);
View Full Code Here

    @Test
    public void testCorrectAxioms() {
        Set<OWLAxiom> axioms = new HashSet<>();
        OWLDataRange oneOf = DataOneOf(Literal(30), Literal(31f));
        OWLDataProperty p = DataProperty(iri("p"));
        OWLDataPropertyRangeAxiom ax = DataPropertyRange(p, oneOf);
        axioms.add(ax);
        axioms.add(Declaration(p));
        assertEquals(getOnt().getAxioms(), axioms);
    }
View Full Code Here

        Set<OWLAxiom> axioms = new HashSet<>();
        OWLDataRange dr = DatatypeRestriction(Integer(),
                FacetRestriction(OWLFacet.MIN_INCLUSIVE, Literal(18)),
                FacetRestriction(OWLFacet.MAX_INCLUSIVE, Literal(30)));
        OWLDataProperty p = DataProperty(iri("p"));
        OWLDataPropertyRangeAxiom ax = DataPropertyRange(p, dr);
        axioms.add(ax);
        axioms.add(Declaration(p));
        assertEquals(getOnt().getAxioms(), axioms);
    }
View Full Code Here

        OWLDataIntersectionOf disj2 = DataIntersectionOf(DataComplementOf(dt),
                dr);
        // here I negate dt
        OWLDataUnionOf union = DataUnionOf(disj1, disj2);
        OWLDataProperty prop = DataProperty(iri("prop"));
        OWLDataPropertyRangeAxiom ax = DataPropertyRange(prop, union);
        return singleton(ax);
    }
View Full Code Here

        OWLDatatypeRestriction integerGE18 = df.getOWLDatatypeRestriction(
                integer, OWLFacet.MIN_INCLUSIVE, eighteen);
        OWLDataProperty hasAge = df
                .getOWLDataProperty(IRI
                        .create("http://www.semanticweb.org/ontologies/dataranges#hasAge"));
        OWLDataPropertyRangeAxiom rangeAxiom = df.getOWLDataPropertyRangeAxiom(
                hasAge, integerGE18);
        OWLOntology o = m.createOntology(IRI
                .create("http://www.semanticweb.org/ontologies/dataranges"));
        // Add the range axiom to our ontology
        m.addAxiom(o, rangeAxiom);
View Full Code Here

        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

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

    public void testDataPropertyRangeAxiomAccessors() {
        OWLOntology ont = getOWLOntology("ont");
        OWLDataProperty propP = DataProperty(iri("p"));
        OWLDatatype dt = Datatype(iri("dt"));
        OWLOntologyManager man = ont.getOWLOntologyManager();
        OWLDataPropertyRangeAxiom ax = DataPropertyRange(propP, dt);
        man.addAxiom(ont, ax);
        performAxiomTests(ont, ax);
        assertTrue(ont.getDataPropertyRangeAxioms(propP).contains(ax));
        assertTrue(ont.getAxioms(propP, EXCLUDED).contains(ax));
        assertTrue(range(ont.getDataPropertyRangeAxioms(propP)).contains(dt));
View Full Code Here

TOP

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

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.