List of Available Functions

General Functionality

  • A triple will not be generated if the subject or object is provided will a NULL value.

  • Strings passed into functions may be sourced from

    • References (The entire value of a field in the source document)

    • Templates (A string that includes values of fields in the source document, as well as manually specified strings)

    • Outputs from other Functions (Functions may therefore be nested)

Prefixes

In order to make use of the below functions, you must include the following prefixes in your mapping files:

@prefix fnml: <http://semweb.mmlab.be/ns/fnml#> .
@prefix fno: <https://w3id.org/function/ontology#> .
@prefix grel: <http://users.ugent.be/~bjdmeest/function/grel.ttl#> .

Custom Graph.Build Functions

ifEqual

  • Description: If a value equals and expected value, return if else that

  • Required Parameters:

    • Input - Input text

    • String1 - Value to be equal to

    • String2 - If equal return this value

    • String3 - If not equal return this value

  • Returns: String3 if input equals String1, otherwise return String2

toPascalCase

  • Description: Returns as value as PascalCase

  • Required Parameters:

    • Input - Input text

  • Returns: Input as PascalCase

toCamelCase

  • Description: Returns as value as camelCase

  • Required Parameters:

    • Input - Input text

  • Returns: Input as camelCase

toKebabCase

  • Description: Returns as value as kebab-case

  • Required Parameters:

    • Input - Input text

  • Returns: Input as kebab-case

toScreamingSnakeCase

  • Description: Returns as value as SCREAMING_SNAKE_CASE

  • Required Parameters:

    • Input - Input text

  • Returns: Input as SCREAMING_SNAKE_CASE

toSnakeCase

  • Description: Returns as value as snake_case

  • Required Parameters:

    • Input - Input text

  • Returns: Input as snake_case

unixEpochConverter

  • Description: Reads a long representing unix time to xsd:date

  • Required Parameters:

    • Input - Input text

    • String1 - days, seconds, milliseconds (default)

  • Returns: a unix time conversion

existsThen

  • Description: Takes an input value and if it is not null, return the output value

  • Required Parameters:

    • Input - Input text

    • String1 - value to return when not null

  • Returns: String1 when not null, otherwise null

removeEqualValues

  • Description: Returns NULL if Input is equal to any of the values in String1

  • Use Case: Don’t generate a triple if the value in the source data is ‘None’ or N/A

  • Required Parameters:

    • Input - Input text

    • String1 - Delimited list of values

  • Returns: Input or NULL

findAndReplace

  • Description: Find part or all of the first input value from a list of regex, provided by the second input of comma separated values, and replace with its respective value from the third input of comma separated values

  • Use Case: Remove undesirable values from within field data.

  • Expects:

    • Input - Input text

    • String1 - Regex find values

    • String2 - Regex replace values

  • Returns: Input, where matched values from String1 are replaced with corresponding values from String2

removeAllDoubleQuotes

  • Description: Returns the input with all double quotes removed

  • Use Case: Remove unnecessary double quotation marks from within field data.

  • Expects:

    • Input- Input text

  • Returns: Input with all double quotation marks have been removed.

translateToISODate

  • Description: Allows valid xsd:date values to be generated from non ISO standard date formats.

  • Use Case: The source data provides a date, but it’s not in xsd:date format.

  • Expects:

    • YearString - Delimited list containing

      • Input - Input text

      • StartPosition - Which position to start from, relative to the beginning on the Input text

      • CharacterCount - Number of characters after the StartPosition to extract

      • Prefix -2 digit prefix to add to extracted 2 character date, to make a 4 character date.

    • MonthString - Delimited list containing

      • Input - Input text

      • StartPosition - Which position to start from, relative to the beginning on the Input text

      • CharacterCount - Number of characters after the StartPosition to extract

    • DayString - Delimited list containing

      • Input - Input text

      • StartPosition - Which position to start from, relative to the beginning on the Input text

      • CharacterCount - Number of characters after the StartPosition to extract

  • Returns: Date in the format YYYY-MM-DD

extractCharactersFromEnd

  • Description: Extract a configurable number of characters from within a provided string, relative to the end of the string.

  • Use Case: You only want the last 5 characters from a provided string.

  • Expects:

    • Input - Input text

    • String1 - Which position to start from, relative to the end on the Input text (0 being the last character)

    • String2 - Number of characters prior to the position in String1 to extract

  • Returns: A slice of characters from the input text or NULL

extractCharactersFromStart

  • Description: Extract a configurable number of characters from within a provided string, relative to the beginning of the string.

  • Use Case: You only want the first 5 characters from a provided string.

  • Expects:

    • Input - Input text

    • String1 - Which position to start from, relative to the beginning of the Input text (0 being the first character)

    • String2 - Number of characters after the position in String1 to extract

  • Returns: A slice of characters from the input text or NULL

