Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLDatatype


    protected boolean isNonNegativeIntegerStrict(IRI mainNode, OWLRDFVocabulary predicate) {
        OWLLiteral literal = consumer.getLiteralObject(mainNode, predicate, false);
        if(literal == null) {
            return false;
        }
        OWLDatatype datatype = literal.getDatatype();
        OWL2Datatype nni = OWL2Datatype.XSD_NON_NEGATIVE_INTEGER;
        return datatype.getIRI().equals(nni.getIRI()) && nni.isInLexicalSpace(literal.getLiteral());
    }
View Full Code Here


        return prop;
    }


    public OWLDatatype getOWLDatatype(String name) {
        OWLDatatype dt = owlEntityChecker.getOWLDatatype(name);
        if (dt == null && dataTypeNames.contains(name)) {
            dt = dataFactory.getOWLDatatype(getIRI(name));
        }
        return dt;
    }
View Full Code Here

    private OWLDataRange parseDataRangePrimary() throws ParserException {
        String tok = peekToken();

        if (isDatatypeName(tok)) {
            consumeToken();
            OWLDatatype datatype = getOWLDatatype(tok);
            String next = peekToken();
            if (next.equals("[")) {
                // Restricted data range
                consumeToken();
                String sep = ",";
View Full Code Here

        Set<OntologyAxiomPair> axioms = new HashSet<OntologyAxiomPair>();
        if (!tok.equalsIgnoreCase(DATATYPE)) {
            throw createException(DATATYPE);
        }
        String subj = consumeToken();
        OWLDatatype datatype = getOWLDatatype(subj);
        if (datatype == null) {
            throw createException(false, false, false, false, true, false);
        }
        axioms.add(new OntologyAxiomPair(defaultOntology, dataFactory.getOWLDeclarationAxiom(datatype)));
        while (true) {
            String sect = peekToken();
            if (sect.equalsIgnoreCase(EQUIVALENT_TO)) {
                potentialKeywords.clear();
                consumeToken();
                Set<OWLOntology> onts = getOntologies();
                Set<OWLDataRange> drs = parseDataRangeList();
                for (OWLOntology ont : onts) {
                    for (OWLDataRange dr : drs) {
                        axioms.add(new OntologyAxiomPair(ont, dataFactory.getOWLDatatypeDefinitionAxiom(datatype, dr)));
                    }
                }
            }
            else if (sect.equalsIgnoreCase(ANNOTATIONS)) {
                potentialKeywords.clear();
                axioms.addAll(parseAnnotations(datatype.getIRI()));
            }
            else {
                break;
            }
        }
View Full Code Here

            }
            return getDataFactory().getOWLDataOneOf(vals);
        }

        private OWLLiteral process(OWLDataPropertyExpression prop, OWLLiteral con) {
            OWLDatatype dt = map.get(prop);
            if (dt != null) {
                return getDataFactory().getOWLLiteral(con.getLiteral(), dt);
            }
            else {
                return con;
View Full Code Here

        return dataFactory.getOWLAnonymousIndividual(id);
   
  }

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

        return i;
   
  }

  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

   
  }

  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

//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  final public OWLLiteral Literal() throws ParseException {
    boolean plain = true;
    String literal;
    OWLDatatype datatype = null;
    String lang = "";
    literal = QuotedString();
    if (jj_2_116(2)) {
      if (jj_2_114(2)) {
        jj_consume_token(DATATYPEIDENTIFIER);
                                  plain=false;
        datatype = DatatypeIRI();
      } else if (jj_2_115(2)) {
        jj_consume_token(LANGIDENTIFIER);
        lang = LangTag();
      } else {
        jj_consume_token(-1);
        throw new ParseException();
      }
    } else {
     
    }
        if(plain) {
            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);
            }
            return dataFactory.getOWLLiteral(literal, datatype);
        }
   
View Full Code Here

     * @return <code>true</code> if the specified data range expression is the top datatype
     *         or a built-in datatype; <code>false</code> otherwise
     */
    protected static boolean isTopOrBuiltInDatatype(OWLDataRange dataRange) {
        if (dataRange.isDatatype()) {
            OWLDatatype dataType = dataRange.asOWLDatatype();
            return (dataType.isTopDatatype() || dataType.isBuiltIn());
        }
        else
            return false;
    }
View Full Code Here

TOP

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

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.