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

Parser error on predicate with function #178

Open
lpmeyer opened this issue Oct 24, 2022 · 0 comments
Open

Parser error on predicate with function #178

lpmeyer opened this issue Oct 24, 2022 · 0 comments

Comments

@lpmeyer
Copy link

lpmeyer commented Oct 24, 2022

Issue type: 🐛 Bug

Description

When defining a predicate mapping with a function, yarrrml produces the following parsing error:

TypeError: Cannot read property 'length' of undefined
    at /app/lib/rml-generator.js:89:47
    at Array.forEach (<anonymous>)
    at /app/lib/rml-generator.js:87:27
    at Array.forEach (<anonymous>)
    at /app/lib/rml-generator.js:80:34
    at Array.forEach (<anonymous>)
    at RMLGenerator.convertExpandedJSON (/app/lib/rml-generator.js:57:35)
    at RMLGenerator.convert (/app/lib/abstract-generator.js:81:17)
    at Object.<anonymous> (/app/bin/parser.js:106:23)
    at Module._compile (internal/modules/cjs/loader.js:999:30)

Steps

example yarrrml with a function in the predicate mapping:

---
prefixes:
  ex: http://example.com/
  grel: http://example.com/grel/

mappings:
  application:
    sources:
      - ['Application.csv~csv']
    po:
      - o: ex:numberOfApplications
        p:
          - function: grel:trim
            parameters:
              - [grel:valueParameter, $(Number of applications)]
            datatype: xsd:int

This mapping is an adapted version of test/datatype-on-function/mapping.yarrrml, just added a source definition and switched predicate and object.
This adapted mapping probably would not be usefull or correct, but I found it as a minimal test case for reproducing the error I get with a more complex mapping.

Environment

using yarrrml version 1.3.6 from container image docker.io/rmlio/yarrrml-parser

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