ogc geospatial summit september 15, 2008
Post on 31-Jan-2016
32 Views
Preview:
DESCRIPTION
TRANSCRIPT
OGC Geospatial Summit September 15, 2008
CQL and SRUCQL 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 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
http://www.loc.gov/sru?version=1.1&operation=searchRetrieve&query=dinosaur&maximumRecords=1&recordSchema=dc
An SRU Protocol Request
http://www.loc.gov/sru?version=1.1&operation=searchRetrieve&
query=dinosaur
&maximumRecords=1&recordSchema=dc
Server
Parameters
CQL Query
More parameters
Break it down:
query=dinosaurCQL Query
CQL
““Contextual Contextual Query Language”Query Language”
CQL’s Goals
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
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
adjAdjacency
Withinencloses
Relation Modifiers
Search Clause
<index> <relation>/<modifier> <search term>
Relation modifier
Relation Modifiers 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 dogsame 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”
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
Proximity Exclusion(a 2.0 feature)
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
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"
index relationRelationmodifier
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"
((geo.keyword = "ozone")
and
(geo.bounds within/partial/geo.nwse "58.45 -11.95 33.72 24.61")and ((geo.begdate >= /isodate 20040101) and (geo.enddate <= /isodate 20071231)))
SRU – Search/Retrieve via URL
SRU – Search/Retrieve via URL
Features
Result sets
SRU – Search/Retrieve via URL
Features
Result sets Result set refinement Request specific records Sorting
Result sets
Retrieval
Result sets
Retrieval Ability to request records in a particular
XML schema, e.g.• MODS• DC• GML
Result sets
Retrieval
Application Specific Diagnostics
http://www.search.gov/gsdi/sru2kml.php? operation=searchRetrieve&version=1.1& maximumRecords=100&recordSchema=GML& query=(geo.bounds within/partial/nwse "43.772 -101.411 31.7723 -77.7499") and (geo.keywords any "biologic ecologic")
http://www.search.gov/gsdi/sru2kml.php?
operation=searchRetrieve&version=1.1& startRecord=30& maximumRecords=15&recordSchema=GML&
query=
geo.bounds within/partial/nwse "43.772 -101.411 31.7723 -77.7499") and (geo.keywords any "biologic ecologic"
Server
Parameters
query
http://www.search.gov/gsdi/sru2kml.php?
operation=searchRetrieve&version=1.1& startRecord=30& maximumRecords=15&recordSchema=GML&
query=
geo.bounds within/partial/nwse "43.772 -101.411 31.7723 -77.7499") and (geo.keywords any "biologic ecologic"
Server
Parameters
query
Operation and version parameters (gone in 2.0)
http://www.search.gov/gsdi/sru2kml.php?
startRecord=30& maximumRecords=15&recordSchema=GML&
query=
geo.bounds within/partial/nwse "43.772 -101.411 31.7723 -77.7499") and (geo.keywords any "biologic ecologic"
Server
Parameters
query
Oasis SWS TC – Phase 1 Abstract Protocol Definition
From which bindings are derived.
Bindings SRU 1.2 specification (+CQL 1.2) Opensearch
Phase 2 SRU/CQL 2.0
Description Language
top related