Skip to content

pyld expand

Requires pip install PyLD[cli]

Expand a JSON-LD document.

pyld expand --help
Usage: pyld expand [OPTIONS] {INPUT}

Expand a JSON-LD document.

╭─ Arguments ──────────────────────────────────────────────────────────────────────────╮
* INPUT <str> Path or HTTP(S) URL. Pass - to read from standard input.
[required]
╰──────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────╮
--context -c <str> Context path or URL.
Pass - to read JSON from
standard input.
--base <str> The base IRI to use.
--extract-all-scripts --no-extract-all-scri… Extract all JSON-LD
script elements from
HTML, or just the first.
--help Show this message and
exit.
╰──────────────────────────────────────────────────────────────────────────────────────╯

Example

pyld expand docs/examples/data/person.jsonld[
{
"http://schema.org/name": [
{
"@value": "Ada Lovelace"
}
]
}
]

Source person.jsonld

{
  "@context": {
    "name": "http://schema.org/name"
  },
  "name": "Ada Lovelace"
}