Issue type: ❓ Question
Suppose we have a JSON object like the following:
{
"foo": "float",
"bar": "integer"
}
I would like to iterate over the members of this JSON object, to generate RDF statements like the following, based on the member name and value, a.k.a. key/value:
ex:foo a ex:SomeClass ; sh:datatype xsd:float .
ex:bar a ex:SomeClass ; sh:datatype xsd:integer .
Is there some way to do this with YARRRML?
I tried accessing the member names using $.*~, as in https://github.com/JSONPath-Plus/JSONPath, but that does not seem to work.
Actually I was hoping for some solution like this:
prefixes:
ex: "http://example.com/"
mappings:
structures:
sources:
- access: data.json
referenceFormulation: jsonpath
iterator: "$.*"
s: http://example.com/$(@.name)
po:
- [ a, ex:SomeClass ]
- [ sh:datatype http://www.w3.org/2001/XMLSchema-datatypes#$(@.value) ]
Note that I'm aware I could first transform the object to an array of objects like below, using some out-of-band mechanism, but that's not what I'm looking for.
[
{
"name": "foo",
"value": "float"
},
{
"name": "bar",
"value": "integer"
}
]
Issue type: ❓ Question
Suppose we have a JSON object like the following:
{ "foo": "float", "bar": "integer" }I would like to iterate over the members of this JSON object, to generate RDF statements like the following, based on the member name and value, a.k.a. key/value:
Is there some way to do this with YARRRML?
I tried accessing the member names using
$.*~, as in https://github.com/JSONPath-Plus/JSONPath, but that does not seem to work.Actually I was hoping for some solution like this:
Note that I'm aware I could first transform the object to an array of objects like below, using some out-of-band mechanism, but that's not what I'm looking for.
[ { "name": "foo", "value": "float" }, { "name": "bar", "value": "integer" } ]