Previous topic  Top  Next topic  Print this Topic
 

Built-ins

 

In this chapter you find all of the OntoBroker built-ins with their syntax, a short description, their parameters and bindings. In the Bindings-column "b" means that it must be bound and "f" that the argument must be free, usually as a variable.

Name

Arity

Description

Parameters

Bindings

"_abs"

2

absolute double value

["input","absolute value"]

bf;fb;bb;

"_absDecimal"

2

absolute decimal value

["input","absolute value"]

bf;fb;bb;

"_activeCollaborationUsers"

3

returns active collaboration users and their hostname for a module

["module","user","hostname"]

fff;bff;fbf;bbf;ffb;bfb;fbb;bbb;fff;

"_activeSessions"

4

returns active sessions

["sessionid","type","user","hostname"]

b;

"_add"

3

adds numbers using double arithmetic or durations to date/times

["summand","summand","sum"]

bbf;bfb;fbb;bbb;

"_addDecimal"

3

adds numbers using decimal arithmetic

["summand","summand","sum"]

bf;fb;bb;

"_aggregations"

4

returns all available aggregations

["name","number of input variables","description","input variables"]

 

"_append"

3

appends second to first list

["first list","second list","merged list"]

 

"_applyStringTemplate"

4

applies string template to the variable bindings

["template","options","varBindings","output"]

bbbf;bbb;

"_bound"

1

Tests if input is bound (i.e. equals NULL value).

["variable"]

 

"_builtins"

4

Returns all available built-ins

["name","arity","description","list of parameter names"]

 

"_ceiling"

2

Returns the smallest (closest to negative infinity) value that is less than or equal to the argument and is equal to a mathematical integer

["number","mathematical integer (double or decimal)"]

bf;bb;

"_charAt"

3

char at position

["string","position","result"]

bbf;bbb;

"_computeexplicit"

3

transformation plug-ins for mapping tool

["transformation","f(name,var)","result"]

 

"_concat"

3

concatenate two strings

["first string","second string","result"]

 

 

bbf;bfb;fbb;bbb;

"_concepts"

2

return concepts

["concept","module"]

ff;bf;fb;bb;ff;

"_connectors"

4

returns all available connectors

["name","arity","description","list of parameter names"]

 

"_constraintByID"

3

returns constraint text for given ID

["module","constraintID","ruleText"]

bff;bbf;bfb;gbb;

"_constraintContainsTerm"

3

returns aiomxIDs for which the term is contained in the constraint formula

["module","term","constraintID"]

 

 

bbf;bbb;

"_contains"

2

first string/list contains second string/list

["string/list","string/list"]

bb;

"_containsN"

2

first string/list contains second string/list

["string/list","string/list"]

bb;

"_containsTerm"

2

is term contained in another term (functional term)

["term","containedTerm"]

bb;

"_currentDateTime"

1

returns the current date time

["currentDatetime"]

f;b;

"_currentUser"

1

returns current login user as IRI (and only if config parameter Security.AccessControl = on)

["user"]

 

 

f;b;f;

"_cut"

3

Returns a substring of the string-object truncated by the number of characters specified in the method argument. Truncation takes place on the right.

["content","offset","result"]

 

 

bbf;bbb;

"_datatype"

2

Gets the data type IRI of typed literals, xsd:string for untyped literals, fails otherwise.

["value","datatype"]

 

"_day"

2

returns day

["date/datetime","day (integer)"]

 

"_days"

2

returns days

["duration","days (integer)"]

bf;bb;

"_diffAt"

3

compares two strings and returns the position of the first not matching character

["content","input","positionOfFirstDiffence"]

 

 

bbf;bbb;

"_difference"

3

Creates difference of two maps

["map1","map2","result map"]

 

"_ebv"

1

Generates the effective boolean value.

["value"]

 

"_endsWith"

2

first string/list ends with second string/list

["string/list","string/list"]

 

 

bb;

"_equals"

2

equals comparison (left == right)

["left","right"]

bb;

"_false"

0

always returns false

Example:
?- _'false'. // single quotes needed as false is keyword in ObjectLogic

