[Yazlist] Metaproxy SPARQL module

Adam Dickmeiss adam at indexdata.dk
Mon Aug 17 15:20:36 UTC 2015



On 08/17/2015 03:45 PM, Tim Thompson wrote:
> Thanks for your helpful reply. I get the "Default" database error when 
> I try to run the demo app using the sample config-sparql.xml file 
> as-is, without any modifications. From my log:
>
> 09:25:44-17/08 5689 00e7fdf36b7f0000 [log] log ::ffff:127.0.0.1:2 
> <http://127.0.0.1:2> 2 0.000000 Z3950 initRequest - - 81 YAZ 5.14.5 
> 686414b0ac6446cd55610d5203d61a32672e2203
> 09:25:44-17/08 5689 00e7fdf36b7f0000 [log] log ::ffff:127.0.0.1:2 
> <http://127.0.0.1:2> 2 0.000167 Z3950 initResponse OK 81 sparql 
> 1.9.0/5.14.5 686414b0ac6446cd55610d5203d61a32672e2203
> 09:25:44-17/08 5689 00e7fdf36b7f0000 [log] log ::ffff:127.0.0.1:2 
> <http://127.0.0.1:2> 2 0.000000 Z3950 searchRequest Default default 
> XML RPN @attrset Bib-1 @attr 1=bf.wtitle @attr 5=100 @attr 6=1 @attr 
> 3=3 @attr 4=1 @attr 2=3 c
> 09:25:44-17/08 5689 00e7fdf36b7f0000 [log] log ::ffff:127.0.0.1:2 
> <http://127.0.0.1:2> 2 0.000123 Z3950 searchResponse Failure DIAG 235 
> "Default"
>
The triplestore.xml config does not offer a database called "Default". 
You'll have to add one or use query one the defined ones, eg "work".

What's the demo app? An example that needs fixing?

> Is there a filter or other setting that I need to add in order to run 
> the module with the sample config file?
>
> Regarding different RDF serializations, for mp-xquery, the 
> marc2bibframe XQuery module does offer a few non-XML serializations 
> out of the box. I tried enabling the ntriples serialzation and then in 
> SRU changed the recordPacking param to "string." This does give me the 
> n-triples as a string, but Metaproxy still outputs an XML declaration 
> and escapes all of the angle brackets. As a feature request, would it 
> be possible to output non-XML serializations as CDATA sections in 
> mp-xquery, so that they can then be parsed by an application?
Difficult. For now SRU results are XML only. So you must XML parse the 
result, then turn to actually inspecting record data, which might be 
JSON. If you use an XML parser, entities are of course, parsed out 
correctly.

>
> Regarding the RDF prefix, I noticed that the namespace URI in the 
> sample config file was lacking a "#" at the end, i.e., 
> http://www.w3.org/1999/02/22-rdf-syntax-ns#. I tried adding the hash 
> symbol to the prefix declaration, but in the XML SRU result document, 
> I see that the incorrect URI (without the "#") has been predeclared, 
> so I get both the correct and incorrect URI, e.g.:

> <zs:recordData>
>         <j.0:RDF xmlns:madsrdf="http://www.loc.gov/mads/rdf/v1#"
>           xmlns:j.0="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>           xmlns:relators="http://id.loc.gov/vocabulary/relators/"
>           xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns"
>           xmlns:bf="http://bibframe.org/vocab/" 
> xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
That's mp-xquery above?

If that's the case, I don't see where that NS is defined for mp-xquery.

I see it mentioned in zorba3-0.xqy .

For mp-sparql I see the namespace mentioned without hash and that needs 
fixing if the NS is incorrect.

