Presentation is loading. Please wait.

Presentation is loading. Please wait.

CQL – a Common Query LanguageMike Taylor Implementing SRW/U and CQL: Tools 1. Implementing a simple SRU client 2. Implementing serious SRW and SRU clients.

Similar presentations


Presentation on theme: "CQL – a Common Query LanguageMike Taylor Implementing SRW/U and CQL: Tools 1. Implementing a simple SRU client 2. Implementing serious SRW and SRU clients."— Presentation transcript:

1 CQL – a Common Query LanguageMike Taylor Implementing SRW/U and CQL: Tools 1. Implementing a simple SRU client 2. Implementing serious SRW and SRU clients 3. Implementing SRW and SRU servers 4. Implementing CQL

2 CQL – a Common Query LanguageMike Taylor Implementing a simple SRU client Query: First record: Number of records: Schema: MarcXML Dublin Core MODS

3 CQL – a Common Query LanguageMike Taylor Implementing serious SRW/U clients There are three basic approaches: 1. Hand-roll SRU URLs or SRW SOAP packets. 2. Use a SOAP toolkit with the SRW WSDL. 3. Use an SRW/U client toolkit.

4 CQL – a Common Query LanguageMike Taylor Implementing serious SRW/U clients There are three basic approaches: 1. Hand-roll SRU URLs or SRW SOAP packets. 2. Use a SOAP toolkit with the SRW WSDL. (There are far too many acronyms in these approaches) 3. Use an SRW/U client toolkit. You don't need me to tell you how to build URLs, and I couldn't tell you about SOAP toolkits if I wanted to. So we will concentrate on SRW/U client toolkits.

5 CQL – a Common Query LanguageMike Taylor SRW/U client toolkits: ZOOM ZOOM is a standard abstract API for information retrieval. It was originally conceived to lower the barrier to Z Many of the ZOOM implementations in high-level languages are built on top of Index Data's ZOOM-C implementation (C++, Visual Basic, Scheme, Ruby, C# and all.NET languages) Since ZOOM-C can now speak SRW/U as well as Z39.50, all these free IR-client toolkits inherit this ability.

6 CQL – a Common Query LanguageMike Taylor ZOOM examples: C++ #include #include "zoom.hh" using namespace ZOOM; int main (int argc, char **argv) { connection conn ("http://z3950.loc.gov:7090/voyager); resultSet rs (conn, simpleQuery ("isbn= ")); const record &rec = rs.getRecord (0); cout << rec.render () << endl; }

7 CQL – a Common Query LanguageMike Taylor ZOOM examples: Visual Basic Set zoom = WScript.CreateObject("VBZOOM.ZoomFactory") Set zconn = zoom.CreateZoomConnection( "http://z3950.loc.gov:7090/voyager) Set zquery = 1= ") Set zrs = zconn.Search(zquery) WScript.Echo zrs.GetRecord(0).RenderRecord

8 (define main (lambda (args) (let ((conn (zoom:connection_new "http://z3950.loc.gov:7090/Voyager" 0))) (let* ((r (zoom:connection_search_pqf conn 1= ")) (rec (zoom:record_get (zoom:resultset_record r 0) "render"))) (if (pair? rec) (display (car rec))) 0))) ) CQL – a Common Query LanguageMike Taylor ZOOM examples: Scheme

9 WEIRD CQL – a Common Query LanguageMike Taylor ZOOM examples: Scheme (define main (lambda (args) (let ((conn (zoom:connection_new "http://z3950.loc.gov:7090/Voyager" 0))) (let* ((r (zoom:connection_search_pqf conn 1= ")) (rec (zoom:record_get (zoom:resultset_record r 0) "render"))) (if (pair? rec) (display (car rec))) 0))) )

10 CQL – a Common Query LanguageMike Taylor Implementing SRW/U servers I only know of two dedicated SRW/U server toolkits: * Our own Generic Frontend Server (GFS), found in the YAZ toolkit (http://indexdata.com/yaz) * OCLC's Open Source SRW Java classes. Most SRW/U server implementations seem to use SOAP toolkits such as Apache Axis. Once a toolkit handles the marshalling, the most complex part of implementing SRW/U is the query handling.

11 CQL – a Common Query LanguageMike Taylor Implementing CQL Implementing CQL consists of two separate parts: 1. Parsing the query string into a simple representations 2. Executing that representation against your back-end Free parsers are available for Java, C/C++, Python, Perl and Visual Basic. See These produce trees of objects in their respective languages, each object representing a node of the parse-tree, e.g. an index-relation-term triple or an AND of two subtrees. (But no toolkit can help you with the second of these tasks, as it depends on what your back-end is.)

12 CQL – a Common Query LanguageMike Taylor What to take away * It's trivially easy to write an SRU client as an HTML form. * ZOOM provides free toolkits for creating clients in many languages. * The YAZ Generic Front-end Server, and the OCLC Open Source SRW classes, help to build clients. * SOAP toolkits can be used (but don't ask me for support). * Free CQL implementations are available for many languages.


Download ppt "CQL – a Common Query LanguageMike Taylor Implementing SRW/U and CQL: Tools 1. Implementing a simple SRU client 2. Implementing serious SRW and SRU clients."

Similar presentations


Ads by Google