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

termType rr:IRI in subjectMap #18

Open
simeonackermann opened this issue Dec 17, 2020 · 2 comments
Open

termType rr:IRI in subjectMap #18

simeonackermann opened this issue Dec 17, 2020 · 2 comments

Comments

@simeonackermann
Copy link

I'm trying to apply a YARRRML Condition in the subject. It should only create a subject on a specific condition, but the parser throws an ??? error from input-parser/parser.js. It seems the termType rr:IRI in subjectMaps are not (yet) supported?!

An example mapping to reproduce this error is:

prefixes:
  schema: "http://schema.org/"
  fn: "http://example.com/"
mappings:
  person:
    sources:
      - ['input~jsonpath', '$.persons[*]']
    s: http://example.com/$(firstname)
    condition:
      function: fn:isSet
      parameters:
        - [fn:input, $(public)]
    po:
      - [a, schema:Person]

Is there another way to apply conditions on subject generation?

@ThibaultGerrier
Copy link
Collaborator

Hello
Unfortunately yarrrml conditions are currently not supported. In RML they transform to nested functions, which aren't supported.
Only yarrrml join-conditions are supported (since they are a special condition case)

If the only condition you need is to check if a field is set you can use the json-path filter feature (see https://www.npmjs.com/package/jsonpath-plus for json-path examples)

With your current mapping:

prefixes:
  schema: "http://schema.org/"
  fn: "http://example.com/"
mappings:
  person:
    sources:
      - ['input~jsonpath', '$.persons[?(@.public)]']
    s: http://example.com/$(firstname)
    po:
      - [a, schema:Person]

will only process the persons where the public field is truthy. (so skip any persons with "public": false or without any public field)

@simeonackermann
Copy link
Author

Ok thanks, its not that clear like YARRRML subject conditions, but it will solve may problem.
Thanks again for your time and solution!!

Are their plans to implement nested functions? Does it make sense to leave this issue open?

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

2 participants