@Override public boolean verifyDatatype(String literalValue, IRI datatypeUri) throws LiteralUtilException { if (isRecognizedDatatype(datatypeUri)) { if (literalValue == null) { throw new NullPointerException("Literal value cannot be null"); } // TODO: Implement verification return true; } throw new LiteralUtilException("Could not verify DBPedia literal"); }
reportError( "'" + label + "' did not have a valid value for language " + lang + ": " + e.getMessage() + " and could not be normalised", lineNo, columnNo, BasicParserSettings.NORMALIZE_LANGUAGE_TAGS, parserConfig, errListener); reportError( "'" + label + "' is not a valid value for datatype " + datatype + ": " + e.getMessage() + " and could not be normalised", lineNo, columnNo, BasicParserSettings.NORMALIZE_DATATYPE_VALUES, parserConfig, errListener);
@Override public boolean verifyDatatype(String literalValue, IRI datatypeUri) throws LiteralUtilException { if (isRecognizedDatatype(datatypeUri)) { if (literalValue == null) { throw new NullPointerException("Literal value cannot be null"); } // TODO: Implement verification return true; } throw new LiteralUtilException("Could not verify DBPedia literal"); }
@Override public boolean verifyDatatype(String literalValue, IRI datatypeUri) throws LiteralUtilException { if (isRecognizedDatatype(datatypeUri)) { if (literalValue == null) { throw new NullPointerException("Literal value cannot be null"); } // TODO: Implement verification return true; } throw new LiteralUtilException("Could not verify RDF builtin literal"); }
@Override public boolean verifyLanguage(String literalValue, String languageTag) throws LiteralUtilException { if (isRecognizedLanguage(languageTag)) { if (literalValue == null) { throw new NullPointerException("Literal value cannot be null"); } return matcher.matcher(languageTag).matches(); } throw new LiteralUtilException("Could not verify RFC3066 language tag"); }
@Override public Literal normalizeDatatype(String literalValue, IRI datatypeUri, ValueFactory valueFactory) throws LiteralUtilException { if (isRecognizedDatatype(datatypeUri)) { if (literalValue == null) { throw new NullPointerException("Literal value cannot be null"); } try { // TODO: Implement normalisation return valueFactory.createLiteral(literalValue, datatypeUri); } catch (IllegalArgumentException e) { throw new LiteralUtilException("Could not normalise RDF vocabulary defined literal", e); } } throw new LiteralUtilException("Could not normalise RDF vocabulary defined literal"); }
@Override public Literal normalizeLanguage(String literalValue, String languageTag, ValueFactory valueFactory) throws LiteralUtilException { if (isRecognizedLanguage(languageTag)) { if (literalValue == null) { throw new NullPointerException("Literal value cannot be null"); } // TODO Implement normalisation more effectively than this return valueFactory.createLiteral(literalValue, languageTag.toLowerCase().intern()); } throw new LiteralUtilException("Could not normalize RFC3066 language tag"); }
@Override public boolean verifyDatatype(String literalValue, IRI datatypeUri) throws LiteralUtilException { if (isRecognizedDatatype(datatypeUri)) { if(literalValue == null) { throw new NullPointerException("Literal value cannot be null"); } return XMLDatatypeUtil.isValidValue(literalValue, datatypeUri); } throw new LiteralUtilException("Could not verify XMLSchema literal"); }
@Override public Literal normalizeDatatype(String literalValue, IRI datatypeUri, ValueFactory valueFactory) throws LiteralUtilException { if (isRecognizedDatatype(datatypeUri)) { if (literalValue == null) { throw new NullPointerException("Literal value cannot be null"); } return valueFactory.createLiteral(literalValue, datatypeUri); } throw new LiteralUtilException("Could not normalise DBPedia literal"); }
@Override public Literal normalizeDatatype(String literalValue, IRI datatypeUri, ValueFactory valueFactory) throws LiteralUtilException { if (isRecognizedDatatype(datatypeUri)) { if (literalValue == null) { throw new NullPointerException("Literal value cannot be null"); } return valueFactory.createLiteral(literalValue, datatypeUri); } throw new LiteralUtilException("Could not normalise DBPedia literal"); }
@Override public Literal normalizeDatatype(String literalValue, IRI datatypeUri, ValueFactory valueFactory) throws LiteralUtilException { if (isRecognizedDatatype(datatypeUri)) { if(literalValue == null) { throw new NullPointerException("Literal value cannot be null"); } try { return valueFactory.createLiteral(XMLDatatypeUtil.normalize(literalValue, datatypeUri), datatypeUri); } catch (IllegalArgumentException e) { throw new LiteralUtilException("Could not normalise XMLSchema literal", e); } } throw new LiteralUtilException("Could not normalise XMLSchema literal"); }
throw new LiteralUtilException("Did not recognise datatype");
@Override public boolean verifyDatatype(String literalValue, IRI datatypeUri) throws LiteralUtilException { if (isRecognizedDatatype(datatypeUri)) { return verifyDatatypeInternal(literalValue, datatypeUri); } throw new LiteralUtilException("Could not verify Virtuoso Geometry literal"); }
@Override public Literal normalizeDatatype(String literalValue, IRI datatypeUri, ValueFactory valueFactory) throws LiteralUtilException { if (isRecognizedDatatype(datatypeUri) && verifyDatatypeInternal(literalValue, datatypeUri)) { // TODO: Implement normalization return valueFactory.createLiteral(literalValue, datatypeUri); } throw new LiteralUtilException("Could not normalise Virtuoso Geometry literal"); }
throw new LiteralUtilException("Did not recognise object when creating literal");