BaseXdb/basex] Packaging: Java and XQuery code (#1413)
Friday, 20 October 2017 · 1 message
TT
Tim Thompson20 Oct 2017 21:03 #
Christian, all,
The new "combined" packaging option (
https://github.com/BaseXdb/basex/issues/1413) seems like an interesting enhancement.
I have been working on my first BaseX repository module/package (though unfortunately I am not yet fluent in Java). It is working perfectly so far, but I wanted to be sure I was going about it correctly because it still seems a little like magic to me. I am also wondering whether this new feature is something I might want to take advantage of.
The module (https://github.com/timathom/basex-rdf) uses Günther Rademacher's REx Parser Generator[1] to create a Java parser for the RDF TriG/Turtle syntax[2], using the BaseX extension function option.
Following the BaseX documentation[3], I have created a XAR package that includes the JAR file and an XQuery wrapper. The wrapper calls the function exposed by the Java module (import module namespace trig =
"org.basex.modules.rdf.TriG";) and then processes the raw parse tree, overlaying some additional abstractions (I confess that I cheated and used XSLT for most of the processing functionality).
Because of the built-in BaseX extension function, this approach seems different from a straightforward "combined" module approach, but, again, I wanted to ask whether the way I'm doing this seems correct.
Thanks in advance.
Tim
[1] http://www.bottlecaps.de/rex/
[2] https://www.w3.org/TR/trig/
[3] docs.basex.org/wiki/Repository
--
Tim A. Thompson
Discovery Metadata Librarian
Yale University Library
Written for BaseX 8.6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery