how to: sru

16
How To: SRU Ralph LeVan Senior Research Scientist, OCLC [email protected] WorldCat Hackathon New York Public LIbrary 7 November 2008

Upload: hestia

Post on 15-Jan-2016

65 views

Category:

Documents


0 download

DESCRIPTION

How To: SRU. Ralph LeVan Senior Research Scientist, OCLC [email protected] WorldCat Hackathon New York Public LIbrary 7 November 2008. The Basics. REST-ful API for Search and Retrieve CQL – A rich, standardized query grammar Self-describing service through Explain records. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: How  To: SRU

How To: SRUHow To: SRU

Ralph LeVanSenior Research Scientist, [email protected]

WorldCat HackathonNew York Public LIbrary7 November 2008

Page 2: How  To: SRU

The BasicsThe Basics

• REST-ful API for Search and Retrieve

• CQL – A rich, standardized query grammar

• Self-describing service through Explain records

Page 3: How  To: SRU

REST-ful API for Search and RetrieveREST-ful API for Search and Retrieve

• Base URL: http://worldcat.org/identities/search/Identities

• Querystring: query=local.Name+all+%22ralph+levan%22

• Important Optional Parms:

• startRecord

• maximumRecords

• recordSchema

Page 4: How  To: SRU

REST-ful API for Search and RetrieveREST-ful API for Search and Retrieve

• Untrustworthy Optional Parms:

• sortKeys

Page 5: How  To: SRU

REST-ful API for Search and RetrieveREST-ful API for Search and Retrieve

• Amusing Parms:

• recordPacking

Page 6: How  To: SRU

REST-ful API for Search and RetrieveREST-ful API for Search and Retrieve

• Omittable Mandatory Parms:

• version

• operation

Page 7: How  To: SRU

CQLCQL

• Standard Boolean operations

• Search Terms: [Index relation] quotedString

• query=dog

• query=cql.any exact “moby dick”

• Indexes defined by server

• Standard relations:

• exact, =, all, any

Page 8: How  To: SRU

searchRetrieveResponsesearchRetrieveResponse

<?xml version="1.0" ?> <?xml-stylesheet type="text/xsl"

href="/identities/NameFinderResponse.xsl"?><searchRetrieveResponse

xmlns="http://www.loc.gov/zing/srw/">

Page 9: How  To: SRU

searchRetrieveResponse elementssearchRetrieveResponse elements

<version>1.1</version><numberOfRecords>3</numberOfRecords><resultSetId>6dsxzt</resultSetId><resultSetIdleTime>300</resultSetIdleTime><records><record></record>...</records><echoedSearchRetrieveRequest>...<diagnostics>...<extraResponseData>...

Page 10: How  To: SRU

record elementsrecord elements

<recordSchema> info:srw/schema/1/Identities</recordSchema><recordPacking>xml</recordPacking><recordData>...<recordPosition>1</recordPosition>

Page 11: How  To: SRU

ExplainExplain

<explainResponse xmlns="http://www.loc.gov/zing/srw/">

<version>1.1</version> <record> <recordSchema>

http://explain.z3950.org/dtd/2.0/</recordSchema>

<recordPacking>xml</recordPacking> <SRW:recordData>

Page 12: How  To: SRU

Explain RecordExplain Record

<explain authoritative="true" xmlns="http://explain.z3950.org/dtd/2.0/">

<serverInfo protocol="SRW/U">… <databaseInfo>… <indexInfo>… <schemaInfo>… <configInfo>…

Page 13: How  To: SRU

indexInfoindexInfo

<set identifier="http://staff.oclc.org/~levan/localContextSets/Identities" name="local"/>

<index> <title>local.BirthDate</title> <map> <name set="local">BirthDate</name> </map> <configInfo> <supports type='relation'>any</supports> </configInfo> </index>

Page 14: How  To: SRU

schemaInfoschemaInfo

<schema sort="false" retrieve="true" name="Identities"

identifier="info:srw/schema/1/Identities”location="http://www.oclc.org/standards/

Identities/schema/Identities.xsd"> <title>Identities records in their native

format</title> </schema>

Page 15: How  To: SRU

configInfoconfigInfo

<default type="maximumRecords">250</default><default type="numberOfRecords">10</default><default type="retrieveSchema"> info:srw/schema/1/Identities</default>

Page 16: How  To: SRU

LinksLinks

http://www.loc.gov/standards/sru/