Package virtuoso.sql

Examples of virtuoso.sql.ExtendedString


 
  private Value castValue(Object val) throws RepositoryException {
    if (val == null)
      return null;
    if (val instanceof ExtendedString) {
      ExtendedString ves = (ExtendedString) val;
      String valueString = ves.toString();
      if (ves.getIriType() == ExtendedString.IRI && (ves.getStrType() & 0x01)==0x01) {
        if (valueString.startsWith("_:")) {
          valueString = valueString.substring(2);
          return getRepository().getValueFactory().createBNode(valueString);
        }
        try {
          if (valueString.indexOf(':') < 0)
            return getRepository().getValueFactory().createURI(":" + valueString);
          else
            return getRepository().getValueFactory().createURI(valueString);
        }
        catch (IllegalArgumentException iaex) {
          throw new RepositoryException("VirtuosoRepositoryConnection().castValue() Invalid value from Virtuoso: \"" + valueString + "\"", iaex);
        }
      }
      else if (ves.getIriType() == ExtendedString.BNODE) {
        try {
          valueString = valueString.substring(9); // "nodeID://"
          return getRepository().getValueFactory().createBNode(valueString);
        }
        catch (IllegalArgumentException iaex) {
          throw new RepositoryException("VirtuosoRepositoryConnection().castValue() Invalid value from Virtuoso: \"" + valueString + "\"", iaex);
        }
      }
      else {
        try {
          return getRepository().getValueFactory().createLiteral(valueString);
        }
        catch (IllegalArgumentException iaex) {
          throw new RepositoryException("VirtuosoRepositoryConnection().castValue() Invalid value from Virtuoso: \"" + valueString + "\", STRTYPE = " + ves.getIriType(), iaex);
        }
      }
    }
    else if (val instanceof RdfBox) {
      RdfBox rb = (RdfBox) val;
View Full Code Here


  private Value castValue(Object val) throws StoreException
  {
    if (val == null)
      return null;
    if (val instanceof ExtendedString) {
      ExtendedString ves = (ExtendedString) val;
      String valueString = ves.toString();
      if (ves.getIriType() == ExtendedString.IRI && (ves.getStrType() & 0x01)==0x01) {
        if (valueString.startsWith("_:")) {
          valueString = valueString.substring(2);
          return getValueFactory().createBNode(valueString);
        }
        try {
          if (valueString.indexOf(':') < 0)
            return getValueFactory().createURI(":" + valueString);
          else
            return getValueFactory().createURI(valueString);
        }
        catch (IllegalArgumentException iaex) {
          throw new StoreException("VirtuosoRepositoryConnection().castValue() Invalid value from Virtuoso: \"" + valueString + "\"", iaex);
        }
      }
      else if (ves.getIriType() == ExtendedString.BNODE) {
        try {
          valueString = valueString.substring(9); // "nodeID://"
          return getValueFactory().createBNode(valueString);
        }
        catch (IllegalArgumentException iaex) {
          throw new StoreException("VirtuosoRepositoryConnection().castValue() Invalid value from Virtuoso: \"" + valueString + "\"", iaex);
        }
      }
      else {
        try {
          return getValueFactory().createLiteral(valueString);
        }
        catch (IllegalArgumentException iaex) {
          throw new StoreException("VirtuosoRepositoryConnection().castValue() Invalid value from Virtuoso: \"" + valueString + "\", STRTYPE = " + ves.getIriType(), iaex);
        }
      }
    }
    else if (val instanceof RdfBox) {
      RdfBox rb = (RdfBox) val;
View Full Code Here

TOP

Related Classes of virtuoso.sql.ExtendedString

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.