[]

 

"_fill"

4

fill String with n-times of the other string

["baseString","fillString","timesToFill","resultString"]

 

 

bbbf;bbbb;

"_filter"

2

filters values

["variable","right"]

bb;

"_filterN"

2

filters values

["variable","right"]

 

 

bb;

"_filterdups"

2

stores the list and is true if list is not a duplicate

["variable instantiations","provenance list"]

 

"_firstIndexOf"

3

returns first occurance of the second string/item within the first string/list

["content","part","listOfPositions"]

 

 

bbf;bbb;

"_flatten"

2

flattens a list of lists into a flat list and eliminates duplicates

["list of lists","flatted list"]

 

"_floor"

2

Returns the largest (closest to positive infinity) value that is less than or equal to the argument and is equal to a mathematical integer

["number","mathematical integer (double or decimal)"]

 

 

bf;bb;

"_fractionalSecond"

2

returns fractional second

["time/datetime","fractional second (decimal or null)"]

bf;bb;

"_fragment"

2

returns fragment of IRI

["iri","fragment string"]

 

 

bf;bb;

"_generateExplanationRuleText"

4

generates explanation rule text for given ruleId and template

["module","ruleId","template","output"]

bbbf;bbbb;

"_generateExplanationTemplate"

4

generates explanation template for given ruleId

["module","ruleId","templategroup","output"]

 

 

bbbf;bbbb;

"_geoDistance"

3

Calculation of distance between two geographic coordinates in kilometer.

["coordinate1 [geoCoordinate]","coordinate2 [geoCoordinate]","distance in kilometer [double]"]

 

"_greaterOrEquals"

2

greater than or equals comparison (left >= right)

["left","right"]

bb;

"_greaterOrEqualsN"

2

greater than or equals comparison (left >= right)

["left","right"]

bb;

"_greaterThan"

2

greater than comparison (left > right)

["left","right"]

bb;

"_greaterThanN"

2

greater than comparison (left > right)

["left","right"]

 

 

bb,

"_hasForeignRole"

1

checks if current user has given foreign role. Roles from the SecurityModuleAuthorizationRealm are not checked. This is only relevant if access control is enabled.

["role"]

 

 

b;

"_host"

2

returns host of IRI

["iri","host string"]

 

 

bf;bb;

"_hour"

2

returns hour

["time/datetime","hour (integer)"]

 

"_hours"

2

returns hours

["duration","hours (integer)"]

 

 

bf;bb;

"_indexOf"

3

returns sorted list of offsets from the second string within the first

["content","part","listOfPositions"]

 

 

bbf;bbb;

"_info"

2

Retrieve information about OntoBroker. Currently \version\ and \fullVersion\ are supported

["key","info"]

 

"_integer2iri"

3

converts between integer and IRI

["integer","iri prefix","iri"]

 

"_intersection"

3

Creates intersection of two maps

["map1","map2","result map"]

 

"_isBlank"

1

Tests if input is a blank node.

["value"]

 

"_isConstraint"

2

true if given id is a constraint

["module","constraintID"]

bf;bb;

"_isCustomPermitted"

2

checks if current user has custom permission for module. This is only relevant is access control is enabled.

["module","customPermission"]

 

"_isDatatype"

1

checks if object is a data type

["typename"]

b;

"_isIRI"

1

Tests if input is an IRI.

["value"]

 

"_isLiteral"

1

Tests if input is a RDF literal.

["value"]

 

"_isModulePermitted"

2

checks if current user has access right for module. This is only relevant is access control is enabled.

["module","accessRight"]

bb;

"_isNull"

1

checks if object is the null value

["term"]

 

 

b;

"_isPermitted"

1

checks if current user has given permission. This is only relevant is access control is enabled.

["permission"]

 

 

b;

"_isPropertyPermitted"

2

checks if current user has access right for property. This is only relevant is access control is enabled.

["property","accessRight"]

 

"_isQuery"

2

true if given id is a query

["module","queryID"]

bf;bb;

"_isRule"

2

true if given id is a rule

["module","ruleID"]

 

 

