Hey Liam and BaseX Community,
With Liam's helpful pointers I was able to create a modification of the QueryBindExample.py sample script and use the String Template class to do the Python version of my machine learning dataset update XQuery expression for adding new training image specs to the #MAGAZINEgts ground-truth storage document in BaseX! :-)
Here is a link to this sandbox script: https://1drv.ms/u/s!AtML1v0eUlpEiJYTjUDhkFmDyXoK1A
The one "hinky" thing in using the String Template approach was the "double-take" bit where a string of the name of the XQuery variable, $new_spec in this case, is replaced by the Template variable, $query_var, so the Template substitution could "put back" the query's original variable as a string, '$new_spec', within the constructed XQuery expression to be submitted to BaseX. All the other Template substitution values hardcoded in this sandbox exploration script will simply be pulled from the advertisement bound box being ground-truthed once I work this query into the FactMiners Toolkit.
Thank you, Liam, those pointers had all the info I needed when put together with the supplied BaseX Python client API examples to move forward. :D
Happy-Healthy Vibes from Colorado USA, -: Jim :-
-----Original Message----- From: BaseX-Talk basex-talk-bounces@mailman.uni-konstanz.de On Behalf Of Jim Salmons Sent: Wednesday, April 10, 2019 8:30 PM To: 'Liam R. E. Quin' liam@fromoldbooks.org; basex-talk@mailman.uni-konstanz.de Subject: Re: [basex-talk] Nooby/#CitizenScientist REQUEST for HELP: Python implementation of this XQuery
Hi Liam,
Thank you! And not at all confusing in terms of babbleness.
Those links will certainly help with the nitty-gritty of creating the Python side of preparing the parameterized string of a new entry in the dataset. I will take your thoughts into account when trying to make a next step in this "solution discovery" process that I am on.
Still remaining is the basic "harness" of a Python-originated update transaction. I'm still trying to bridge the gap between all the fine-grained info of the Server Protocol page (http://docs.basex.org/wiki/Server_Protocol) and proper transformation of those bits into Python-submitted API calls. (I hope this makes sense.)
BTW, in the meantime, I have downloaded Christian Grun et al's 2012 awesome "A framework for retrieval and annotation in digital humanities using XQuery full text and update in BaseX" (PDF: https://ids-pub.bsz-bw.de/frontdoor/index/index/year/2015/docId/3715). I am digesting this incredible inspirational resource as fast as I can. :-)
-: Jim :-
[[[snip]]]