@Override public boolean isRecognizedDatatype(IRI datatypeUri) { if (datatypeUri == null) { throw new NullPointerException("Datatype URI cannot be null"); } return org.eclipse.rdf4j.model.vocabulary.RDF.LANGSTRING.equals(datatypeUri) || org.eclipse.rdf4j.model.vocabulary.RDF.XMLLITERAL.equals(datatypeUri) || org.eclipse.rdf4j.model.vocabulary.RDF.HTML.equals(datatypeUri); }
@Override public boolean isRecognizedDatatype(IRI datatypeUri) { if (datatypeUri == null) { throw new NullPointerException("Datatype URI cannot be null"); } return org.eclipse.rdf4j.model.vocabulary.RDF.LANGSTRING.equals(datatypeUri) || org.eclipse.rdf4j.model.vocabulary.RDF.XMLLITERAL.equals(datatypeUri) || org.eclipse.rdf4j.model.vocabulary.RDF.HTML.equals(datatypeUri); }
@Override public boolean isRecognizedDatatype(IRI datatypeUri) { if (datatypeUri == null) { throw new NullPointerException("Datatype URI cannot be null"); } return VIRTRDF_GEOMETRY.equals(datatypeUri); }
@Override public boolean isRecognizedDatatype(IRI datatypeUri) { if (datatypeUri == null) { throw new NullPointerException("Datatype URI cannot be null"); } return VIRTRDF_GEOMETRY.equals(datatypeUri); }
/** * Checks whether the supplied datatype is equal to xsd:decimal or one of the built-in datatypes that is * derived from xsd:decimal. */ public static boolean isDecimalDatatype(IRI datatype) { return datatype.equals(XMLSchema.DECIMAL) || isIntegerDatatype(datatype); }
@Override public void statementRemoved(Statement st) { if (RDFS.SUBCLASSOF.equals(st.getPredicate())) { resetClasses(); } } }
/** * Checks whether the supplied literal is a "simple literal". A "simple literal" is a literal with no * language tag and the datatype {@link XMLSchema#STRING}. * * @see <a href="http://www.w3.org/TR/sparql11-query/#simple_literal">SPARQL Simple Literal * Documentation</a> */ public static boolean isSimpleLiteral(Literal l) { return !Literals.isLanguageLiteral(l) && l.getDatatype().equals(XMLSchema.STRING); }
@Override public void statementAdded(Statement st) { if (RDFS.SUBCLASSOF.equals(st.getPredicate()) && st.getObject() instanceof Resource) { resetClasses(); } }
@Override public void statementAdded(Statement st) { if (RDFS.SUBCLASSOF.equals(st.getPredicate()) && st.getObject() instanceof Resource) { resetClasses(); } }
private Instant convertToInstant(Literal literal) { String stringVal = literal.getLabel(); IRI dataType = literal.getDatatype(); checkArgument(dataType.equals(XMLSchema.DATETIME) || dataType.equals(XMLSchema.DATE), String.format("Invalid data type for date time. Data Type must be of type %s or %s .", XMLSchema.DATETIME, XMLSchema.DATE)); checkArgument(XMLDatatypeUtil.isValidDateTime(stringVal) || XMLDatatypeUtil.isValidDate(stringVal), "Invalid date time value."); return literal.calendarValue().toGregorianCalendar().toInstant(); }
/** * Checks whether the supplied literal is a "string literal". A "string literal" is either a simple * literal, a plain literal with language tag, or a literal with datatype xsd:string. * * @see <a href="http://www.w3.org/TR/sparql11-query/#func-string">SPARQL Functions on Strings * Documentation</a> */ public static boolean isStringLiteral(Literal l) { IRI datatype = l.getDatatype(); return Literals.isLanguageLiteral(l) || datatype.equals(XMLSchema.STRING); }
/** * Checks whether the supplied literal is a "string literal". A "string literal" is either a simple * literal, a plain literal with language tag, or a literal with datatype xsd:string. * * @see <a href="http://www.w3.org/TR/sparql11-query/#func-string">SPARQL Functions on Strings * Documentation</a> */ public static boolean isStringLiteral(Literal l) { IRI datatype = l.getDatatype(); return Literals.isLanguageLiteral(l) || datatype.equals(XMLSchema.STRING); }
private static boolean isSupportedDatatype(IRI datatype) { return (XMLSchema.STRING.equals(datatype) || XMLDatatypeUtil.isNumericDatatype(datatype) || XMLDatatypeUtil.isCalendarDatatype(datatype)); } }
@Override public boolean accepts(KBStatement aStatement, KBProperty aProperty) { if (aStatement.getValue() == null) { return false; } IRI iri = DefaultDatatypeMapper.getDatatypeURI((aStatement.getValue()).getClass()); return iri != null && XMLSchema.BOOLEAN.equals(iri); }
private byte[] literal2legacy(Literal literal) throws IOException { IRI dt = literal.getDatatype(); if (XMLSchema.STRING.equals(dt) || RDF.LANGSTRING.equals(dt)) return literal2data(literal.getLabel(), literal.getLanguage(), null, false); return literal2data(literal.getLabel(), literal.getLanguage(), dt, false); }
@Override protected boolean accept(Statement st) { //de-duplicate triples if (st.getSubject().equals(lastSubj) && st.getPredicate().equals(lastPred) && st.getObject().equals(lastObj)) { return false; } else { lastSubj = st.getSubject(); lastPred = st.getPredicate(); lastObj = st.getObject(); return true; } }
private byte[] literal2legacy(Literal literal) throws IOException { IRI dt = literal.getDatatype(); if (XMLSchema.STRING.equals(dt) || RDF.LANGSTRING.equals(dt)) return literal2data(literal.getLabel(), literal.getLanguage(), null, false); return literal2data(literal.getLabel(), literal.getLanguage(), dt, false); }