bf;bb;

"_isTypeOf"

2

checks if object is of given type

["typename","object"]

 

 

fb;bb;

"_isequal"

2

X is equal Y

["X","Y"]

 

 

bb;

"_lang"

2

Gets the language of a RDF literal, if not available it returns an empty plain literal.

["literal","language"]

 

"_langMatches"

2

Language range matching as defined in RFC4647 section 3.3.1.

["language","filter"]

 

"_language"

2

Returns language part of plain literal

["plain literal","language"]

 

 

bf;bb;

"_lastIndexOf"

3

returns last occurance of the second string/item within the first string/list

["content","part","listOfPositions"]

bbf;bbb;

"_latitude"

2

Get the latitude of a geographical coordinate.

["coordinate [geoCoordinate]","latitude [double]"]

 

"_length"

2

returns the length of a string or list

["string/list","length"]

 

 

bf;bb;

"_lessOrEquals"

2

less than or equals comparison (left <= right)

["left","right"]

 

 

bb;

"_lessOrEqualsN"

2

less than or equals comparison (left <= right)

["left","right"]

 

 

bb;

"_lessThan"

2

less than comparison (left < right)

["left","right"]

 

 

bb;

"_lessThanN"

2

less than comparison (left < right)

["left","right"]

 

 

bb;

"_localName"

2

returns local name of IRI

["iri","local name"]

 

 

bf;bb;

"_loginUser"

2

returns login user and hostname

["user","hostname"]

ff;bf;fb;bb;ff;

"_longitude"

2

Get the longitude of a geographical coordinate.

["coordinate [geoCoordinate]","longitude [double]"]

 

"_map2table"

4

Converts maps to flat table

["map","path string","position","result value"]

 

"_match"

2

Y matches X

["X","Y"]

 

"_match"

3

The string in the first argument is matched with the regular expression in the second argument. The result (third argument) of the method is a list of terms of the form match(matchingPosition,matchingSubstring), which represents matches inside the object-string. The list is sorted in the ascending order of positions of the matches. The counting of positions in the object string starts with 0.

["content","input","variable"]

 

 

bbf;bbb;

"_member"

2

_list[*=> _member(_object)]. Binding: bb. The method's argument and the list-object may not be fully ground. In this case, the method succeeds, if the argument to the method unifies with a member of the list.

["list","object"]

 

 

bf;bb;

"_memberAt"

3

The value of the method is the object that occurs in the list object at the position given by the argument to the method

["list","index","value"]

 

 

bff;bbf;bfb;bbb;

"_memberByPath"

3

Filters with xpath expression

["map","path string","result value"]

 

"_metrics"

1

returns metrics about the ontology manager

["metrics"]

 

 

f;b;f;

"_minute"

2

returns minute

["time/datetime","minute (integer)"]

 

"_minutes"

2

returns minutes

["duration","minutes (integer)"]

 

 

bf;bb;

"_modules"

1

returns the available modules

["modules"]

 

 

f;b;f;

"_month"

2

returns month

["date/datetime","month (integer)"]

 

"_months"

2

returns months

["duration","months (integer)"]

 

 

bf;bb;

"_multiply"

3

multiplies numbers using double arithmetic

["factor","factor","product"]

 

 

bbf;bfb;fbb;bbb;

"_multiplyDecimal"

3

multiplies numbers using decimal arithmetic

["factor","factor","product"]

 

 

bbf;bfb;fbb;bbb;

"_namespace"

2

returns namespace of IRI

["iri","namespace"]

 

 

bf;bb;

"_negate"

2

negates a duration

["duration","duration"]

bf; fb; bb;

"_newInstance"

5

creates a new instance of the given classname and assigns instance reference

["module","classname","object","children","instance"]

bbbbf;bbbbb;

"_normalize"

2

Normalize order of key/value pairs for _map input or normalize to UTC timezone for _dateTime, _date or _time input.

["input","normalized"]

bf;

"_normalizeWith"

3

Converts the years and months fields into the days field by using a specific dateTime/date instant as the reference point

["input (duration)","reference point (date or datetime)","result (duration)"]

