Resource Paths
Paths allow Linked Data Resources to traverse the raw output of any proper external source consistently. Each Path collects and prepares the data that is to be presented by a Linked Data Resource. 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.
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. |
: 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. Use a comma separated list with indexes to target a specific subset. |