Package org.ontoware.rdfreactor.runtime

Examples of org.ontoware.rdfreactor.runtime.RDFDataException


    if (node instanceof PlainLiteral) {
      return toLong(node.asLiteral());
    }

    if (node instanceof LanguageTagLiteral) {
      throw new RDFDataException(
          "Cannot convert a language tagged literal to an Long - it makes no sense");
    }

    if (node instanceof DatatypeLiteral) {
      URI datatype = node.asDatatypeLiteral().getDatatype();
      if (datatype.equals(XSD._long)) {
        return toLong(node.asDatatypeLiteral());
      } else {
        throw new RDFDataException("Cannot convert from datatype "
            + datatype + " to Long");
      }
    }

    throw new RDFDataException("Cannot convert from " + node.getClass()
        + " to Long");
  }
View Full Code Here


    if (node instanceof URI) {
      return node.asURI().asJavaURI();
    }

    if (node instanceof LanguageTagLiteral) {
      throw new RDFDataException(
          "Cannot convert a language tagged literal to a URI - it makes no sense");
    }

    try {
      if (node instanceof PlainLiteral) {
        return new java.net.URI(node.asLiteral().getValue());
      }
      if (node instanceof DatatypeLiteral) {
        URI datatype = node.asDatatypeLiteral().getDatatype();
        if (datatype.equals(XSD._anyURI)) {
          return new java.net.URI(node.asDatatypeLiteral().getValue());
        } else {
          throw new RDFDataException("Cannot convert from datatype "
              + datatype + " to URI");
        }
      }
    } catch (URISyntaxException e) {
      throw new RDFDataException("Could not convert <"
          + node.asLiteral().getValue() + "> to a java.net.URI", e);
    }

    throw new RDFDataException("Cannot convert from " + node.getClass()
        + " to URI");
  }
View Full Code Here

    if (node instanceof PlainLiteral) {
      return toDouble(node.asLiteral());
    }

    if (node instanceof LanguageTagLiteral) {
      throw new RDFDataException(
          "Cannot convert a language tagged literal to an Double - it makes no sense");
    }

    if (node instanceof DatatypeLiteral) {
      URI datatype = node.asDatatypeLiteral().getDatatype();

      if (datatype.equals(XSD._double)) {
        return toDouble(node.asDatatypeLiteral());
      } else {
        throw new RDFDataException("Cannot convert from datatype "
            + datatype + " to URI");
      }
    }

    throw new RDFDataException("Cannot convert from " + node.getClass()
        + " to Double");
  }
View Full Code Here

TOP

Related Classes of org.ontoware.rdfreactor.runtime.RDFDataException

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.