bbf; bbb;

"_numberToNumber"

4

Converts between floating-point and fixed-point numbers.

["Type URI 1","Type URI 2","Numeric Value 1","Numeric Value 2"]

 

"_overlappedBy"

3

True if a suffix of the object string is also a prefix of the string given in the method's argument. The result of the method is the number of characters in the maximal overlap.

["suffixString","prefixstring","numberOfOverlappedChars"]

 

 

bbf;bbb;

"_path"

2

returns path of IRI

["iri","path string"]

bf;bb;

"_port"

2

returns explizit port of IRI

["iri","port integer"]

 

 

bf;bb;

"_prefices"

3

Returns prefix/namespace definitions per module

["module","prefix","namespace"]

bff;bbf;bfb;bbb;

"_properties"

2

return properties

["property","module"]

 

"_query"

2

returns query of IRI

["iri","query string"]

 

"_queryByID"

3

returns query text for given ID

["module","queryID","ruleText"]

bff;bbf;bfb;bbb;

"_queryContainsTerm"

3

returns queryIDs for which the term is contained in the query formula

["module","term","queryID"]

 

 

bbf;bbb;

"_queryInfo"

4

returns query text and additional information for given ID

["module","queryID","ruleText","info"]

 

"_regex"

3

Matches against a regular expression.

["value","regular expression","options"]

 

"_replace"

4

Replaces every occurrence of the regular expression inside the object string with the string given in the second argument of the method. The regular expression is given in the first argument.

["input string","regexp","input","result"]

 

 

bbbf;bbbb;

"_reverse"

2

reverses list/string

["list/string","reversed list/string"]

bf;fb;bb;

"_rootconcepts"

2

use the concept hierarchy to determine the root concepts

["concept","module"]

 

 

ff;bf;fb;bb;ff;

"_round"

2

rounds number

["number","rounded number"]

 

 

bf;bb;

"_ruleByID"

3

returns rule text for given ID

["module","ruleID","ruleText"]

bff;bbf;bfb;bbb;

"_ruleContainsTerm"

4

returns ruleIDs for which the term is contained either in rule head or body

["module","term","isHead","ruleID"]

 

 

bbff;bbbf;bbfb;bbbb;

"_ruleID2ExplanationRuleID"

2

returns transforms ruleID to/from ruleID of its explanation rule

["ruleID","ruleExplanationRuleID"]

 

"_ruleoutlogger"

1

prints input to console

["input"]

 

"_scheme"

2

returns scheme of IRI

["iri","scheme string"]

bf;bb;

"_second"

2

returns second

["time/datetime","second (integer)"]

 

"_seconds"

2

returns seconds

["duration","seconds (integer)"]

 

 

bf;bb;

"_sessionInfo"

1

returns information about session

["infoMap"]

 

"_sign"

2

returns sign

["duration","sign (integer)"]

 

 

bf;bb;

"_sort"

2

Returns sorted list

["list","sorted list"]

 

 

bf;bb;

"_split"

3

splits before the first character of regexp

["input string","regexp","variable"]

 

"_startsWith"

2

first string/list starts with second string/list

["string/list","string/list"]

 

 

bb;

"_startsWithN"

2

first string/list starts with second string/list

["string/list","string/list"]

 

 

bb;

"_statisticsIndex"

2

provides some statistics about an index

["module","statistics text"]

 

 

bf;

"_statusIndex"

2

provides up-to-date status for index

["module","status text"]

 

 

bf;bb;

"_str"

2

Returns the lexical form of a literal or the codepoint representation of an IRI.

["value","lexical form"]

 

"_stringToConstant"

3

converts a lexical value to a constant and backwards

["typename","lexical value","constant"]

 

"_subset"

2

true if first list contains all items of second list

["first list","second list"]

 

 

bb;

"_substring"

4

returns String.substring(start,end)

["content","start","end","substring"]

bbff;bbbf;bbfb;bbbb;

"_textValue"

2

Returns text part of plain literal

["plain literal","text string"]

 

"_timeInMilliseconds"

2

