Mindbreeze Property Expression Language

Help

Copyright ©

Mindbreeze GmbH, A-4020 Linz, 2017.

All rights reserved. All hardware and software names are brand names and/or trademarks of their respective manufacturers.

These documents are strictly confidential. The submission and presentation of these documents does not confer any rights to our software, our services and service outcomes or other protected rights.

The dissemination, publication or reproduction hereof is prohibited.

For ease of readability, gender differentiation has been waived. Corresponding terms and definitions apply within the meaning and intent of the equal treatment principle for both sexes.

IntroductionPermanent link for this heading

The property expression language can be used to extract metadata, or to create filter values that can then be limited in the search.

Language elementsPermanent link for this heading

LiteralPermanent link for this heading

Constant literal values such as numbers or strings can be specified.

Example:

String

"text"

Integer

3

Boolean value

true

IdentifiersPermanent link for this heading

An identifier always refers to the current context.

This context can be a document, but also an item.

If a reference is tracked, this refers to the referenced document.

Example:

Regular metadata of a document

title

Reference metadata of a document

referenz

Property within an item

itemProperty

ListsPermanent link for this heading

A list of several expressions, that are all emitted.

Example:

String

list("text1", "text2", "text3")

PathsPermanent link for this heading

If metadata of the referenced document should be accessed, the path operator / can be used.

Example:

Variant 1

reference/title

If the current document has a reference property "reference", the title of the referenced document is emitted

Variant 2

reference1/reference2/title

If the current document has a reference property "reference1", and the referenced document in turn has a reference property "reference2" that refers to another document, that title is emitted

FiltersPermanent link for this heading

The filter operator can be used to define additional constraints which must apply (normally for items) for selected expressions.

Example:

Variant 1

title[../mes:numericdate < 1444381468000]

The title of the current document will only be emitted if the date is prior to 2015-10-09T09:04:28.000Z (as milliseconds since 1970)

Comparison operatorsPermanent link for this heading

The following comparison operators may be used:

either in combination with logic operations

or within a filter

Examples in combination with logical operators:

Expression

What is emitted …

Equality

3 = 3 && "true" || "false"

"true"

Inequality

3 != 3 && "true" || "false"

"false"

Less than

3 < 3 && "true" || "false"

"false"

Less than or equal to

3 <= 3 && "true" || "false"

"true"

Greater than

3 > 3 && "true" || "false"

"false"

Greater than or equal to

3 >= 3 && "true" || "false"

"true"

Examples in combination with filter(s):

Expression

What is emitted …

Equality

title[3 = 3]

Title of the current document

Inequality

title[3 != 3]

Nothing

Less than

title[3 < 3]

Nothing

Less than or equal to

title[3 <= 3]

Title of the current document

Greater

title[3 > 3]

Nothing

Greater than or equal to

title[3 >= 3]

Title of the current document

Logical OperatorsPermanent link for this heading

AND operator &&Permanent link for this heading

In the AND operation, only the last item in the &&-chain is emitted, if and only when all previous elements have emitted something and their value is not interpreted as false.

Example:

Expression

What is emitted …

Literal 1

"text" && "text2" && "text3"

"text3"

Boolean expressions

0 && "text2"

nothing

1=1 && "true" || "false"

"true"

1!=1 && "true" || "false"

"false"

OR operator ||Permanent link for this heading

In the OR operator, the first element in the ||-chain is emitted || if and only when the element emits something.

Example:

Expression

What is emitted …

Literal 1

"text1" || "text2" || "text3"

"text1"

Boolean expressions

0 || "text2"

"text2"

0=0 && "true" || "text2"

"true"

Arithmetic operatorsPermanent link for this heading

The following arithmetic operators can be used:

Expressions

What is emitted …

Addition

+(3, 2)

5

Subtraction

-(3, 2)

1

Multiplication

*(3, 2)

6

Division

div(3, 2)

1

Modulo

mod(3, 2)

1

Parent contextPermanent link for this heading

The Parent-operator .. can be used to access the parent context.

This operator is particularly useful in combination with the filter operator, see chapter .

Example:

Variant 1

referenz/title/..

Corresponds to referenz

Variant 2

referenz/title/../..

Corresponds to the evaluated document itself

NamePermanent link for this heading

The function name can be used to deduce the name of the metadata item or the item property from a value context.

Example:

Variant 1

name(regex_match(title, "^T.*$"))

Title emitted, if the title of the current document matches the regular expression

StringsPermanent link for this heading

Regex matchPermanent link for this heading

The function regex_match can be used to restrict to those strings which correspond to a regular expression.

Example:

Variant 1

regex_match(title, "^T.*$")

Titles that begin with "T" are emitted (implicitly case sensitive)

Variant 2

regex_match(title, "^T.*$", "i")

Titles that begin with "T" are emitted (explicitly case insensitive)

Conversions to upper/lower casePermanent link for this heading

With the functions to_lower and to_upper, expressions can be converted to uppercase or lowercase.

Example:

Variant 1

to_lower("UPPER")

"upper" is emitted

to_upper("lower")

"LOWER" is emitted

String contexts (concat)Permanent link for this heading

The concat function connects multiple values from metadata.

Example:

concat("Hauptplatz", " ", "123")

"Hauptplatz 123" is emitted

Character replacementPermanent link for this heading

With the replace function, characters (character strings) can be replaced; when doing this, regular expressions can be used.

Example:

Removing letters

replace("12ab34cd56", "[a-z]", "")

"123456" is emitted

replace("0123456789","[0-9]{9}$","")

"0" is emitted

Type conversionsPermanent link for this heading

Conversion to an integerPermanent link for this heading

With the function int, a string or a date value can be converted to an integer.

Example:

Expression

What is emitted:

Variant 1

int("3")

Number 3

Variant 2

int(dateproperty)

Date value of the property "dateproperty" as milliseconds since 1970

Variant 3

int(now())

Current time as milliseconds since 1970

Splitting StringsPermanent link for this heading

With the function split(<string-expr>, <pattern>) a string can be convertetd to a list of Values.

Example:

Expression

What is emitted …

split("a,b and c", " *(and|,) *")

List: a,b,c

Parsing date valuesPermanent link for this heading

With the function parse_date, strings can be interpreted as a date value.

Parameters are:

String value to be parsed

Date formatting parameter, see http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax

(Optional) Locale, see http://userguide.icu-project.org/locale#TOC-Examples

Example:

Expression

What is emitted:

Variant 1

parse_date("1970-01-01 00:00:00 UTC", "YYYY-MM-dd HH:mm:ss zzz")

Corresponding date value

Variant 2

parse_date("October 2015", "MMMM y", "en")

Corresponding date value

Now (current time)Permanent link for this heading

The function now can be used to refer to the current time. The value is expressed in milliseconds since January 1, 1970, which is important in arithmetic expressions.

Example:

Expression

What is emitted:

Variant 1

now()

Current time

Variant 2

-(now(), 3600000)

Time one hour ago

Variant 3

mes:date[../mes:date < now()]

Date values of documents that are in the past

Variant 4

-(now(), dateproperty) > 3600000 && "true" || "false"

"true"

Given that the date value of the property "dateproperty" is older than one hour