/ Adam
> ...
> </zs:recordData>
>
>
> Thanks again,
>
> Tim
>
> --
> Tim A. Thompson
> Metadata Librarian (Spanish/Portuguese Specialty)
> Princeton University Library
>
>
> On Mon, Aug 17, 2015 at 4:29 AM, Adam Dickmeiss <adam at indexdata.dk 
> <mailto:adam at indexdata.dk>> wrote:
>
>     On 08/16/2015 06:04 AM, Tim Thompson wrote:
>>     Hello,
>>
>>     I have installed the Metaproxy SPARQL module and succeeded in
>>     running some queries against a locally installed triplestore
>>     (Fuseki). Disclaimer: this is my first time using Metaproxy, and
>>     my experience with Z39.50 and related technologies is limited.
>>     However, from what I've seen so far, I think that this and the
>>     companion MP-XQuery module certainly have the potential to help
>>     ease the transition from MARC to BIBFRAME.
>>
>>     The MP-XQuery module makes sense to me and "just works," but I'm
>>     still having trouble wrapping my head around MP-SPARQL. Reading
>>     the documentation, I have a few questions; specifically:
>     Yep. MP-XQuery is just a first implementation of XQuery conversion
>     for Metaproxy - similar to the record_transform that has XSLT. It
>     was of course driven by the marc2bibframe gitbub project. The most
>     challenging part was Zorba that does not exist as a package on
>     most platforms we use. Hence we created an idzorba package for
>     CentOS/Debian/Ubuntu.
>
>     mp-sparql OTOH is a much more difficult beast and it took quite a
>     while to figure out a way to configure this in a reasonable way.
>     The record model in Z39.50/SRU is just very different from a
>     Triplestore. We have to make different views for each type of
>     object we want to offer. So a Triplestore may offer many databases.
>>
>>     1. What is a "database" in the context of MP-SPARQL? The demo
>>     config file that ships with the module code contains several
>>     filters that refer to different databases ("thing," "smallindex,"
>>     etc.), but I don't understand whether these are actual databases
>>     or just ad-hoc handles for a particular filter.
>     In mp-sparql, a database is set of rules. The "thing" as you can
>     read from the comments, is not a real database. It is a section
>     that's included by others - so we don't have to repeat ourselves.
>     You'll see other "real" databases, such as "work", "place",
>     "instance", ..
>>
>>     When I start Metaproxy and try to reference one of these
>>     databases, I get an error for anything but the "Default" database.
>     I don't know your setup.. It might very well be that "Default"
>     goes to a different route etc.. If the Triplestore can not be
>     accessed, then a diagnostic is returned. Pure speculation from my
>     side. I don't know your configuration, the error message returned
>     or how you access it (SRU CQL, Z39.50+PQF, .. ).
>
>>
>>     2. What are the available values for the @schema attribute? The
>>     documentation references "sparql-results" and "rdf" (the latter
>>     returning RDF/XML). Does the MP-SPARQL module support content
>>     negotiation or any non-XML RDF serializations?
>     Not at the moment. There might be a future extentions that allows
>     to return JSON and other related serializations.
>>
>>     3. In the prefix element, the URI for the RDF namespace is
>>     provided, but the RDF/XML response that I get is returning a
>>     dummy prefix for RDF elements (Fuseki gives me j.0:RDF as the
>>     root element, for example). The BIBFRAME prefix resolves
>>     correctly. Any idea why this is happening?
>     Why Fuseki chose that prefix I don't know. It shouldn't matter as
>     long as it resolves to the same URI.
>
>     / Adam
>>
>>     Thank you in advance for your time.
>>
>>     Tim
>>
>>     --
>>     Tim A. Thompson
>>     Metadata Librarian (Spanish/Portuguese Specialty)
>>     Princeton University Library
>>     www.linkedin.com/in/timathompson
>>     <http://www.linkedin.com/in/timathompson>
>>
>>
>>
>>     _______________________________________________
>>     Yazlist mailing list
>>     Yazlist at lists.indexdata.dk  <mailto:Yazlist at lists.indexdata.dk>
>>     http://lists.indexdata.dk/cgi-bin/mailman/listinfo/yazlist
>
>
>     _______________________________________________
>     Yazlist mailing list
>     Yazlist at lists.indexdata.dk <mailto:Yazlist at lists.indexdata.dk>
>     http://lists.indexdata.dk/cgi-bin/mailman/listinfo/yazlist
>
>
>
>
> _______________________________________________
> Yazlist mailing list
> Yazlist at lists.indexdata.dk
> http://lists.indexdata.dk/cgi-bin/mailman/listinfo/yazlist

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.indexdata.dk/pipermail/yazlist/attachments/20150817/6d28062c/attachment-0001.html>


More information about the Yazlist mailing list