private boolean isNumeric(Predicate pred) { return (pred instanceof DatatypePredicate) && (((DatatypePredicate) pred).getReturnedType() instanceof NumericRDFDatatype); }
private static boolean isXsdBoolean(Predicate predicate) { return (predicate instanceof DatatypePredicate) && ((DatatypePredicate) predicate).getReturnedType().isA(XSD.BOOLEAN); } }
private static boolean isXsdString(Predicate predicate) { return (predicate instanceof DatatypePredicate) && ((DatatypePredicate) predicate).getReturnedType().isA(XSD.STRING); }
private int getDataType(Term term) { /* * TODO: refactor! */ if (term instanceof Function){ Function f = (Function) term; Predicate p = f.getFunctionSymbol(); if (p instanceof DatatypePredicate) { RDFDatatype type = ((DatatypePredicate) p).getReturnedType(); return jdbcTypeMapper.getSQLType(type); } // return varchar for unknown return Types.VARCHAR; } else if (term instanceof Variable) { throw new RuntimeException("Cannot return the SQL type for: " + term); } /* * Boolean constant */ else if (term.equals(termFactory.getBooleanConstant(false)) || term.equals(termFactory.getBooleanConstant(true))) { return Types.BOOLEAN; } return Types.VARCHAR; }
private Expression convertOrCastIntoBooleanAtom(Function atom) { if (atom instanceof Expression) return (Expression) atom; Predicate predicate = atom.getFunctionSymbol(); if (predicate instanceof OperationPredicate) return termFactory.getExpression((OperationPredicate)predicate, atom.getTerms()); // XSD:BOOLEAN case if ((predicate instanceof DatatypePredicate) && ((DatatypePredicate) predicate).getReturnedType().isA(XSD.BOOLEAN)) { return termFactory.getExpression(ExpressionOperation.IS_TRUE, atom); } throw new IllegalArgumentException(atom + " is not a boolean atom"); }
return Optional.of(datatypeConstructionFunctionSymbol.getReturnedType());
RDFDatatype datatype = ((DatatypePredicate) predicate).getReturnedType();
RDFDatatype objectDatatype = ((DatatypePredicate) objectPred).getReturnedType(); Optional<LanguageTag> optionalLangTag = objectDatatype.getLanguageTag(); if (optionalLangTag.isPresent()) { obm.setTermType(R2RMLVocabulary.literal); RDFDatatype objectDatatype = ((DatatypePredicate) objectPred).getReturnedType(); Optional<LanguageTag> optionalLangTag = objectDatatype.getLanguageTag(); if (optionalLangTag.isPresent()) {
.map(t -> ((Function) t).getFunctionSymbol()) .filter(f -> f instanceof DatatypePredicate) .map(f -> ((DatatypePredicate) f).getReturnedType()) .flatMap(RDFDatatype::getLanguageTag) .map(LanguageTag::getFullString)