120 likes | 240 Views
Proposal for a Query Language A CQL extension. Stefaan Ternier - K.U. Leuven/Ariadne/Prolearn http://www.cs.kuleuven.ac.be/~stefaan. creativecommons.org. Mappings – basic idea. Eg. dc.title = “milano meeting” and dc.type = “image”. ?. Query?. Result. source. target.
E N D
Proposal for a Query Language A CQL extension Stefaan Ternier - K.U.Leuven/Ariadne/Prolearn http://www.cs.kuleuven.ac.be/~stefaan Polimi, Italy
creativecommons.org Polimi, Italy
Mappings – basic idea Eg. dc.title = “milano meeting” and dc.type = “image” ? Query? Result source target <lom><general>..</general>..</lom> Polimi, Italy
CQL - Terminology • Search term • may be enclosed in double quotes • must be enclosed with double quotes if contains a search term contains < > = / ( ) or whitespace • Example • Bird • “milano meeting” • Search Clause • Consists of • Index/relation/search term • Search term only • Example: • title = “milano meeting” (Index/relation/search term) • “milano meeting” (equivalent to srw.serverChoice = “milano meeting”) Polimi, Italy
CQL - Terminology • Index • [[Index name] Fieldname] • Example • dc.title • title • Disadvantage • Current structure -> flatworks only key – value pairs<-> LOM = hierarchical Polimi, Italy
CQL - Proposal • Make it suit for hierarchical metadata structures • Revisit Index • [[index name] [path elements]* Fieldname] • Example • lom.general.identifier.title • lom.technical.size • .technical.size • size • dc.title • context.environment.os Polimi, Italy
Queries • List documents with a filesize less than 2kb, that have an ISBN number and that have an identifier equal to “0-306-40615”. • List documents with a filesize less than 2kb and that have an ISBN that is equal to “0-306-40615”. <lom> <general> <identifier> <catalog>ISBN</catalog> <entry>0-306-40615</entry> </identifier> <identifier> <catalog>ariadne</catalog> <entry>123456789</entry> </identifier> </general> <technical> <size>299</size> </technical></lom> <lom> <general> <identifier> <catalog>ISBN</catalog> <entry>0-111-22222</entry> </identifier> <identifier> <catalog>ariadne</catalog> <entry>0-306-40615</entry> </identifier> </general> <technical> <size>299</size> </technical></lom> Matches query 1 & 2 Matches query 1 Polimi, Italy
Queries -issues • List documents with a filesize less than 2kb, that have an ISBN number and that have an identifier equal to “0-306-40615”.lom.technical.size < 2000 lom.general.identifier.catalog = “ISBN” andlom.general.identifier.entry = “0-306-40615” • List documents with a filesize less than 2kb and that have an ISBN that is equal to “0-306-40615”.? • List documents have a contributor that has Erik as first name and Ternier as last name. ? Proposal: introduce an XPath like solutionlom.technical.size < 2000 and lom.general.identifier.(catalog = “ISBN” and entry = “0-306-40615) Polimi, Italy
<lom> <general> <identifier> <catalog>ISBN</catalog> <entry>0-306-40615</entry> </identifier> <identifier> <catalog>ariadne</catalog> <entry>123456789</entry> </identifier> </general> <technical> <size>29999</size> </technical></lom> <lom> <general> <identifier> <catalog>ISBN</catalog> <entry>0-111-22222</entry> </identifier> <identifier> <catalog>ariadne</catalog> <entry>0-306-40615</entry> </identifier> </general> <technical> <size>29999</size> </technical></lom> Polimi, Italy
<lom> <general> <identifier> <catalog>ISBN</catalog> <entry>0-306-40615</entry> </identifier> <identifier> <catalog>ariadne</catalog> <entry>123456789</entry> </identifier> </general> <technical> <size>29999</size> </technical></lom> <lom> <general> <identifier> <catalog>ISBN</catalog> <entry>0-111-22222</entry> </identifier> <identifier> <catalog>ariadne</catalog> <entry>0-306-40615</entry> </identifier> </general> <technical> <size>29999</size> </technical></lom> Polimi, Italy
XQuery:<results> { for $lom in doc("data/something.xml")/lom where( some $general in $lom/general satisfies $general/identifier/catalog/text() = "ISBN" and $general/identifier/entry/text() = "0-306-40615" and $lom/technical/Size/text() <2000 ) return $lom } </results> lom.general.(identifier.catalog = “ISBN” and identifier.entry = “0-306-40615) andlom.technical.size < 2000 Polimi, Italy
XQuery: <results> { for $lom in doc("data/something.xml")/lom where( some $identifier in $lom/general/identifier satisfies $identifier/catalog/text() = "ISBN" and $identifier/entry/text() = 123456789 and $lom/technical/Size/text() <2000 ) return $lom } </results> lom.general.identifier(catalog = “ISBN” and entry = “0-306-40615) andlom.technical.size < 2000 Polimi, Italy