Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support nested functions in the shortcut #190

Open
bjdmeest opened this issue Mar 14, 2023 · 0 comments
Open

Support nested functions in the shortcut #190

bjdmeest opened this issue Mar 14, 2023 · 0 comments

Comments

@bjdmeest
Copy link
Collaborator

Issue type: 🦄 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")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant