Examples of OWLDatatype


Examples of org.semanticweb.owl.model.OWLDataType

     * @return <code>true</code> if the specified data range expression is the top data range
     *         or a built-in infinite datatype; <code>false</code> otherwise
     */
    protected static boolean isTopEquivalentDataRange(OWLDataRange dataRange) {
        if (dataRange.isDataType()){
            OWLDataType dataType = dataRange.asOWLDataType();
            return (dataType.isTopDataType() || (dataType.isBuiltIn() && !dataType.getBuiltInDatatype().isFinite()));
        }
        else return false;
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDatatype

        if (!propId.equals("shorthand")) {
            clause.addValue(propId);
            if (annVal instanceof OWLLiteral) {
                OWLLiteral owlLiteral = (OWLLiteral) annVal;
                clause.addValue(owlLiteral.getLiteral());
                OWLDatatype datatype = owlLiteral.getDatatype();
                IRI dataTypeIri = datatype.getIRI();
                if (!OWL2Datatype.isBuiltIn(dataTypeIri)) {
                    error("Untranslatable axiom due to unknown data type: "
                            + annVal, true);
                    return false;
                }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDatatype

        }
        throw new Error("Missing return statement in function");
    }

    final public OWLDatatype Datatype() throws ParseException {
        OWLDatatype dt;
        jj_consume_token(DATATYPE);
        jj_consume_token(OPENPAR);
        dt = DatatypeIRI();
        jj_consume_token(CLOSEPAR);
        {
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDatatype

        throw new Error("Missing return statement in function");
    }

    final public OWLDatatypeDefinitionAxiom DatatypeDefinitionAxiom()
            throws ParseException {
        OWLDatatype datatype;
        OWLDataRange dr;
        Set<OWLAnnotation> axAnnos;
        jj_consume_token(DATATYPEDEFINITION);
        jj_consume_token(OPENPAR);
        axAnnos = AxiomAnnotationSet();
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDatatype

        throw new Error("Missing return statement in function");
    }

    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();
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDatatype

    //
    // //////////////////////////////////////////////////////////////////////////////////////////////////////////////
    final public OWLLiteral Literal() throws ParseException {
        boolean plain = true;
        String literal;
        OWLDatatype datatype = null;
        String lang = "";
        literal = QuotedString();
        switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) {
            case LANGIDENTIFIER:
            case DATATYPEIDENTIFIER: {
                switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) {
                    case DATATYPEIDENTIFIER: {
                        jj_consume_token(DATATYPEIDENTIFIER);
                        plain = false;
                        datatype = DatatypeIRI();
                        break;
                    }
                    case LANGIDENTIFIER: {
                        jj_consume_token(LANGIDENTIFIER);
                        lang = LangTag();
                        break;
                    }
                    default:
                        jj_la1[41] = jj_gen;
                        jj_consume_token(-1);
                        throw new ParseException();
                }
                break;
            }
            default:
                jj_la1[42] = jj_gen;
                ;
        }
        if (plain) {
            {
                if ("" != null) {
                    return dataFactory.getOWLLiteral(literal, lang);
                }
            }
        } else {
            // a float value in this syntax has an extra 'f' or 'F' character
            // that must be removed to make a valid OWL literal
            if (datatype.isFloat()
                    && (literal.endsWith("f") || literal.endsWith("F"))
                    && !(literal.endsWith("inf") || literal.endsWith("INF"))) {
                literal = literal.substring(0, literal.length() - 1);
            }
            {
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDatatype

     *         datatype or a built-in datatype; {@code false} otherwise
     */
    protected static boolean isTopOrBuiltInDatatype(
            @Nonnull OWLDataRange dataRange) {
        if (dataRange.isDatatype()) {
            OWLDatatype dataType = dataRange.asOWLDatatype();
            return dataType.isTopDatatype() || dataType.isBuiltIn();
        } else {
            return false;
        }
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDatatype

        return prop;
    }

    @Nonnull
    private OWLDatatype getOWLDatatype(@Nonnull String name) {
        OWLDatatype dt = owlEntityChecker.getOWLDatatype(name);
        if (dt == null && dataTypeNames.contains(name)) {
            dt = dataFactory.getOWLDatatype(getIRI(name));
        }
        if (dt == null) {
            throw new ExceptionBuilder().withDt().build();
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDatatype

    @Nonnull
    private OWLDataRange parseDataRangePrimary() {
        String tok = peekToken();
        if (isDatatypeName(tok)) {
            consumeToken();
            OWLDatatype datatype = getOWLDatatype(tok);
            String next = peekToken();
            if (OPENBRACKET.matches(next)) {
                // Restricted data range
                consumeToken();
                String sep = COMMA.keyword();
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDatatype

        Set<OntologyAxiomPair> axioms = new HashSet<>();
        if (!DATATYPE.matches(tok)) {
            throw new ExceptionBuilder().withKeyword(DATATYPE).build();
        }
        String subj = consumeToken();
        OWLDatatype datatype = getOWLDatatype(subj);
        axioms.add(new OntologyAxiomPair(defaultOntology, dataFactory
                .getOWLDeclarationAxiom(datatype)));
        while (true) {
            String sect = peekToken();
            if (EQUIVALENT_TO.matches(sect)) {
                potentialKeywords.clear();
                consumeToken();
                Set<OWLOntology> onts = getOntologies();
                Set<OWLDataRange> drs = parseDataRangeList();
                for (OWLOntology ont : onts) {
                    assert ont != null;
                    for (OWLDataRange dr : drs) {
                        assert dr != null;
                        axioms.add(new OntologyAxiomPair(ont, dataFactory
                                .getOWLDatatypeDefinitionAxiom(datatype, dr)));
                    }
                }
            } else if (ANNOTATIONS.matches(sect)) {
                potentialKeywords.clear();
                axioms.addAll(parseAnnotations(datatype.getIRI()));
            } else {
                break;
            }
        }
        return axioms;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.