Re: [CODE4LIB] SRU/ZeeRex explain question : record schemas

2010-05-03 Thread Jonathan Rochkind

Thanks Ray, I believe it is!

A schema listed there is available for requesting with the 
recordSchema= parameter, yes? Cool, that's exactly what I was looking 
for.


Another question though. I note when looking up schemaInfo... I'm a bit 
confused by the sort attribute.  How could you sort by a schema? What 
is this attribute actually for? 


Jonathan

Ray Denenberg, Library of Congress wrote:

schemaInfo is what you're looking for I think.

Look at http://z3950.loc.gov:7090/voyager.

Line 74, for example,
schemaInfo
schema identifier=info:srw/schema/1/marcxml-v1.1 sort=false 
name=marcxml

titleMARCXML/title
/schema


Is this what you're looking for?

--Ray


- Original Message - 
From: Jonathan Rochkind rochk...@jhu.edu

To: CODE4LIB@LISTSERV.ND.EDU
Sent: Friday, April 30, 2010 3:57 PM
Subject: [CODE4LIB] SRU/ZeeRex explain question : record schemas


  

This page:
http://www.loc.gov/standards/sru/resources/schemas.html

says:

The Explain document lists the XML schemas for a given database in which 
records may be transferred. Every schemas is unambiguously identified by a 
URI and a server may assign a short name, which may or may not be the same 
as the short name listed in the table below (and may differ from the short 
name that another server assigns).



But perusing the SRU/ZeeRex Explain documentation I've been able to find, 
I've been unable to find WHERE in the Explain document this information is 
listed/advertised.


Can anyone clue me in? 



  


Re: [CODE4LIB] SRU/ZeeRex explain question : record schemas

2010-05-03 Thread Ray Denenberg, Library of Congress

From: Jonathan Rochkind rochk...@jhu.edu
Another question though. I note when looking up schemaInfo... I'm a bit 
confused by the sort attribute.  How could you sort by a schema? What is 
this attribute actually for?



Well indulge me, this is best explained by the current OASIS SRU draft.

(The current and earlier specs don't do a good job here. But for background 
if interested:  sorting as an SRU function was supported in SRU 1.1 and 
taken out of version 1.2, replaced by sorting as a function of the query 
language rather than the protocol. For the OASIS work it's in both.  For the 
current spec at LC, which reflects 1.2, the attribute doesn't even make 
sense. If you go back to the 1.1 archive it does. Still, the OASIS document 
treats it more clearly.)


See http://www.loc.gov/standards/sru/oasis/sru-2-0-draft-most-current.doc 
See section 9.1.


So essentially, when you sort in SRU, you provide an XPath expression.  The 
XPath expression is meaningful in the context of a schema, but the *record 
schema* may not be the most meaningful schema for purposes of sorting, there 
may be another schema more meaningful.  So, you have the capability to 
specify not only a record schema but an auxiliary sort schema.


A given schema that an Explain file lists will usually be one that is used 
as a record schema, but it may also be usable as a sort schema.   That's 
what the sort attribute tells you.


--Ray 


Re: [CODE4LIB] SRU/ZeeRex explain question : record schemas

2010-05-03 Thread Jonathan Rochkind

This makes some amount of sense, thanks.

I actually kind of liked the sorting as part of CQL in SRU 1.2.  I see 
how XPath sorting can be convenient too.


But you will leave sorting as part of CQL too in any changes to CQL 
specs, I hope?  I think CQL has a lot of use even outside of SRU proper, 
so I encourage you to leave it's spec not too tightly coupled to SRU. 

I think there are at least three ways to sort as part of (different 
versions of?) SRU now! 


1) An actual separate sortKeys query paramater
2) Included in the CQL expression in query, using the sortBy keyword.
3) In draft not finalized, OASIS/SRU 2.0 methods of specifying XPaths 
for sorting.  [Thanks for including the link to the current SRU 2.0 
draft, I didn't know that was publically available anywhere, it's not 
really googlable].


Do I have this right?  As SRU 1.2 is the only actual spec I have to work 
with... am I right that either top-level sortKeys, or embedded in CQL 
with sortBy would both be legal in SRU 1.2 (whether a given server 
supports one or both of them is a different question -- but they are 
both legal to spec, yes?).


I'd actually strongly encourage you to leave both of them as legal to 
spec in SRU 2.0, they make things much simpler to work with (although 
also less flexible; that's generally the trade-off) then requiring 
XPath's to be specified. Especially when a corpus being searched may 
include records in diverse and varied and inconsistent record schemas.


Jonathan

Ray Denenberg, Library of Congress wrote:

From: Jonathan Rochkind rochk...@jhu.edu
  
Another question though. I note when looking up schemaInfo... I'm a bit 
confused by the sort attribute.  How could you sort by a schema? What is 
this attribute actually for?




Well indulge me, this is best explained by the current OASIS SRU draft.

(The current and earlier specs don't do a good job here. But for background 
if interested:  sorting as an SRU function was supported in SRU 1.1 and 
taken out of version 1.2, replaced by sorting as a function of the query 
language rather than the protocol. For the OASIS work it's in both.  For the 
current spec at LC, which reflects 1.2, the attribute doesn't even make 
sense. If you go back to the 1.1 archive it does. Still, the OASIS document 
treats it more clearly.)


See http://www.loc.gov/standards/sru/oasis/sru-2-0-draft-most-current.doc 
See section 9.1.


So essentially, when you sort in SRU, you provide an XPath expression.  The 
XPath expression is meaningful in the context of a schema, but the *record 
schema* may not be the most meaningful schema for purposes of sorting, there 
may be another schema more meaningful.  So, you have the capability to 
specify not only a record schema but an auxiliary sort schema.


A given schema that an Explain file lists will usually be one that is used 
as a record schema, but it may also be usable as a sort schema.   That's 
what the sort attribute tells you.


--Ray 

  


Re: [CODE4LIB] SRU/ZeeRex explain question : record schemas

2010-05-03 Thread Ray Denenberg, Library of Congress

From: Jonathan Rochkind rochk...@jhu.edu

But you will leave sorting as part of CQL too in any changes to CQL specs, 
I hope?  I think CQL has a lot of use even outside of SRU proper, so I 
encourage you to leave it's spec not too tightly coupled to SRU.


The OASIS TC firmly supports this approach (and by firmly I mean 100%) so 
the only way this could get changed is via public comment.





I think there are at least three ways to sort as part of (different 
versions of?) SRU now!

1) An actual separate sortKeys query paramater
2) Included in the CQL expression in query, using the sortBy keyword.
3) In draft not finalized, OASIS/SRU 2.0 methods of specifying XPaths for 
sorting.  [Thanks for including the link to the current SRU 2.0 draft, I 
didn't know that was publically available anywhere, it's not really 
googlable].


