jsonld.flatten()¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_
|
the JSON-LD input to flatten. |
required | |
ctx
|
Context | None
|
the JSON-LD context to compact with (default: None). |
None
|
options
|
FlattenOptions | None
|
optional processing options; see Options below. |
None
|
Returns:
| Type | Description |
|---|---|
|
the flattened JSON-LD output. |
Options¶
documentLoader
instance-attribute
¶
The document loader (default: the global default document loader).
extractAllScripts
instance-attribute
¶
True to extract all JSON-LD script elements from HTML, False to extract just the first (default: True).
processingMode
instance-attribute
¶
Either json-ld-1.0 or json-ld-1.1 (default: json-ld-1.1).
Example¶
Example flatten.py