Resource Paths
Paths allow resources to traverse the raw output of any proper resource consistently. Each Path collects and prepares the data that is to be presented by a Linked Data Resource or Reversed Collection. For example, these Paths allow different Linked Data Resources to streamline their diverse and originally incompatible external sources. The syntax of a Path follows the baseline of JSON, but can also be formatted as YAML.
A Path can be defined as a single-source Path or a multi-source Path. Single-source Paths are Paths that output a value that represents a single source (i.e. represents a value for one 'Object').
{"entities": {"Q106079697": {"id": ""}}}
When a Resource outputs multiple sources (i.e. multiple 'Objects') a Path needs at least one iteration []
for it to group these sources. When multiple iterations are part of a Path, the first iteration will be the indicator for grouping to a source, the deeper/nested iterations will add to that initialised group.
{"entities": {"[]": {"id": ""}}}
Syntax
Elaborate example:
{
"Page": {
"TextRegion": {
"[]": {
"TextLine": {
"[*]Unicode": "join: "
}
}
}
}
}
Options
{"key": ""} | Description |
---|---|
string | Access a specific key-value in a dictionary. |
number | Access a specific position in an array. |
[] | Iterate over all keys of either an array or dictionary. |
[*]string | Iterate recursively over any deeper/nested keys that match the given string. |
{"[]special(;special)": ""} | Special Operations |
---|---|
containsKey:string | Access array or dictionary only when it contains a specific key (recursive). |
containsValue:string | Access array or dictionary only when it contains a specific value (recursive). |
{"": value} | Description |
---|---|
: {" | Access the dictionary at this position. |
: "" | Collect any value. |
: {} | Collect the dictionary. |
: [] | Collect the array. |
{"": "special(;special)"} | Special Operations |
---|---|
: key | Collect the key-value instead of the value. |
: empty | Collect the value also when empty. |
: unique | Collect unique values when the value consists of multiple values. |
: json | Collect the value and format the value as JSON. |
: join:? | Collect the value and join the values together as a string with a separator ? . |
: split:? | Collect the value and split the value into multiple values using a separator ? . |
{..., "key": ""} | Result Operations |
---|---|
< or <number(,number) | Perform special value operations (see table above for special operations for value) on the active result (collected) set. Every use of this operation will reset/clear the active result set. Use a comma separated list with indexes to target a specific subset. |
+ | Append a text value to the active result set. |
>key(,key) or >=key(,key) | Enable a special forward looking collection statement based on a specific key's value. By default collected values are appended to the result set. Using this option values can be collected to a specific group based on the key's value. The mode >= additionally groups all collected values to their specific key positions. |