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
stringAccess a specific key-value in a dictionary.
numberAccess a specific position in an array.
[]Iterate over all keys of either an array or dictionary.
[*]stringIterate recursively over any deeper/nested keys that match the given string.
{"[]special(;special)": ""}Special Operations
containsKey:stringAccess array or dictionary only when it contains a specific key (recursive).
containsValue:stringAccess 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
: keyCollect the key-value instead of the value.
: emptyCollect the value also when empty.
: uniqueCollect unique values when the value consists of multiple values.
: jsonCollect 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.