27/04/08 rev 29/4/08cmpe 588 spring 2008 emu1 semantic query languages atilla elÇİ dept. of...
TRANSCRIPT
27/04/08 rev 29/4/08 CmpE 588 Spring 2008 EMU 1
Semantic Query Languages
Atilla ELÇİDept. of Computer Engineering
Eastern Mediterranean University
27/04/08 rev 29/4/08 CmpE 588 Spring 2008 EMU 2
What is Query Language? Webopedia: A specialized language for
requesting information from a database. For example, the query SELECT ALL WHERE age > 30 AND name = "Smith"
requests all records in which the name-field is "Smith" and the Age field has a value greater than 30. The de facto standard for query languages is SQL.
27/04/08 rev 29/4/08 CmpE 588 Spring 2008 EMU 3
Shortcomings of Current Query Language Technology Query construction:
Syntactic units such as keywords/terms are used. Polysemy: multiple meanings Query ambiguity: # of keywords used per query (circa 2000): 2.2!
Lack of semantics: Inability to handle synonymy & polisemy Missed semantic links
Lack of context: Missing the context to disambiguate the user’s query.
Presentation of results: Often too many results
Managing heterogeneity: Providing a coherent view of diverse sources and types of information:
very difficult and unsatisfactory at the best. Lots of data but lacking information! High recall but low precision!
Shortcoming 2 Difficult for ordinary end user DB schemas change over time even though the data
remains unchanged Addition of a new set of data or archiving existing data may
also result in schema changes
==> These non-semantic changes imply changes in queries therefore updates on IS relying on such queries. [Yuan & Jones]
27/04/08 rev 29/4/08 CmpE 588 Spring 2008 EMU 4
Semantic Access to RDB Data Most data is kept in RDB sets due to various resons Some challenges of semantic access to existing RDB data:
Lack of explicit ontology of RDB data Mapping:
the semantic model (ontology) to the underlying data model; or the semantic query primitives to the relational query primitives “In order to successfully push down the semantic query evaluation as much
as possible into a RDB query engine, a generic mapping structure needs to be developed between ontologies and relational data models and theoretical foundation needs to be built between the semantic query formalisms and the relational calculus/algebra.”
Result transformation: Query answer transformation: converting query answers out of the RDB engine into an instantiation of ontology:
How to formulate the URI for each instance? how to preserve the intermediate query answers efficiently?
Performance
27/04/08 rev 29/4/08 CmpE 588 Spring 2008 EMU 5
27/04/08 rev 29/4/08 CmpE 588 Spring 2008 EMU 6
Advantages of Semantic Web Technology (Retrofitted for Semantic Query Language
Technology)
Resolving shortcomings of the current query languages by: Exploiting machine-processable metadata Using ontological concepts to define queries Using semantic relations in defining queries Providing information not simply data
Future search engines must rely on “information-centric” approach including semantic query languages rather than document-centric one in order to seek: Relevant sections not simply documents Digest of info from several docs/sections
.QL An object-oriented query language used to
retrieve data from relational database management systems. [Wikipedia]
.QL language reference. A private initiative of Semmle Limited.
27/04/08 rev 29/4/08 CmpE 588 Spring 2008 EMU 7
Library of Congress’ CQL CQL: Contextual Query Language
(SRU Version 1.2 Specifications) Note its query syntax and some examples. Note its BNF definition.
27/04/08 rev 29/4/08 CmpE 588 Spring 2008 EMU 8
OASIS Core Standards OASIS Cover Pages: process history of generating
XML query languages: XQuery and its lesser brother XPath in the XSLT technology line for full-text search over XML documents.
27/04/08 rev 29/4/08 CmpE 588 Spring 2008 EMU 9
XQuery: XML Query Language XQuery is a query language (with some
programming language features) that is designed to query collections of XML data. It is semantically similar to SQL. [Wikipedia]
XQuery is a functional language comprised of several kinds of expressions that can be nested and composed with full generality.
XQuery tutorial by DonChamberlin (an editor of XQuery language specifications): XQuery: An XML query language. In IBM Systems Journal, Vol 41, No 4, 2002, pp: 597-615.
Take note of the complexity of syntax, For example: even simple cases like Q7 & Q8. And, see sample function definitions.
Current: XQuery 1.0 and XPath 2.0 Full-Text 1.0 as W3C Working Draft dated 18 May 2007.
27/04/08 rev 29/4/08 CmpE 588 Spring 2008 EMU 10
RDF Query Language A RDF query language is a computer language
able to retrieve and manipulate data stored in Resource Description Framework format.
Check Wikipedia entry for links to a list of RDF query languages, such as , DQL, N3QL, R-DEVICE, RDFQ, RDQ, RDQL, RQL/RVL, SeRQL, Versa, XUL, and Adenine.
SPARQL is now a defacto standard.
27/04/08 rev 29/4/08 CmpE 588 Spring 2008 EMU 11
W3C SPARQL SPARQL (pronounced "sparkle" [1]) is an
RDF query language. [Wikipedia] Its name is a recursive acronym that stands for SPARQL
Protocol and RDF Query Language Standardized by W3C RDF Data Access Working Group.
SPARQL Protocol for RDF: It uses WSDL 2.0 to describe a means for conveying SPARQL queries to
an SPARQL query processing service and returning the query results to the entity that requested them.
SPARQL Query Language for RDF W3C Recommendation 15 January 2008 Defines the syntax and semantics of SPARQL query
language for RDF.
27/04/08 rev 29/4/08 CmpE 588 Spring 2008 EMU 12
SPARQL Query Language for RDF Can express queries across diverse data sources, such as
stored natively as RDF or viewed as RDF via middleware. Can query required and optional graph patterns, their
conjunctions and disjunctions. Supports extensible value testing and constraining queries
by source RDF graph. The results of SPARQL queries can be results sets or RDF
graphs. Examples:
Example in Wikipedia entry. Sect. 1 & 2 in W3C Recommendation 15 January 2008
27/04/08 rev 29/4/08 CmpE 588 Spring 2008 EMU 13
SPARQL Software ESW Wiki Entry: SparqlImplementations
27/04/08 rev 29/4/08 CmpE 588 Spring 2008 EMU 14
27/04/08 rev 29/4/08 CmpE 588 Spring 2008 EMU 15
References W3C Semantic Web Tools Wiki page. Jun Yuan, David H. Jones: Enabling Semantic Access to
Enterprise RDB Data, Position Paper for W3C workshop on RDF Access to Relational Databases. Mathematics & Computing Technology, Boeing Phantom Works, P.O. Box 3707, M/C 7L-70, Seattle, Washington, 98124, U.S.A. Here.