Class DenodoDBFunctionSymbolFactory
- java.lang.Object
-
- it.unibz.inf.ontop.model.term.functionsymbol.db.impl.AbstractDBFunctionSymbolFactory
-
- it.unibz.inf.ontop.model.term.functionsymbol.db.impl.AbstractSQLDBFunctionSymbolFactory
-
- it.unibz.inf.ontop.model.term.functionsymbol.db.impl.DenodoDBFunctionSymbolFactory
-
- All Implemented Interfaces:
DBFunctionSymbolFactory
public class DenodoDBFunctionSymbolFactory extends AbstractSQLDBFunctionSymbolFactory
-
-
Field Summary
-
Fields inherited from class it.unibz.inf.ontop.model.term.functionsymbol.db.impl.AbstractSQLDBFunctionSymbolFactory
ABS_STR, abstractRootDBType, abstractRootType, ADD_STR, AND_STR, CEIL_STR, CHAR_LENGTH_STR, COALESCE_STR, CONCAT_OP_STR, CONCAT_STR, CURRENT_TIMESTAMP_STR, dbBooleanType, dbDecimalType, dbDoubleType, dbIntegerType, dbStringType, dbTypeFactory, DIVIDE_STR, FLOOR_STR, LCASE_STR, LENGTH_STR, LOWER_STR, MULTIPLY_STR, NOT_STR, NULLIF_STR, OR_STR, RAND_STR, REGEXP_LIKE_STR, REGEXP_REPLACE_STR, REPLACE_STR, RIGHT_STR, ROUND_STR, ST_ASTEXT, ST_CONTAINS, ST_CONTAINSPROPERLY, ST_COVEREDBY, ST_COVERS, ST_CROSSES, ST_DISJOINT, ST_DISTANCE, ST_DISTANCE_SPHERE, ST_DISTANCE_SPHEROID, ST_EQUALS, ST_FLIP_COORDINATES, ST_GEOMFROMTEXT, ST_INTERSECTS, ST_MAKEPOINT, ST_OVERLAPS, ST_SETSRID, ST_TOUCHES, ST_TRANSFORM, ST_WITHIN, SUBSTR_STR, SUBSTRING_STR, SUBTRACT_STR, typeFactory, UCASE_STR, UPPER_STR
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDenodoDBFunctionSymbolFactory(TypeFactory typeFactory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DBBooleanFunctionSymbolcreateDBBooleanCase(int arity, boolean doOrderingMatter)protected DBConcatFunctionSymbolcreateDBConcatOperator(int arity)protected DBIsTrueFunctionSymbolcreateDBIsTrue(DBTermType dbBooleanType)protected static it.unibz.inf.ontop.com.google.common.collect.ImmutableTable<String,Integer,DBFunctionSymbol>createDenodoRegularFunctionTable(TypeFactory typeFactory)protected DBConcatFunctionSymbolcreateNullRejectingDBConcat(int arity)protected DBConcatFunctionSymbolcreateRegularDBConcat(int arity)CONCAT regular function symbol, not an operator (like || or +)DBBooleanFunctionSymbolgetDBRegexpMatches2()Supported in the WHERE clause.DBBooleanFunctionSymbolgetDBRegexpMatches3()DBFunctionSymbolgetDBRegexpReplace3()DBFunctionSymbolgetDBRegexpReplace4()DBFunctionSymbolgetDBRight()DBBooleanFunctionSymbolgetDBStartsWith()DBFunctionSymbolgetDBSubString2()DBFunctionSymbolgetDBSubString3()protected StringgetUUIDNameInDialect()protected StringserializeContains(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)protected StringserializeDateTimeNorm(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)protected StringserializeDaysBetween(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)protected StringserializeHoursBetween(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)protected StringserializeMD5(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)protected StringserializeMillisBetween(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)protected StringserializeMinutesBetween(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)protected StringserializeSecondsBetween(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)protected StringserializeSHA1(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)protected StringserializeSHA256(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)protected StringserializeSHA512(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)protected StringserializeStrAfter(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)See serializeStrBefore() for the inconsistencies of the SUBSTRING functionsprotected StringserializeStrBefore(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)The documentation of Denodo does not correspond to the implementation.protected StringserializeTz(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)protected StringserializeWeeksBetween(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)Time extension - duration arithmetic-
Methods inherited from class it.unibz.inf.ontop.model.term.functionsymbol.db.impl.AbstractSQLDBFunctionSymbolFactory
createAbsFunctionSymbol, createAddOperator, createBooleanCoalesceFunctionSymbol, createBooleanDenormFunctionSymbol, createBooleanInequality, createBooleanNormFunctionSymbol, createCeilFunctionSymbol, createCoalesceFunctionSymbol, createDateInequality, createDateTimeDenormFunctionSymbol, createDatetimeInequality, createDateTimeNormFunctionSymbol, createDatetimeToDatetimeCastFunctionSymbol, createDBAnd, createDBAvg, createDBCase, createDBCount, createDBIfThenElse, createDBIsNotNull, createDBIsNull, createDBMax, createDBMin, createDBNotFunctionSymbol, createDBOr, createDBStrictEquality, createDBStrictNEquality, createDBSum, createDecimalToDecimalCastFunctionSymbol, createDecimalToStringCastFunctionSymbol, createDefaultCastToStringFunctionSymbol, createDefaultInequality, createDefaultRegularFunctionTable, createDivideOperator, createEncodeURLorIRI, createFloatDoubleToFloatDoubleCastFunctionSymbol, createFloatDoubleToStringCastFunctionSymbol, createFloorFunctionSymbol, createGeometryNormFunctionSymbol, createIntegerToIntegerCastFunctionSymbol, createIntegerToStringCastFunctionSymbol, createIsStringEmpty, createMultiplyOperator, createNonStrictDateEquality, createNonStrictDatetimeEquality, createNonStrictDefaultEquality, createNonStrictNumericEquality, createNonStrictStringEquality, createNumericInequality, createRegularBooleanFunctionSymbol, createRegularUntypedFunctionSymbol, createRoundFunctionSymbol, createSimpleCastFunctionSymbol, createSimpleCastFunctionSymbol, createStringInequality, createStringToStringCastFunctionSymbol, createSubtractOperator, createUntypedAddOperator, createUntypedDivideOperator, createUntypedMultiplyOperator, createUntypedSubtractOperator, getDBAnd, getDBAsText, getDBBoundary, getDBBuffer, getDBCharLength, getDBConcatOperator, getDBConvexHull, getDBDifference, getDBEnvelope, getDBGetSRID, getDBIfThenElse, getDBIntersection, getDBIsNotNull, getDBIsNull, getDBIsStringEmpty, getDBLower, getDBNow, getDBNullIf, getDBOr, getDBRand, getDBRelate, getDBRelateMatrix, getDBReplace, getDBSTContains, getDBSTContainsProperly, getDBSTCoveredBy, getDBSTCovers, getDBSTCrosses, getDBSTDisjoint, getDBSTDistance, getDBSTDistanceSphere, getDBSTDistanceSpheroid, getDBSTEquals, getDBSTFlipCoordinates, getDBSTGeomFromText, getDBSTIntersects, getDBSTMakePoint, getDBSTOverlaps, getDBSTSetSRID, getDBSTTouches, getDBSTTransform, getDBSTWithin, getDBSymDifference, getDBUnion, getDBUpper, getDBUUID, getIsTrue, getNullRejectingDBConcat, getRandNameInDialect, init, isAnd, isCoalesce, isConcat, isOr, serializeDay, serializeDayFromDate, serializeDayFromDatetime, serializeDaysBetweenFromDate, serializeDaysBetweenFromDateTime, serializeDBRowNumber, serializeHours, serializeMinutes, serializeMonth, serializeMonthFromDate, serializeMonthFromDatetime, serializeSeconds, serializeWeeksBetweenFromDate, serializeWeeksBetweenFromDateTime, serializeYear, serializeYearFromDate, serializeYearFromDatetime
-
Methods inherited from class it.unibz.inf.ontop.model.term.functionsymbol.db.impl.AbstractDBFunctionSymbolFactory
canonicalizeRegularFunctionSymbolName, createContainsFunctionSymbol, createCurrentDateTimeFunctionSymbol, createDayFromDateFunctionSymbol, createDayFromDatetimeFunctionSymbol, createDaysBetweenFromDateFunctionSymbol, createDaysBetweenFromDateTimeFunctionSymbol, createDBBinaryMathOperator, createDBBooleanIfElseNull, createDBCountTable, createDBGroupConcat, createDBIriStringResolver, createDBRowNumber, createDBRowUniqueStr, createDenormalizationTable, createExtractFunctionSymbol, createFalseOrNullFunctionSymbol, createHoursBetweenFromDateTimeFunctionSymbol, createHoursFunctionSymbol, createLikeFunctionSymbol, createMD5FunctionSymbol, createMillisBetweenFromDateTimeFunctionSymbol, createMinutesBetweenFromDateTimeFunctionSymbol, createMinutesFunctionSymbol, createMonthFromDateFunctionSymbol, createMonthFromDatetimeFunctionSymbol, createNormalizationTable, createRegularIfElseNull, createSecondsBetweenFromDateTimeFunctionSymbol, createSecondsFunctionSymbol, createSHA1FunctionSymbol, createSHA256FunctionSymbol, createSHA512FunctionSymbol, createSimilarToFunctionSymbol, createStrAfterFunctionSymbol, createStrBeforeFunctionSymbol, createStrEndsFunctionSymbol, createStrStartsFunctionSymbol, createTrueOrNullFunctionSymbol, createTypeNullFunctionSymbol, createTzFunctionSymbol, createUntypedDBBinaryMathOperator, createWeeksBetweenFromDateFunctionSymbol, createWeeksBetweenFromDateTimeFunctionSymbol, createYearFromDateFunctionSymbol, createYearFromDatetimeFunctionSymbol, getAbs, getBnodeStringTemplateFunctionSymbol, getCeil, getConversion2RDFLexicalFunctionSymbol, getConversionFromRDFLexical2DBFunctionSymbol, getCurrentDateTimeSymbol, getDBBooleanCase, getDBBooleanCoalesce, getDBBooleanIfElseNull, getDBBooleanInequality, getDBCase, getDBCastFunctionSymbol, getDBCastFunctionSymbol, getDBCoalesce, getDBContains, getDBCount, getDBDateInequality, getDBDatetimeInequality, getDBDayFromDate, getDBDayFromDatetime, getDBDaysBetweenFromDate, getDBDaysBetweenFromDateTime, getDBDefaultInequality, getDBEncodeForURI, getDBEndsWith, getDBHours, getDBHoursBetweenFromDateTime, getDBIfElseNull, getDBIntIndex, getDBIriStringResolver, getDBLike, getDBMathBinaryOperator, getDBMax, getDBMd5, getDBMillisBetweenFromDateTime, getDBMin, getDBMinutes, getDBMinutesBetweenFromDateTime, getDBMonthFromDate, getDBMonthFromDatetime, getDBNonStrictDateEquality, getDBNonStrictDatetimeEquality, getDBNonStrictDefaultEquality, getDBNonStrictNumericEquality, getDBNonStrictStringEquality, getDBNot, getDBNumericInequality, getDBRowNumber, getDBRowUniqueStr, getDBSeconds, getDBSecondsBetweenFromDateTime, getDBSha1, getDBSha256, getDBSha512, getDBSimilarTo, getDBStrAfter, getDBStrBefore, getDBStrictEquality, getDBStrictNEquality, getDBStringInequality, getDBSum, getDBTz, getDBWeeksBetweenFromDate, getDBWeeksBetweenFromDateTime, getDBYearFromDate, getDBYearFromDatetime, getExtractFunctionSymbol, getFalseOrNullFunctionSymbol, getFloor, getFreshBnodeStringTemplateFunctionSymbol, getIRIStringTemplateFunctionSymbol, getNullIgnoringDBAvg, getNullIgnoringDBGroupConcat, getNullIgnoringDBSum, getR2RMLIRISafeEncode, getRegularDBBooleanFunctionSymbol, getRegularDBFunctionSymbol, getRound, getTemporaryConversionToDBStringFunctionSymbol, getTrueOrNullFunctionSymbol, getTypedNullFunctionSymbol, getUntypedDBMathBinaryOperator, serializeCurrentDateTime, serializeDBRowUniqueStr, serializeExtract
-
-
-
-
Constructor Detail
-
DenodoDBFunctionSymbolFactory
@Inject protected DenodoDBFunctionSymbolFactory(TypeFactory typeFactory)
-
-
Method Detail
-
createDenodoRegularFunctionTable
protected static it.unibz.inf.ontop.com.google.common.collect.ImmutableTable<String,Integer,DBFunctionSymbol> createDenodoRegularFunctionTable(TypeFactory typeFactory)
-
getDBRight
public DBFunctionSymbol getDBRight()
- Specified by:
getDBRightin interfaceDBFunctionSymbolFactory- Overrides:
getDBRightin classAbstractSQLDBFunctionSymbolFactory
-
getDBStartsWith
public DBBooleanFunctionSymbol getDBStartsWith()
- Specified by:
getDBStartsWithin interfaceDBFunctionSymbolFactory- Overrides:
getDBStartsWithin classAbstractDBFunctionSymbolFactory
-
serializeStrBefore
protected String serializeStrBefore(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)
The documentation of Denodo does not correspond to the implementation. In particular: SUBSTR(1, 2) returns the first character of , whereas: SUBSTR( 0, 2) returns the two first character of . Instead, the documentation says that the third parameter ("2" here) should be the length of the returned value. It also says that indices start at 1 for SUBSTR and for POSITION. So: SUBSTR( 1, POSITION( IN )) should be the correct translation. But it returns one more (trailing) character than it should. And if instead we use: SUBSTR( 1, POSITION( IN ) - 1) then Denodo throws the exception: 'ERROR: negative substring length not allowed' There is also another function: SUBSTRING (
, , ) whose indices start at 0, and whose third parameter is the end index of the returned substring (excluded). So according to the documentation, the following should do the trick: SUBSTRING( , 0, POSITION( IN ) - 1) But again, Denodo throws the exception: 'ERROR: negative substring length not allowed' Instead, we get the desired output with: SUBSTR(
0, POSITION( IN )) which does not make much sense. - Specified by:
serializeStrBeforein classAbstractDBFunctionSymbolFactory
-
serializeStrAfter
protected String serializeStrAfter(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)
See serializeStrBefore() for the inconsistencies of the SUBSTRING functions- Specified by:
serializeStrAfterin classAbstractDBFunctionSymbolFactory
-
serializeMD5
protected String serializeMD5(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)
- Specified by:
serializeMD5in classAbstractDBFunctionSymbolFactory
-
serializeSHA1
protected String serializeSHA1(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)
- Specified by:
serializeSHA1in classAbstractDBFunctionSymbolFactory
-
serializeSHA256
protected String serializeSHA256(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)
- Specified by:
serializeSHA256in classAbstractDBFunctionSymbolFactory
-
serializeSHA512
protected String serializeSHA512(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)
- Specified by:
serializeSHA512in classAbstractDBFunctionSymbolFactory
-
serializeTz
protected String serializeTz(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)
- Specified by:
serializeTzin classAbstractDBFunctionSymbolFactory
-
createNullRejectingDBConcat
protected DBConcatFunctionSymbol createNullRejectingDBConcat(int arity)
- Specified by:
createNullRejectingDBConcatin classAbstractSQLDBFunctionSymbolFactory
-
createDBConcatOperator
protected DBConcatFunctionSymbol createDBConcatOperator(int arity)
- Specified by:
createDBConcatOperatorin classAbstractSQLDBFunctionSymbolFactory
-
createRegularDBConcat
protected DBConcatFunctionSymbol createRegularDBConcat(int arity)
Description copied from class:AbstractSQLDBFunctionSymbolFactoryCONCAT regular function symbol, not an operator (like || or +)- Specified by:
createRegularDBConcatin classAbstractSQLDBFunctionSymbolFactory
-
getUUIDNameInDialect
protected String getUUIDNameInDialect()
- Specified by:
getUUIDNameInDialectin classAbstractSQLDBFunctionSymbolFactory
-
getDBSubString2
public DBFunctionSymbol getDBSubString2()
- Specified by:
getDBSubString2in interfaceDBFunctionSymbolFactory- Overrides:
getDBSubString2in classAbstractSQLDBFunctionSymbolFactory
-
getDBSubString3
public DBFunctionSymbol getDBSubString3()
- Specified by:
getDBSubString3in interfaceDBFunctionSymbolFactory- Overrides:
getDBSubString3in classAbstractSQLDBFunctionSymbolFactory
-
serializeDateTimeNorm
protected String serializeDateTimeNorm(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)
- Specified by:
serializeDateTimeNormin classAbstractSQLDBFunctionSymbolFactory
-
serializeContains
protected String serializeContains(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)
- Specified by:
serializeContainsin classAbstractDBFunctionSymbolFactory
-
createDBIsTrue
protected DBIsTrueFunctionSymbol createDBIsTrue(DBTermType dbBooleanType)
- Overrides:
createDBIsTruein classAbstractSQLDBFunctionSymbolFactory
-
createDBBooleanCase
protected DBBooleanFunctionSymbol createDBBooleanCase(int arity, boolean doOrderingMatter)
- Overrides:
createDBBooleanCasein classAbstractSQLDBFunctionSymbolFactory
-
getDBRegexpMatches2
public DBBooleanFunctionSymbol getDBRegexpMatches2()
Supported in the WHERE clause. Fails in the SELECT clause (e.g. fails for unit test AbstractBindTestWithFunctions.testREGEX())- Specified by:
getDBRegexpMatches2in interfaceDBFunctionSymbolFactory- Overrides:
getDBRegexpMatches2in classAbstractSQLDBFunctionSymbolFactory
-
getDBRegexpMatches3
public DBBooleanFunctionSymbol getDBRegexpMatches3()
- Specified by:
getDBRegexpMatches3in interfaceDBFunctionSymbolFactory- Overrides:
getDBRegexpMatches3in classAbstractSQLDBFunctionSymbolFactory
-
getDBRegexpReplace3
public DBFunctionSymbol getDBRegexpReplace3()
- Specified by:
getDBRegexpReplace3in interfaceDBFunctionSymbolFactory- Overrides:
getDBRegexpReplace3in classAbstractSQLDBFunctionSymbolFactory
-
getDBRegexpReplace4
public DBFunctionSymbol getDBRegexpReplace4()
- Specified by:
getDBRegexpReplace4in interfaceDBFunctionSymbolFactory- Overrides:
getDBRegexpReplace4in classAbstractSQLDBFunctionSymbolFactory
-
serializeWeeksBetween
protected String serializeWeeksBetween(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)
Time extension - duration arithmetic- Overrides:
serializeWeeksBetweenin classAbstractSQLDBFunctionSymbolFactory
-
serializeDaysBetween
protected String serializeDaysBetween(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)
- Overrides:
serializeDaysBetweenin classAbstractSQLDBFunctionSymbolFactory
-
serializeHoursBetween
protected String serializeHoursBetween(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)
- Overrides:
serializeHoursBetweenin classAbstractSQLDBFunctionSymbolFactory
-
serializeMinutesBetween
protected String serializeMinutesBetween(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)
- Overrides:
serializeMinutesBetweenin classAbstractSQLDBFunctionSymbolFactory
-
serializeSecondsBetween
protected String serializeSecondsBetween(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)
- Overrides:
serializeSecondsBetweenin classAbstractSQLDBFunctionSymbolFactory
-
serializeMillisBetween
protected String serializeMillisBetween(it.unibz.inf.ontop.com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)
- Overrides:
serializeMillisBetweenin classAbstractSQLDBFunctionSymbolFactory
-
-