640 likes | 658 Views
OGC Geospatial Summit September 15, 2008. CQL and SRU Ray Denenberg, Library of Congress OASIS Search Web Services Technical Committee. Brief History. Brief History. Late 90s, Pressure to make Z39.50…. Simpler, more comprehensible,more implementable. Brief History.
E N D
OGC Geospatial Summit September 15, 2008 CQL and SRU Ray Denenberg, Library of CongressOASIS Search Web Services Technical Committee
Brief History • Late 90s, Pressure to make Z39.50…. • Simpler, more comprehensible,more implementable
Brief History • Late 90s, Pressure to make Z39.50…. • Simpler, more comprehensible,more implementable • But most important: Web Compatible
Brief History • Late 90s, Pressure to make Z39.50…. • Simpler, more comprehensible,more implementable • But most important: Web Compatible • …..while retaining the Z39.50 semantics and abstractions
Roughly speaking …. • SRU/CQL is the XML/Web version of Z39.50.
Roughly speaking …. • SRU/CQL is the XML/Web version of Z39.50.Where: • SRU corresponds to the Z39.50 protocol • CQL corresponds to the Z39.50 query
Timeline • 1997-2001 A few false starts … • 2001 Work on SRU began • 2002 Version 1.0 • 2004 Version 1.1 • 2007 Version 1.2 • In progress Version 2.0, OASIS SWS TC
An SRU Protocol Request http://www.loc.gov/sru?version=1.1&operation=searchRetrieve&query=dinosaur&maximumRecords=1 &recordSchema=dc
Break it down: http://www.loc.gov/sru? version=1.1&operation=searchRetrieve& query=dinosaur &maximumRecords=1 &recordSchema=dc Server Parameters CQL Query More parameters
query=dinosaur CQL Query
CQL “Contextual Query Language”
CQL’s Goals • Support simple queries with simplicity, Number one goal
CQL’s Goals • Support simple queries with simplicity, • and complex expressions with exactly the complexity needed: no more, no less.
Simple CQL Queries • cat (simplest)
Simple CQL Queries • cat (simplest) • cat and dog (simple boolean)
Simple CQL Queries …… • cat (simplest) • cat and dog (simple boolean) • title = cat (index search)
….. A little more complex • cat • cat and dog • title = cat • dc.title = cat(index qualified)
Qualified index • title = cat • dc.title = cat • bib.title = cat
Qualified index • title = cat • dc.title = cat • bib.title = cat • geo.latitude = 22.6
Qualified index • title = cat • dc.title = cat • bib.title = cat • geo.latitude = 22.6 • geo.bound encloses "45.3, 19.0"
Relations <index> <relation> <search term>
<index> <relation> <search term> Search Clause
<index> <relation> <search term> Search Clause (e.g. title = cat)
Cat • Title = cat Both are search clauses: in the first, the index and relation are defaulted.
cat Same as • <default Index> <default relation>cat
Some built-in relations … • <, >, <=, >=,<> • =the default relation, server defined • == Exact • adj Adjacency • Within • encloses
<index> <relation>/<modifier> <search term> Relation modifier Search Clause
RelationModifiers • Stem • relevant • Fuzzy • Phonetic • partial
Relation Modifier Example • Geo.city =/phonetic washintin Relation modifier
Partial geo.area encloses/partial “washington DC"
Proximity “Find cat and dog in the same sentence” cat prox//sentence dog
Proximity cat prox//sentence dog same as: Cat prox/distance=0/unit=sentence/unordered dog
Proximity prox/distance=0/unit=sentence/unordered
geo.cityname = washington prox/distance<=50/geo.unit=miles geo.cityname=baltimore Cities with name “washington” within 50 miles Of cities with name “baltimore”
Proximity Exclusion (a 2.0 feature) Cities with name “washington” not within 50 miles Of cities with name “baltimore” geo.cityname = washington prox/distance<=50/geo.unit=miles/not geo.cityname=baltimore
Window Relation(a 2.0 feature) dc.title window/distance<5/unit=word "fries salt vinegar" fries, salt, and vinegar all within a span of 5 words
geo.region Window /distance<200/geo.unit=miles/cityname “baltimore washington richmond" Regions containing cities with names Baltimore, Washington, and Richmond within a 200 mile area.
Context sets • Indexes • Relations • Relation modifiers • Boolean Modifiers
subject any/relevant "fish frog“ find records whose subject field includes words like shark, tuna, coelocanth, toad, amphibian, etc.
subject any/relevant "fish frog" Relation modifier index relation Subject to context qualification
dc.subject any/relevant "fish frog" Context set
dc.subject any/rel.lr "fish frog" A specific Relevance algorithn Context set
geo.bounds within/partial/geo.nwse "43.772 -101.411 31.7723 -77.7499") and (geo.keywords any "biologic ecologic"
geo.bounds within/partial/geo.nwse "43.772 -101.411 31.7723 -77.7499") and (geo.keywords any "biologic ecologic" Break that down…….
geo.bounds within/partial/geo.nwse "43.772 -101.411 31.7723 -77.7499" and geo.keywords any "biologic ecologic"