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

Allow XPath expressions in RML whose result is a string #128

Closed
IanEmmons opened this issue Jul 29, 2021 · 4 comments
Closed

Allow XPath expressions in RML whose result is a string #128

IanEmmons opened this issue Jul 29, 2021 · 4 comments
Assignees
Labels
bug Something isn't working next release The bug is fixed and the fix will be available in the next release.

Comments

@IanEmmons
Copy link

When translating an XML file, rml:reference properties in the RML have values that are XPath expressions. If such an XPath expression results in a node or a node-set, all is well. The mapper uses XPath's inherent ability to convert a node-set into a string and then uses that string in the RDF output. However, if the XPath result is of type string, the mapper fails because it is expecting a node-set. This is easily reproduced by wrapping an XPath expression in a string function, like so:

normalize-space(/my/xpath/expression/that/produces/a/node/set)

It would be helpful if the mapper would handle a string result as well as a node-set, because the functions available in XPath are fairly rich and can in many cases sidestep the need for RML function calls.

@DylanVanAssche DylanVanAssche added the enhancement New feature or request label Jul 29, 2021
@DylanVanAssche
Copy link
Contributor

Hi!

Thanks for reaching out!
Do you have a reproducible example with RML rules and some sample data to better understand this issue?
Thanks!

@IanEmmons
Copy link
Author

My examples are quite involved with many external dependencies, and therefore difficult to pass along. However, if you take any working example with an XML source, choose an rml:reference in it, and wrap that XPath expression with the normalize-space Path function, you will reproduce the problem.

@DylanVanAssche
Copy link
Contributor

I can now reproduce it and have a fix ready.
Will be available in the next release!

Thanks for your report!

@DylanVanAssche DylanVanAssche self-assigned this Oct 11, 2021
@DylanVanAssche DylanVanAssche added bug Something isn't working next release The bug is fixed and the fix will be available in the next release. and removed enhancement New feature or request labels Oct 11, 2021
@IanEmmons
Copy link
Author

Thanks, that will reduce the number of FNO function calls I need to make in my RML files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working next release The bug is fixed and the fix will be available in the next release.
Projects
None yet
Development

No branches or pull requests

2 participants