Hi Tim,
I have cloned your project again, and I have seen that you have already switched to the combined approach. Good to see that it works! So I think, for now, I won’t go deeper into the EXPath issues that you initially reported (feel free to bug me if you think I should ;-).
I got to the bottom of the 'parseTrigDoc(xs:string) cannot be called with (xs:string)' error. It turned out that streamable strings are based on a different Java class called StrStream (and not Str). Things don’t change if stream:materialize is called, as this function simply caches the result.
I’ll have some thought on how to treat (non-)streamable items identically. For now, you can simply bypass this restriction by using "String" instead of "Str" as arguments in your Java code.
Hope this helps, Christian
On Thu, Oct 26, 2017 at 1:16 AM, Tim Thompson timathom@gmail.com wrote:
Thanks, I did try stream:materialize, but that didn't seem to help. Regarding the "limitation" of the new combined approach, I think that may actually be a plus. In my case, it forced me to make my code a bit more modular.
Tim
-- Tim A. Thompson Discovery Metadata Librarian Yale University Library
On Wed, Oct 25, 2017 at 11:25 AM, Christian Grün christian.gruen@gmail.com wrote:
Hi Tim,
Thanks for the hint, and the intent to create a combined package for your code (our approach seems to be too limited indeed).
Once again my day was shorter than I expected, so I’ll do my best to check out your project tomorrow.
When I try to use the BaseX fetch:text function to retrieve an RDF text file and pass it to my combined module parser function, I get an error (in the the latest BaseX snapshot: beta a48337f): Function parseTrigDoc(xs:string) cannot be called with (xs:string).
My spontaneous guess is that fetch:text returns a “streamable” string (its contents will only be generated if they are requested), and our Java conversion mapping seem not be prepared to handle these types of strings. Actually they should be, so I’ll check how this can be fixed. In the meanwhile, you should be able to work around the restriction by explicitly requesting the string via stream:materialize(fetch:text(...)).
Hope this helps, Christian
[1] http://docs.basex.org/wiki/Fetch_Module#fetch:text [2] http://docs.basex.org/wiki/Streaming_Module