150 likes | 315 Views
Semantic Query Languages. Atilla ELÇİ Dept. of Computer Engineering Eastern Mediterranean University. 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"
E N D
Semantic Query Languages Atilla ELÇİ Dept. of Computer Engineering Eastern Mediterranean University CmpE 588 Spring 2008 EMU
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. CmpE 588 Spring 2008 EMU
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! CmpE 588 Spring 2008 EMU
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] CmpE 588 Spring 2008 EMU
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 CmpE 588 Spring 2008 EMU
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 CmpE 588 Spring 2008 EMU
.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. CmpE 588 Spring 2008 EMU
Library of Congress’ CQL • CQL: Contextual Query Language (SRU Version 1.2 Specifications) • Note its query syntax and some examples. • Note its BNF definition. CmpE 588 Spring 2008 EMU
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. CmpE 588 Spring 2008 EMU
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 functionallanguage comprised of several kinds ofexpressions that can be nested andcomposed with full generality. • XQuery tutorial by DonChamberlin (an editor of XQuery language specifications): XQuery:An XML querylanguage. 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. CmpE 588 Spring 2008 EMU
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. CmpE 588 Spring 2008 EMU
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. • SPARQLProtocol 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. CmpE 588 Spring 2008 EMU
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 CmpE 588 Spring 2008 EMU
SPARQL Software • ESW Wiki Entry: SparqlImplementations CmpE 588 Spring 2008 EMU
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. CmpE 588 Spring 2008 EMU