As you corrected yourself in a subsequent message:

Ah, I think I was wrong below. I must have been looking at different 
versions of the SRU spec without realizing it.


SRU 1.1 includes a sortKeys parameter, and CQL 1.1 does not include a 
sortBy clause.


SRU 1.2 does NOT include a sortKeys parameter, and CQL 1.2 does include 
a sortBy clause.


Yes, that's correct.


Do I have this right?  As SRU 1.2 is the only actual spec I have to work 
with... am I right that either top-level sortKeys, or embedded in CQL 
with sortBy would both be legal in SRU 1.2
No. Legal in 2.0 - the OASIS version, not legal in 1.2.   In 1.2 it is not 
legal to have a sort parameter in the request.


OASIS is standardizing SRU and CQL loosely coupled that is, SRU can use 
other query languages and CQL may be invoked by other protocols, but they 
are generally oriented towards being used together.   But since SRU may be 
used with a query language that might not have sort capability, the TC felt 
it necessary to include sorting as part of the protocol. Conversely since 
CQL may be used by a protocol that doesn't support sorting, similarly CQL 
should support sorting. There is a section in the draft standard that 
discusses what to do if a request has conflicting sort specifications.


--Ray


[CODE4LIB] SRU/ZeeRex explain question : record schemas

2010-04-30 Thread Jonathan Rochkind
This page:
http://www.loc.gov/standards/sru/resources/schemas.html

says:

The Explain document lists the XML schemas for a given database in which 
records may be transferred. Every schemas is unambiguously identified by a URI 
and a server may assign a short name, which may or may not be the same as the 
short name listed in the table below (and may differ from the short name that 
another server assigns).


But perusing the SRU/ZeeRex Explain documentation I've been able to find, I've 
been unable to find WHERE in the Explain document this information is 
listed/advertised. 

Can anyone clue me in?


Re: [CODE4LIB] SRU/ZeeRex explain question : record schemas

2010-04-30 Thread Ray Denenberg, Library of Congress

schemaInfo is what you're looking for I think.

Look at http://z3950.loc.gov:7090/voyager.

Line 74, for example,
schemaInfo
schema identifier=info:srw/schema/1/marcxml-v1.1 sort=false 
name=marcxml

titleMARCXML/title
/schema


Is this what you're looking for?

--Ray


- Original Message - 
From: Jonathan Rochkind rochk...@jhu.edu

To: CODE4LIB@LISTSERV.ND.EDU
Sent: Friday, April 30, 2010 3:57 PM
Subject: [CODE4LIB] SRU/ZeeRex explain question : record schemas



This page:
http://www.loc.gov/standards/sru/resources/schemas.html

says:

The Explain document lists the XML schemas for a given database in which 
records may be transferred. Every schemas is unambiguously identified by a 
URI and a server may assign a short name, which may or may not be the same 
as the short name listed in the table below (and may differ from the short 
name that another server assigns).



But perusing the SRU/ZeeRex Explain documentation I've been able to find, 
I've been unable to find WHERE in the Explain document this information is 
listed/advertised.


Can anyone clue me in? 


Re: [CODE4LIB] SRU/ZeeRex explain question : record schemas

2010-04-30 Thread LeVan,Ralph
There's a schemaInfo element right under the explain element that
carries that data.

Here's a pointer to the Explain record for my LCNAF database.

http://alcme.oclc.org/srw/search/lcnaf

Don't let the browser fool you!  View the source and you'll see the
actual XML that was returned.  The schemaInfo element is towards the
bottom.

Ralph

p.s. For my LCNAF friends on the list, note the change to the database
element in the serverInfo section.  It now include the update date and
number of records in the database!  That's being automatically generated
by the SRW server.


 -Original Message-
 From: Code for Libraries [mailto:code4...@listserv.nd.edu] On Behalf
Of
 Jonathan Rochkind
 Sent: Friday, April 30, 2010 3:58 PM
 To: CODE4LIB@LISTSERV.ND.EDU
 Subject: [CODE4LIB] SRU/ZeeRex explain question : record schemas
 
 This page:
 http://www.loc.gov/standards/sru/resources/schemas.html
 
 says:
 
 The Explain document lists the XML schemas for a given database in
which
 records may be transferred. Every schemas is unambiguously identified
by a
 URI and a server may assign a short name, which may or may not be the
same
 as the short name listed in the table below (and may differ from the
short name
 that another server assigns).
 
 
 But perusing the SRU/ZeeRex Explain documentation I've been able to
find, I've
 been unable to find WHERE in the Explain document this information is
 listed/advertised.
 
 Can anyone clue me in?