Skip to content

Can not convert #STRING to a NodeList! (using complex XPath expression in rml:reference) #12

Description

@pchampin

I'm trying to use complex XPath expressions as value of rml:reference, for example

  rml:objectMap [
    rml:reference "substring-before(path, '/')"
  ]

but this fails with the following exception:

javax.xml.xpath.XPathExpressionException: com.sun.org.apache.xpath.internal.XPathException: Can not convert #STRING to a NodeList!
at java.xml/com.sun.org.apache.xpath.internal.jaxp.XPathExpressionImpl.evaluate(XPathExpressionImpl.java:100)
at burp.ls.XMLIteration.getValuesFor(XMLSource.java:90)
at burp.model.Reference.values(Reference.java:17)
at burp.model.ExpressionMap.generateLiterals(ExpressionMap.java:156)
at burp.model.ObjectMap.generateTerms(ObjectMap.java:26)
at burp.Main.generate(Main.java:157)
at burp.Main.doMain(Main.java:55)
at burp.Main.main(Main.java:42)

My understanding is that the expression in rml:reference is expected to return a node list (such as what element/subelement or element/text() returns (a text node in the latter case)), but functions such as substring-before return a string, which is a different beast in XPath.

I consider this as a bug: using XPath functions to generate values seems like a valid use-case, a more lightweight approach than FNML. Also I note that this is working with RMLMapper (but I'm trying to migrate to BURP to use the latest version of RML).

edited to fix some typos and clarify some points (this was sent too quickly)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions