Skip to content

pyld compact

pyld compact --help
 Usage: pyld compact [OPTIONS] [INPUT_]                                         

 Compact a *-LD document.                                                      

╭─ Arguments ──────────────────────────────────────────────────────────────────╮
│   input_      [INPUT_]  Path or URL. Omit to read from standard input.       │
│                         [default: None]                                      │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --ctx                                        TEXT         Context to compact │
│                                                           with.              │
│                                                           [default: None]    │
│ --output-format                              [json|yaml]  Format to output   │
│                                                           the data at.       │
│                                                           [default: json]    │
│ --base                                       TEXT         Base URL.          │
│                                                           [default: None]    │
│ --extract-all-scri…    --no-extract-all-…                 Extract all        │
│                                                           documents in YAML  │
│                                                           stream, or all     │
│                                                           scripts embedded   │
│                                                           in HTML.           │
│                                                           [default:          │
│                                                           extract-all-scrip… │
│ --expand-context                             TEXT         Context to expand  │
│                                                           with.              │
│                                                           [default: None]    │
│ --help                                                    Show this message  │
│                                                           and exit.          │
╰──────────────────────────────────────────────────────────────────────────────╯

Example

pyld compact docs/examples/pythagorean-theorem.yamlld --output-format yaml
'@id': https://dbpedia.org/page/Pythagorean_theorem
http://www.w3.org/ns/prov#Entity:
  https://math.namespace/equal:
  - https://math.namespace/add:
    - https://math.namespace/squared: variable:a
    - https://math.namespace/squared: variable:b
  - https://math.namespace/squared: variable:c