returns time in milliseconds since January 1, 1970 (Gregorian), midnight UTC

["datetime","milliseconds since January 1, 1970 (Gregorian), midnight UTC"]

 

 

bf;

"_toLower"

2

lower case of string

["string","lower string"]

 

 

bf;bb;

"_toObjectLogicString"

2

returns ObjectLogic representation

["object","ObjectLogic representation"]

 

 

bf;

"_toString"

2

returns string representation

["object","string representation"]

 

 

bf;bb;

"_toType"

3

returns new instance for given parameter

["typename","param1","object"]

 

 

bbf;bbb;

"_toType"

4

returns new instance for given parameters

["typename","param1","param2","object"]

bbbb; bbbf; bffb;bbfb; bfbb

"_toType"

5

returns new instance for given parameters

["typename","param1","param2","param3","object"]

bbff;bbbbf;bbbfb;bbbbb;

"_toType"

7

returns new instance for given parameters

["typename","param1","param2","param3","param4","param5","object"]

 

 

bbbbbbf;bbbbbbb;

"_toType"

8

returns new instance for given parameters

["typename","param1","param2","param3","param4","param5","param6","object"]

bbbbbbbf;bbbbbbbb;

"_toType"

9

returns new instance for given parameters

["typename","param1","param2","param3","param4","param5","param6","param7","object"]

bbbbbbbbf; bbbbbbbbb;

"_toType"

10

returns new instance for given parameters

["typename","param1","param2","param3","param4","param5","param6","param7","param8","object"]

 

 

bbbbbbbbbf;bbbbbbbbbb;

"_toUpper"

2

upper-case of string

["string","upper string"]

 

 

bf;bb;

"_tokenize"

3

Breaks the object-string into a list of tokens at every occurrence of any delimiter character given in the argument to the method (this argument is a string of delimeter characters). The delimiter characters are not retained as part of the tokens. For instance, 'xyzw.foo'[_tokenize('y.') -> [x,zw,foo]]

["input string","delim","token"]

 

 

bbf;bbb;

"_tokenizeRegExp"

3

splits before the first character of regexp

["input string","regexp","token"]

 

 

bbf;bbb;

"_totalOrderLessThan"

2

less than comparison (left < right) providing a total ordering for all terms

["left","right"]

 

 

bb;

"_trim"

3

Deletes from the object string all the leading and trailing characters specified in the argument to the method

["string","characters","result"]

 

 

bbf;bbb

"_true"

0

always returns true

?- _'true'. // single quotes needed as true is keyword in ObjectLogic

[]

 

"_typeName"

2

returns datatype of input

["object","typename"]

 

 

bf;bb;

"_unify"

2

Unifies first with second parameter

["left","right"]

 

 

bf;fb;bb;ff;

"_union"

3

Creates union of two maps

["map1","map2","result map"]

 

"_user"

2

returns user of IRI

["iri","user string"]

 

 

bf;bb;

"_workingDaysBetween"

3

Calculates the number of working days between two dates. Public holidays are not considered.

["startDate","endDate","durationInDays"]

bbf (calculate days)

bfb (calculate end date)

bbb (validate)

fbb (calculate start date)

"_write"

1

prints parameters

["X1"]

 

 

b;

"_write"

2

prints parameters

["X1","X2"]

 

 

b;b;

"_write"

3

prints parameters

["X1","X2","X3"]

 

 

b;b;b;

"_write"

4

prints parameters

["X1","X2","X3","X4"]

 

 

b;b;b;b;

"_write"

5

prints parameters

["X1","X2","X3","X4","X5"]

 

 

b;b;b;b;b;

"_write"

6

prints parameters

["X1","X2","X3","X4","X5","X6"]

b;b;b;b;b;b;

"_year"

2

returns year

["date/datetime","year (integer)"]

 

"_years"

2

returns years

["duration","years (integer)"]

 

 

bf;bb;

"_zoneHour"

2

returns zone hour (with sign)

["time/datetime","zone hour"]

bf;bb;

"_zoneMinute"

2

returns zone minute (with sign)

["time/datetime","zone minute"]

 

 

bf;bb;