retrieveValueFromDelimitedList

  • Description: Extracts a specified value from a provided delimited list.

  • Use Case:

  • Expects:

    • Input - Input delimited list

    • String1 - Value used as the delimiter

    • String2 - Which element from the delimited list to return

  • Returns: An element extract from the Input list, or NULL

toUpperCase

  • Description: Converts a provided string to UPPERCASE

  • Use Case:

  • Expects:

    • Input

  • Returns: Input, in UPPERCASE

toLowerCase

  • Description: Converts a provided string to lowercase

  • Use Case:

  • Expects:

    • Input

  • Returns: Input, in lowercase

concat

  • Description: Combines 2 provided strings, into 1 string

  • Use Case:

  • Expects:

    • Input1

    • Input2

  • Returns: Input1Input2

random

  • Description: Returns a randomly generated UUID

  • Use Case:

  • Expects: None

  • Returns: A randomly generated UUID

toUpperCaseURL

  • Description: Ensures that a provided string is a URL, and converts it to one if it isn’t (Prepends HTTP:// where necessary),

  • Use Case:

  • Expects:

    • Input

  • Returns: Input1 in UPPERCASE converted to a URL

More Built-in Functions

DBpedia Spotlight annotate

Returns the DBpedia URLs of the detected entities in the input text

Function IRI: http://example.com/idlab/function/dbpediaSpotlight

Read local file as string

Returns the content of a local file as string

Function IRI: http://example.com/idlab/function/readFile

True condition

Returns the value if the given boolean is true, else null

Function IRI: http://example.com/idlab/function/trueCondition

and

and

Function IRI: http://users.ugent.be/~bjdmeest/function/grel.ttl#boolean_and

chomp

chomp

Function IRI: http://users.ugent.be/~bjdmeest/function/grel.ttl#string_chomp

contains

contains

Function IRI: http://users.ugent.be/~bjdmeest/function/grel.ttl#string_contains

decide

Returns a given value if input is equal to another given value

Function IRI: http://example.com/idlab/function/decide

endsWith

endsWith

Function IRI: http://users.ugent.be/~bjdmeest/function/grel.ttl#string_endsWith

equal

Returns true if strings are equal.

Function IRI: http://example.com/idlab/function/equal

escape

Escapes a string, with a mode parameter.

Function IRI: http://users.ugent.be/~bjdmeest/function/grel.ttl#escape

getMIMEType

Returns the MIME Type of a filename

Function IRI: http://example.com/idlab/function/getMIMEType

if

if

Function IRI: http://users.ugent.be/~bjdmeest/function/grel.ttl#controls_if

inRange

Returns whether a value is in range

Function IRI: http://example.com/idlab/function/inRange

indexOf

indexOf

Function IRI: http://users.ugent.be/~bjdmeest/function/grel.ttl#string_indexOf

join

join

Function IRI: http://users.ugent.be/~bjdmeest/function/grel.ttl#array_join

length

length

Function IRI: http://users.ugent.be/~bjdmeest/function/grel.ttl#string_length

listContainsElement

Returns true if the string is found in the list

Function IRI: http://example.com/idlab/function/listContainsElement

mqlKeyUnquote

mqlKeyUnquote

Function IRI: http://users.ugent.be/~bjdmeest/function/grel.ttl#string_mqlKeyUnquote

not

not

Function IRI: http://users.ugent.be/~bjdmeest/function/grel.ttl#boolean_not

not equal

Returns true if strings are not equal.

Function IRI: http://example.com/idlab/function/notEqual

or

or

Function IRI: http://users.ugent.be/~bjdmeest/function/grel.ttl#boolean_or

random

Returns a random uuid.

Function IRI: http://example.com/idlab/function/random

This function does not take any arguments.

split

split

Function IRI: http://users.ugent.be/~bjdmeest/function/grel.ttl#string_split

startsWith

startsWith

Function IRI: http://users.ugent.be/~bjdmeest/function/grel.ttl#string_startsWith

stringContainsOtherString

Returns true if a string is found in a delimited string.

Function IRI: http://example.com/idlab/function/stringContainsOtherString

substring

substring

Function IRI: http://users.ugent.be/~bjdmeest/function/grel.ttl#string_substring

toLowercase

Returns the input with all letters in lower case.

Function IRI: http://users.ugent.be/~bjdmeest/function/grel.ttl#toLowerCase

toUppercase

Returns the input with all letters in upper case.

Function IRI: http://users.ugent.be/~bjdmeest/function/grel.ttl#toUpperCase

Label

IRI

toTitlecase

toTitlecase

Function IRI: http://users.ugent.be/~bjdmeest/function/grel.ttl#string_toTitlecase

toUpperCaseURL

Returns an uppercase, valid url.

Function IRI: http://example.com/idlab/function/toUpperCaseURL

trim

trim

Function IRI: http://users.ugent.be/~bjdmeest/function/grel.ttl#string_trim

xor

xor

Function IRI: http://users.ugent.be/~bjdmeest/function/grel.ttl#boolean_xor

Last updated