BBY 464 Semantic Information Management (Spring 2016) Semantic Query Languages Yaşar Tonta & Orçun Madran [yasartonta, orcunmadran]@gmail.com Hacettepe University Department of Information Management Semantic Web From Syntactic to Semantic Interoperability Search Engines According to Zadeh • Insufficient • Works through 2-values logic • Can’t make inferences Source: Zadeh, 2005, 2006) Conversion to Question Answering Systems • World’s knowledge • Relevance (statistical/semantic) – q: How old is Vera? – p: Vera is the same age as Irene – r: Irene is 65 • Making inferences from perception-based knowledge – 2-valued logic and probability is not valid • The main problem is understanding natural language Source: Zadeh, 2005, 2006) • Query formulation Problems – Synonymous words (“garbage theory”) • Lack of semantics – “Telekom Inc. Turkey Nebi Fışkın Director” – “Istanbul-based Mobilfon’s Executive Committee appointed Nebi Fışkın as CEO • Lack of context – In which context user seeks information – COntext INterchange (COIN) • Presentation of search results – Users cannot look at the results beyond the first page. Source: Warren & Davies, 2007, pp. 179-181 Examples • Google • Wolfram Alpha • Swoogle From Databases to Data Spaces • Database -> structured • Data space -> not so structured – Its primary function is to simplify integration of heterogeneous data – e.g., semi-structured data such as XML documents and text files – They will be accessible via the same interface as structured data organized into tables or key/value pairs – Secondary function of a data space is to simplify data integration by providing data mapping and semantic integration facilities for hosted data collections and external data resources such as relational databases or files Source: http://www.streamscape.com/Technology/dataspaces.html • Database – Can be queried with SQL (Structured Query Language) • Data space – NoSQL (Not only SQL) databases that specialize in semi-structured data Source: http://www.streamscape.com/Technology/dataspaces.html Structured Query Language (SQL) Example: SELECT Statement SELECT * FROM PROJECT WHERE Department =’Finance’ AND MaxHours > 100; Copyright © 2004 Chapter 6/11 Subqueries • Subqueries can be extended to include many levels • Example SELECT DISTINCT Name FROM EMPLOYEE WHERE EmployeeNumber IN (SELECT EmployeeNum FROM ASSIGNMENT WHERE HoursWorked > 40 AND ProjectID IN (SELECT ProjectID FROM PROJECT WHERE Department = ‘Accounting’)); Chapter 6/12 Copyright © 2004 SPARQL • SPARQL Protocol and RDF Query Language • Semantic query language • Retrieves and manipulates data in RDF format Source: https://en.wikipedia.org/wiki/SPARQL Examples Returns names and emails of every person in the FOAF dataset Source: https://en.wikipedia.org/wiki/SPARQL “What are all the country capitals in Africa?” Source: https://en.wikipedia.org/wiki/SPARQL • Web 2.0 is a critical precursor of Semantic Web and complements RDF • Semantic Web will be triggered by Web apps (blogs, wikis, social networks, photo sharing services, and so on) that require open data and atomic data containment (Data Spaces) • Transition from “programmable web” to “programmable and query-able web of databases” • Representing non-RDF data as RDF data by way of Ontology mapping How? • 1. By storing app triples in an RDF Triple Store • 2. By converting SPARQL queries to SQL and reformatting results back into RDF from. RDF Triple Store Implementation • • • • • Data types Data dictionary (System tables and indexes) Virtuoso SQL and SPARQL Fusion Join Operation Algorithms Data import and index compaction RDF Data Management • • • • Xquery Xpath XSLT XMLS
© Copyright 2026 Paperzz