When I run this through the mapper, this is the output:
javax.xml.transform.TransformerException: Prefix must resolve to a namespace: xml
at java.xml/com.sun.org.apache.xpath.internal.compiler.XPathParser.error(XPathParser.java:621)
at java.xml/com.sun.org.apache.xpath.internal.compiler.Lexer.mapNSTokens(Lexer.java:637)
at java.xml/com.sun.org.apache.xpath.internal.compiler.Lexer.tokenize(Lexer.java:360)
at java.xml/com.sun.org.apache.xpath.internal.compiler.Lexer.tokenize(Lexer.java:99)
at java.xml/com.sun.org.apache.xpath.internal.compiler.XPathParser.initXPath(XPathParser.java:115)
at java.xml/com.sun.org.apache.xpath.internal.XPath.<init>(XPath.java:178)
at java.xml/com.sun.org.apache.xpath.internal.XPath.<init>(XPath.java:268)
at java.xml/com.sun.org.apache.xpath.internal.jaxp.XPathImpl.compile(XPathImpl.java:162)
at be.ugent.rml.records.XMLRecord.get(XMLRecord.java:49)
at be.ugent.rml.extractor.ReferenceExtractor.extract(ReferenceExtractor.java:31)
at be.ugent.rml.extractor.ReferenceExtractor.execute(ReferenceExtractor.java:41)
at be.ugent.rml.termgenerator.LiteralGenerator.lambda$generate$0(LiteralGenerator.java:67)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at be.ugent.rml.termgenerator.LiteralGenerator.generate(LiteralGenerator.java:63)
at be.ugent.rml.Executor.generatePredicateObjectGraphs(Executor.java:277)
at be.ugent.rml.Executor.executeWithFunctionV5(Executor.java:233)
at be.ugent.rml.Executor.executeV5(Executor.java:152)
at be.ugent.rml.cli.Main.main(Main.java:369)
at be.ugent.rml.cli.Main.main(Main.java:44)
--------------- linked to ------------------
javax.xml.xpath.XPathExpressionException: javax.xml.transform.TransformerException: Prefix must resolve to a namespace: xml
at java.xml/com.sun.org.apache.xpath.internal.jaxp.XPathImpl.compile(XPathImpl.java:170)
at be.ugent.rml.records.XMLRecord.get(XMLRecord.java:49)
at be.ugent.rml.extractor.ReferenceExtractor.extract(ReferenceExtractor.java:31)
at be.ugent.rml.extractor.ReferenceExtractor.execute(ReferenceExtractor.java:41)
at be.ugent.rml.termgenerator.LiteralGenerator.lambda$generate$0(LiteralGenerator.java:67)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at be.ugent.rml.termgenerator.LiteralGenerator.generate(LiteralGenerator.java:63)
at be.ugent.rml.Executor.generatePredicateObjectGraphs(Executor.java:277)
at be.ugent.rml.Executor.executeWithFunctionV5(Executor.java:233)
at be.ugent.rml.Executor.executeV5(Executor.java:152)
at be.ugent.rml.cli.Main.main(Main.java:369)
at be.ugent.rml.cli.Main.main(Main.java:44)
Caused by: javax.xml.transform.TransformerException: Prefix must resolve to a namespace: xml
at java.xml/com.sun.org.apache.xpath.internal.compiler.XPathParser.error(XPathParser.java:621)
at java.xml/com.sun.org.apache.xpath.internal.compiler.Lexer.mapNSTokens(Lexer.java:637)
at java.xml/com.sun.org.apache.xpath.internal.compiler.Lexer.tokenize(Lexer.java:360)
at java.xml/com.sun.org.apache.xpath.internal.compiler.Lexer.tokenize(Lexer.java:99)
at java.xml/com.sun.org.apache.xpath.internal.compiler.XPathParser.initXPath(XPathParser.java:115)
at java.xml/com.sun.org.apache.xpath.internal.XPath.<init>(XPath.java:178)
at java.xml/com.sun.org.apache.xpath.internal.XPath.<init>(XPath.java:268)
at java.xml/com.sun.org.apache.xpath.internal.jaxp.XPathImpl.compile(XPathImpl.java:162)
... 11 more
@prefix bf: <http://id.loc.gov/ontologies/bibframe/> .
<http://example.org/example> a bf:Work .
I thought this was strange, because the XML namespace according to W3C doesn't need to be declared, but the XPath parser used here is giving me an error. Sure enough, if I do declare the namespace:
And I keep the RML the same, I get my desired output:
@prefix bf: <http://id.loc.gov/ontologies/bibframe/> .
<http://example.org/example> a bf:Work;
bf:title "Zapiski iz mertvogo doma"@ru .
I guess I'm wondering if this is an RML Mapper issue, an issue with this particular XPath parser, or if we're just going to have to go through all of our data and declare that XML namespace even though we shouldn't have to... Any thoughts or suggestions?
Hello!
I'm having trouble writing maps for our prefixed XML, specifically when it comes to attributes with the prefix
xml:
.Here is a sample of our XML data:
Here is the RML map I have written:
When I run this through the mapper, this is the output:
I thought this was strange, because the XML namespace according to W3C doesn't need to be declared, but the XPath parser used here is giving me an error. Sure enough, if I do declare the namespace:
Modified XML data:
And I keep the RML the same, I get my desired output:
I guess I'm wondering if this is an RML Mapper issue, an issue with this particular XPath parser, or if we're just going to have to go through all of our data and declare that XML namespace even though we shouldn't have to... Any thoughts or suggestions?
Thanks in advance!