Summary
When a YarrrML mapping includes XPath contains(., "…") inside a $(...) expression, the generated RML is invalid. The parser drops the closing ) from contains(...), which causes RMLMapper to fail with
expected ")" found "<eof>".
Environment
- OS: macOS (darwin)
- Node: v22.21.0
- yarrrml-parser: @rmlio/yarrrml-parser@1.12.1
- RMLMapper: v8.1.0
YarrrML input (minimal)
prefixes:
schema: 'http://schema.org/'
mappings:
review:
sources:
- [__XHTML__~xpath, '/']
s: ex:review~iri
po:
- [schema:positiveNotes, '$(/html/body//h3[contains(., "Pros")]/following::ul[1]/li/span)']
Actual RML output (snippet)
:om_008 a rr:ObjectMap;
rr:template "{/html/body//h3[contains(., \"Pros\"}]/following::ul[1]/li/span)";
rr:termType rr:Literal.
Note the missing closing ) in contains(...).
Expected RML output
:om_008 a rr:ObjectMap;
rr:template "{/html/body//h3[contains(., \"Pros\")]/following::ul[1]/li/span)";
rr:termType rr:Literal.
Impact
RMLMapper fails on the generated RML with:
java.lang.IllegalArgumentException: expected ")", found "<eof>"
and no output is produced.
Repro steps
- Run:
npx @rmlio/yarrrml-parser -i mapping.yarrrml -o mapping.ttl
- Inspect mapping.ttl for malformed contains(...).
- Run RMLMapper:
java -jar rmlmapper.jar -m mapping.ttl -o out.nq
-> fails with the error above.
Additional notes
The issue reproduces with other contains(., "…") expressions and appears only inside $(...) XPath expressions.
Summary
When a YarrrML mapping includes XPath
contains(., "…")inside a$(...)expression, the generated RML is invalid. The parser drops the closing)fromcontains(...), which causes RMLMapper to fail withexpected ")" found "<eof>".Environment
YarrrML input (minimal)
Actual RML output (snippet)
Note the missing closing ) in contains(...).
Expected RML output
Impact
RMLMapper fails on the generated RML with:
and no output is produced.
Repro steps
-> fails with the error above.
Additional notes
The issue reproduces with other contains(., "…") expressions and appears only inside $(...) XPath expressions.