Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLFacetRestriction


    }

    final public OWLDataRange DataRangeRestriction() throws ParseException {
        OWLFacet v;
        OWLDatatype rng;
        OWLFacetRestriction facetRestriction;
        Set<OWLFacetRestriction> facetRestrictions = new HashSet<OWLFacetRestriction>();
        jj_consume_token(DATATYPERESTRICTION);
        jj_consume_token(OPENPAR);
        rng = DatatypeIRI();
        label_9: while (true) {
View Full Code Here


    }

    @Test
    public void shouldBuildDatatypeRestriction() {
        // given
        OWLFacetRestriction r = df.getOWLFacetRestriction(OWLFacet.MAX_LENGTH,
                lit);
        OWLDatatypeRestriction expected = df.getOWLDatatypeRestriction(d, r);
        BuilderDatatypeRestriction builder = new BuilderDatatypeRestriction(
                expected, df);
        // when
View Full Code Here

    }

    @Test
    public void shouldBuildFacetRestriction() {
        // given
        OWLFacetRestriction expected = df.getOWLFacetRestriction(
                OWLFacet.MAX_EXCLUSIVE, lit);
        BuilderFacetRestriction builder = new BuilderFacetRestriction(expected,
                df);
        // when
        OWLObject built = builder.buildObject();
View Full Code Here

        // equal to 13 and less than 20. In Manchester Syntax this is written as
        // Person and hasAge some int[>=13, <20] We create a data range by
        // taking the integer datatype and applying facet restrictions to it.
        // Note that we have statically imported the data range facet vocabulary
        // OWLFacet
        OWLFacetRestriction geq13 = factory.getOWLFacetRestriction(
                MIN_INCLUSIVE, factory.getOWLLiteral(13));
        // We don't have to explicitly create the typed constant, there are
        // convenience methods to do this
        OWLFacetRestriction lt20 = factory.getOWLFacetRestriction(
                MAX_EXCLUSIVE, 20);
        // Restrict the base type, integer (which is just an XML Schema
        // Datatype) with the facet restrictions.
        OWLDataRange dataRng = factory.getOWLDatatypeRestriction(
                integerDatatype, geq13, lt20);
View Full Code Here

    @Nonnull
    @Override
    protected Set<? extends OWLAxiom> createAxioms() {
        OWLDatatype dt = Datatype(IRI("file:/c/test.owlapi#SSN"));
        OWLFacetRestriction fr = FacetRestriction(OWLFacet.PATTERN,
                Literal("[0-9]{3}-[0-9]{2}-[0-9]{4}"));
        OWLDataRange dr = DatatypeRestriction(
                Datatype(IRI("http://www.w3.org/2001/XMLSchema#string")), fr);
        OWLDataIntersectionOf disj1 = DataIntersectionOf(DataComplementOf(dr),
                dt);
View Full Code Here

    }

    @Test
    public void shouldBuildDatatypeRestriction() {
        // given
        OWLFacetRestriction r = df.getOWLFacetRestriction(OWLFacet.MAX_LENGTH,
                lit);
        BuilderDatatypeRestriction builder = new BuilderDatatypeRestriction(df)
                .withItem(r).withDatatype(d);
        OWLObject expected = df.getOWLDatatypeRestriction(d, r);
        // when
View Full Code Here

            throws OWLOntologyCreationException {
        // given
        String text1 = "p some decimal[<=2.0, >= 1.0]";
        OWLDatatype decimal = df.getOWLDatatype(OWL2Datatype.XSD_DECIMAL
                .getIRI());
        OWLFacetRestriction max = df.getOWLFacetRestriction(
                OWLFacet.MAX_INCLUSIVE, df.getOWLLiteral("2.0", decimal));
        OWLFacetRestriction min = df.getOWLFacetRestriction(
                OWLFacet.MIN_INCLUSIVE, df.getOWLLiteral("1.0", decimal));
        OWLClassExpression expected = df.getOWLDataSomeValuesFrom(p,
                df.getOWLDatatypeRestriction(decimal, max, min));
        // ontology creation including labels - this is the input ontology
        OWLOntology o = m.createOntology();
View Full Code Here

        return visitor.visit(this);
    }

    @Override
    protected int compareObjectOfSameType(OWLObject object) {
        OWLFacetRestriction other = (OWLFacetRestriction) object;
        int diff = facet.compareTo(other.getFacet());
        if (diff != 0) {
            return diff;
        }
        return facetValue.compareTo(other.getFacetValue());
    }
View Full Code Here

  }

  final public OWLDataRange DataRangeRestriction() throws ParseException {
    //OWLFacet v;
    OWLDatatype rng;
    OWLFacetRestriction facetRestriction;
    Set<OWLFacetRestriction> facetRestrictions = new HashSet<OWLFacetRestriction>();
    jj_consume_token(DATATYPERESTRICTION);
    jj_consume_token(OPENPAR);
    rng = DatatypeIRI();
    label_9:
View Full Code Here

        return visitor.visit(this);
    }

    @Override
  protected int compareObjectOfSameType(OWLObject object) {
        OWLFacetRestriction other = (OWLFacetRestriction) object;
        int diff = facet.compareTo(other.getFacet());
        if (diff != 0) {
            return diff;
        }
        return facetValue.compareTo(other.getFacetValue());
    }
View Full Code Here

TOP

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

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.