os:JSONFunction
Constructs JSON via SPARQL JSON { ... } WHERE { ... } syntax.
Extends: os:SPARQLFunction
The JSON query format constructs a JSON object or array from SPARQL bindings.
### RDF Specification
### assuming `?subject` is provided as an initial solution...
[
a os:JSONFunction ;
os:fromJSON """
JSON { "name": ?name, "age": ?age } WHERE {
OPTIONAL { ?subject ex:name ?name . }
OPTIONAL { ?subject ex:age ?age . }
}
""" ;
]Properties
os:fromJSON (required, max 1)
SPARQL JSON query in format: JSON { ... } WHERE { ... }
JSONFunction must have exactly one fromJSON query using JSON DSL syntax.
Query executes with access to bindings from the execution context.