@Test public final void testLiteralWithURIType() throws BadRequestException { Value value = decoder.decodeValue("\"1\"^^<" + XMLSchema.INT + ">"); assertThat(value).isInstanceOf(Literal.class); assertThat((Literal) value).isEqualTo(factory.createLiteral(1)); }
protected Value decodeValue(String string) throws BadRequestException { Value result = null; try { if (string != null) { String value = string.trim(); if (!value.isEmpty() && !"null".equals(value)) { if (value.startsWith("_:")) { String label = value.substring("_:".length()); result = factory.createBNode(label); } else { if (value.charAt(0) == '<' && value.endsWith(">")) { result = factory.createIRI(value.substring(1, value.length() - 1)); } else { if (value.charAt(0) == '"') { result = parseLiteral(value); } else { result = parseURI(value); } } } } } } catch (Exception exc) { LOGGER.warn(exc.toString(), exc); throw new BadRequestException("Malformed value: " + string, exc); } return result; }
ValueDecoder { protected Value decodeValue(String string) throws BadRequestException { Value result = null; try { if (string != null) { String value = string.trim(); if (!value.isEmpty() && !"null".equals(value)) { if (value.startsWith("_:")) { String label = value.substring("_:".length()); result = factory.createBNode(label); } else { if (value.charAt(0) == '<' && value.endsWith(">")) { result = factory.createIRI(value.substring(1, value.length() - 1)); } else { if (value.charAt(0) == '"') { result = parseLiteral(value); } else { result = parseURI(value); } } } } } } catch (Exception exc) { LOGGER.warn(exc.toString(), exc); throw new BadRequestException("Malformed value: " + string, exc); } return result; } }
ValueDecoder { protected Value decodeValue(String string) throws BadRequestException { Value result = null; try { if (string != null) { String value = string.trim(); if (!value.isEmpty() && !"null".equals(value)) { if (value.startsWith("_:")) { String label = value.substring("_:".length()); result = factory.createBNode(label); } else { if (value.charAt(0) == '<' && value.endsWith(">")) { result = factory.createIRI(value.substring(1, value.length() - 1)); } else { if (value.charAt(0) == '"') { result = parseLiteral(value); } else { result = parseURI(value); } } } } } } catch (Exception exc) { LOGGER.warn(exc.toString(), exc); throw new BadRequestException("Malformed value: " + string, exc); } return result; } protected  ValueDecoder(Repository repository, ValueFactory factory); }
ValueDecoder { protected Value decodeValue(String string) throws BadRequestException { Value result = null; try { if (string != null) { String value = string.trim(); if (!value.isEmpty() && !"null".equals(value)) { if (value.startsWith("_:")) { String label = value.substring("_:".length()); result = factory.createBNode(label); } else { if (value.charAt(0) == '<' && value.endsWith(">")) { result = factory.createIRI(value.substring(1, value.length() - 1)); } else { if (value.charAt(0) == '"') { result = parseLiteral(value); } else { result = parseURI(value); } } } } } } catch (Exception exc) { LOGGER.warn(exc.toString(), exc); throw new BadRequestException("Malformed value: " + string, exc); } return result; } protected  ValueDecoder(Repository repository, ValueFactory factory);  }
ValueDecoder { protected Value decodeValue(String string) throws BadRequestException { Value result = null; try { if (string != null) { String value = string.trim(); if (!value.isEmpty() && !"null".equals(value)) { if (value.startsWith("_:")) { String label = value.substring("_:".length()); result = factory.createBNode(label); } else { if (value.charAt(0) == '<' && value.endsWith(">")) { result = factory.createIRI(value.substring(1, value.length() - 1)); } else { if (value.charAt(0) == '"') { result = parseLiteral(value); } else { result = parseURI(value); } } } } } } catch (Exception exc) { LOGGER.warn(exc.toString(), exc); throw new BadRequestException("Malformed value: " + string, exc); } return result; } protected  ValueDecoder(Repository repository, ValueFactory factory);   }