yarrrml-parser
yarrrml-parser copied to clipboard
Support nested functions in the shortcut
Issue type: :unicorn: Feature
Description
Support nested functions using the YARRRML shortcuts
Why it is useful
Shorter YARRRML
Existing features it breaks
None
below works
prefixes:
ex: "http://example.com/"
idlab-fn: http://example.com/idlab/function/
grel: http://users.ugent.be/~bjdmeest/function/grel.ttl#
mappings:
person:
sources:
- ['data.json~jsonpath', '$.persons[*]']
s: http://example.com/$(firstname)
po:
- [a, foaf:Person]
- p: ex:name
o:
function: grel:controls_if
parameters:
- parameter: grel:bool_b
value:
function: idlab-fn:equal
parameters:
- [grel:valueParameter, $(firstname)]
- [grel:valueParameter2, "John"]
- [grel:any_true, $(firstname)]
- [grel:any_false, "Jack"]
But the shortcut version doesn't work
prefixes:
ex: "http://example.com/"
idlab-fn: http://example.com/idlab/function/
grel: http://users.ugent.be/~bjdmeest/function/grel.ttl#
mappings:
person:
sources:
- ['data.json~jsonpath', '$.persons[*]']
s: http://example.com/$(firstname)
po:
- [a, foaf:Person]
- p: ex:name
o: grel:controls_if(grel:bool_b = idlab-fn:equal(grel:valueParameter = $(firstname), grel:valueParameter2 = "John"), grel:any_true = $(firstname), grel:any_false = "Jack")