The Vision and Basic Technologies of the Semantic Web.

Slides:



Advertisements
Similar presentations
Natural Language Systems, Department of Informatics, University of Hamburg NATS IR in WWW Dozentin: C. Vertan Autor: M. Hoffmann RDF Resource Description.
Advertisements

Metadata vocabularies and ontologies Dr. Manjula Patel Technical Research and Development
Co-funded by the European Union Semantic CMS Community Interactive Knowledge in Semantic CMS Introduction Copyright IKS Consortium 1 Lecturer Organization.
Co-funded by the European Union Semantic CMS Community The Semantic Web – Part 2 Modeling Complex Knowledge Domains Copyright IKS Consortium 1 Lecturer.
CH-4 Ontologies, Querying and Data Integration. Introduction to RDF(S) RDF stands for Resource Description Framework. RDF is a standard for describing.
XML: Extensible Markup Language
Co-funded by the European Union Semantic CMS Community Content Management From free text input to automatic entity enrichment Copyright IKS Consortium.
RDF Schemata (with apologies to the W3C, the plural is not ‘schemas’) CSCI 7818 – Web Technologies 14 November 2001 Van Lepthien.
Semantic Web Thanks to folks at LAIT lab Sources include :
The Semantic Web – WEEK 4: RDF
Introduction to RDF Based on tutorial at
1 RDF Tutorial. C. Abela RDF Tutorial2 What is RDF? RDF stands for Resource Description Framework It is used for describing resources on the web Makes.
An Introduction to Semantic Web Portal
XML Technology in E-Commerce
E © 2002 Dario Aganovic Resource Description Framework Schema (RDFS) Dario Aganovic Industrial PhD-student NPI Production Kista, Ericsson AB and Production.
CS570 Artificial Intelligence Semantic Web & Ontology 2
RDF – RESOURCE DESCRIPTION FRAMEWORK Antonio Bucchiarone FBK-IRST Trento, Italy 20 Novembre 2009.
RDFa: Embedding RDF Knowledge in HTML Some content from a presentation by Ivan Herman of the W3c, Introduction to RDFa, given at the 2011 Semantic Technologies.
ESDSWG2011 – Semantic Web session Semantic Web Sub-group Session ESDSWG 2011 Meeting – Semantic Web sub-group session Wednesday, November 2, 2011 Norfolk,
RDF Tutorial.
Semantic Web Introduction
© Copyright IBM Corporation 2014 Getting started with Rational Engineering Lifecycle Manager queries Andy Lapping – Technical sales and solutions Joanne.
Quratulain Rajput Faculty of Computer Science, IBA Spring2013
 Copyright 2004 Digital Enterprise Research Institute. All rights reserved. SPARQL Query Language for RDF presented by Cristina Feier.
Chapter 3 RDF Syntax 1. Topics Basic concepts of RDF resources, properties, values, statements, triples URIs and URIrefs RDF graphs Literals and Qnames.
SPARQL for Querying PML Data Jitin Arora. Overview SPARQL: Query Language for RDF Graphs W3C Recommendation since 15 January 2008 Outline: Basic Concepts.
Dr. Alexandra I. Cristea RDF.
1 COS 425: Database and Information Management Systems XML and information exchange.
RDF Kitty Turner. Current Situation there is hardly any metadata on the Web search engine sites do the equivalent of going through a library, reading.
RDF: Building Block for the Semantic Web Jim Ellenberger UCCS CS5260 Spring 2011.
Semantic Web Presented by: Edward Cheng Wayne Choi Tony Deng Peter Kuc-Pittet Anita Yong.
Samad Paydar Web Technology Laboratory Computer Engineering Department Ferdowsi University of Mashhad 1389/11/20 An Introduction to the Semantic Web.
Logics for Data and Knowledge Representation SPARQL Protocol and RDF Query Language (SPARQL) Feroz Farazi.
RDF: Concepts and Abstract Syntax W3C Recommendation 10 February Michael Felderer Digital Enterprise.
RDF (Resource Description Framework) Why?. XML XML is a metalanguage that allows users to define markup XML separates content and structure from formatting.
Practical RDF Chapter 1. RDF: An Introduction
The Semantic Web Service Shuying Wang Outline Semantic Web vision Core technologies XML, RDF, Ontology, Agent… Web services DAML-S.
INF 384 C, Spring 2009 Ontologies Knowledge representation to support computer reasoning.
Logics for Data and Knowledge Representation
The Semantic Web Web Science Systems Development Spring 2015.
Chapter 3 Querying RDF stores with SPARQL. Why an RDF Query Language? Why not use an XML query language? XML at a lower level of abstraction than RDF.
CC L A W EB DE D ATOS P RIMAVERA 2015 Lecture 2: RDF Model & Syntax Aidan Hogan
Metadata. Generally speaking, metadata are data and information that describe and model data and information For example, a database schema is the metadata.
Information Interchange on the Semantic Web an interactive talk by Piotr Kaminski, University of Victoria
RDF and XML 인공지능 연구실 한기덕. 2 개요  1. Basic of RDF  2. Example of RDF  3. How XML Namespaces Work  4. The Abbreviated RDF Syntax  5. RDF Resource Collections.
EEL 5937 Ontologies EEL 5937 Multi Agent Systems Lecture 5, Jan 23 th, 2003 Lotzi Bölöni.
Co-funded by the European Union Semantic CMS Community Content and Knowledge Management From free text input to automatic entity enrichment Copyright IKS.
Introduction to the Semantic Web and Linked Data Module 1 - Unit 2 The Semantic Web and Linked Data Concepts 1-1 Library of Congress BIBFRAME Pilot Training.
Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.2.
Working with XML Schemas ©NIITeXtensible Markup Language/Lesson 3/Slide 1 of 36 Objectives In this lesson, you will learn to: * Declare attributes in an.
Doc.: IEEE /0169r0 Submission Joe Kwak (InterDigital) Slide 1 November 2010 Slide 1 Overview of Resource Description Framework (RFD/XML) Date:
EEL 5937 Ontologies EEL 5937 Multi Agent Systems Lotzi Bölöni.
Co-funded by the European Union Semantic CMS Community Reference Architecture for Semantic CMS Copyright IKS Consortium 1 Lecturer Organization Date of.
CC L A W EB DE D ATOS P RIMAVERA 2015 Lecture 7: SPARQL (1.0) Aidan Hogan
The Semantic Web. What is the Semantic Web? The Semantic Web is an extension of the current Web in which information is given well-defined meaning, enabling.
Co-funded by the European Union Semantic CMS Community Interactive Knowledge in Semantic CMS Organizational Information & Course Overview Copyright IKS.
Semantic Web 06 T 0006 YOSHIYUKI Osawa. Problem of current web  limits of search engines Most web pages are only groups of character strings. Most web.
Chapter 5 The Semantic Web 1. The Semantic Web  Initiated by Tim Berners-Lee, the inventor of the World Wide Web.  A common framework that allows data.
XML Namespaces In this first lesson XML Namespaces, you will learn to:
Setting the stage: linked data concepts Moving-Away-From-MARC-a-thon.
Linked Data & Semantic Web Technology The Semantic Web Part 4. Resource Description Framework (1) Dr. Myungjin Lee.
The Semantic Web By: Maulik Parikh.
CC La Web de Datos Primavera 2017 Lecture 7: SPARQL [i]
CmpE 583- Web Semantics: Theory and Practice PRINCIPLES
RDF For Semantic Web Dhaval Patel 2nd Year Student School of IT
Logics for Data and Knowledge Representation
CC La Web de Datos Primavera 2016 Lecture 7: SPARQL (1.0)
Resource Description Framework (RDF)
Logics for Data and Knowledge Representation
Presentation transcript:

The Vision and Basic Technologies of the Semantic Web. The Semantic Web – Part 1 Lecturer Organization Date of presentation The Vision and Basic Technologies of the Semantic Web. Copyright IKS Consortium

Part III: Methodologies Part II: Semantic Content Management Part III: Methodologies Knowledge Interaction and Presentation Designing Interactive Ubiquitous IS Knowledge Representation and Reasoning Semantifying your CMS Semantic Lifting Reference Architecture for Semantic CMS Storing and Accessing Semantic Data Requirements Engineering for Semantic CMS Part I: Foundations Content Management The Semantic Web Copyright IKS Consortium

What is this Lecture about? Semantic web technologies as a possible solution for improving the „state of play“ in content management by making semantics expressable in machine-readable way The Semantic Web The vision behind the semantic web Underlying technologies of the Semantic Web Part I: Foundations Content Management The Semantic Web Copyright IKS Consortium

Web Engineering WT 2006/07 Chapter 4: Web Services 11.04.2017 Web evolution Web 3.0 Web 4.0 A digital library (1.0, the Web of Documents) A document library with hyperlinks A database, an application platform (1.0, evolved) A shared portal through which applications can be web accessible A multimedia and social platform (2.0, the Social Web) A radio, a trailer, a telephone, a tv, a public place, a position anywhere in the world. Collaboration, “web editing” A naming scheme (3.0, the Web of Data) Unique identity for all entities: documents, persons, services, physical things, metadata, ... URI-based data integration is the key use-case for the semantic web A Global Giant Graph (4.0. the actual Semantic Web) A place where people work, interact, and produce interpretations assisted by computers Web 2.0 Web 1.0 Slide by Nova Spivack, Radar Networks Copyright IKS Consortium © Gregor Engels University of Paderborn

The Semantic Web The vision of the Semantic Web has been originally proposed by Tim Berners-Lee “The Semantic Web is not a separate Web but an extension of the current one, in which information is given well-defined meaning, better enabling computers and people to work in cooperation.” [The Semantic Web, 2001] Standardized specification techniques for the semantic annotation of content (RDF, OWL, ...) Copyright IKS Consortium

Semantic Web Stack W3C provides standardized specifications for Semantic Web technologies Semantic Web Layer Cake as a conceptual architecture describes an hierarchy of languages Each layer exploits and uses capabilities of the layers below Semantic Web Layer Cake, Image source: http://www.w3.org/2007/03/layerCake.svg Copyright IKS Consortium

Unique Identification of Resources “...more fundamental than either HTTP or HTML are URIs, which are simple text strings that refer to Internet resources -- documents, resources, people, and indirectly to anything. URIs are the glue that binds the Web together. IRIs extend and strengthen the glue, by allowing people to identify Web resources in their own language.” In a “Web of Data” the unique identification of entities is required Copyright IKS Consortium

How to identify resources? Web Engineering WT 2006/07 Chapter 4: Web Services 11.04.2017 How to identify resources? URI – Uniform Resource Identifier [RFC 3986] “A Uniform Resource Identifier (URI) is a compact sequence of characters that identifies an abstract or physical resource.” A URI consists of five parts: scheme, authority, path, query and fragment URI = scheme ":" authority "/" path [ "?" query ] [ "#" fragment ] Example: http://user@example.com:8042/over/there?name=ferret#nose scheme authority path query fragment Copyright IKS Consortium © Gregor Engels University of Paderborn

How to identify resources? IRI – Internationalized Resource Identifier [RFC 3987] “IRIs are defined similarly to URIs in [RFC3986], but the class of unreserved characters is extended by adding the characters of the UCS (Universal Character Set, [ISO10646]) ..” Extends the character set used by URIs and thereby allows the consideration of language specific syntaxes (e.g. Japanese, Chinese, ...) Example Logical Hebrew http://ab.גדהוזח.ij/kl/mn/op.html ASCII notation http://ab.CDEFGH.ij/kl/mn/op.html Copyright IKS Consortium

Structuring Data XML – Extensible Markup Language XML can be used to specify the syntactical structure of documents or complex data objects in a machine-readable form <car> <brand>Jaguar</brand> <model>XF</model> <dimensions> <length>4961</length> <width>2070</width> </dimensions> <engine>5.0 L V8 Petrol</engine> </car> Copyright IKS Consortium

The difference in meaning is only recognized by a human. Why isn´t XML enough? XML tags are only defining the structure of a document For a machine the tags have no semantics! <car> <brand>Jaguar</brand> ... </car> <cat> <brand>Jaguar</brand> ... </cat> The difference in meaning is only recognized by a human. Copyright IKS Consortium

Why isn´t XML enough? The relation among the different tags is not expressed explicitly <car> <brand>Jaguar</brand> ... </car> The relation between “car”, “brand” and “Jaguar” is only recognizable by a human. Copyright IKS Consortium

What do we need? We want to express the statement: We need ... “The brand of the car is Jaguar.” We need ... ...a way to address the concrete resource car. ... to express the property brand of the resource car. ... to define the property value Jaguar for the property brand. Copyright IKS Consortium

Resource Description Framework (RDF) “The Resource Description Framework (RDF) identifies things using Web identifiers (URIs), and describes resources with properties and property values.” A Resource is an object that can be identified by an URI, e.g. “http://example.org/Car”. A Property describes an aspect of a resource, e.g. “http://example.org/Brand”. The property is also identified by an URI. The Property value assigns a concrete value to a property, e.g. “Jaguar” or ““http://example.org/Jaguar”. http://www.w3schools.com/rdf/ Copyright IKS Consortium

RDF Statements RDF statements consist of subject (resource), predicate (property) and object (property value) Subjects (except Blank Nodes) and Predicates are always defined by URIs Objects can be defined by URIs and literals Predicate Subject Object (URI) Predicate Object (literal) Copyright IKS Consortium

RDF Statements - Example Exemplary statements: “The brand of the car is Jaguar.” “The model of the car is XF.” Subject Predicate Object http://example.org/rel/Brand http://example.org/Car http://example.org/Jaguar http://example.org/rel/Model XF Predicate Object Copyright IKS Consortium

Resource Description Framework (RDF) “The Resource Description Framework (RDF) is a language for representing information about resources...” [RDF Primer] W3C Standard (http://www.w3.org/RDF) RDF provides a graph-based data model for representing metadata for describing the semantics of information in a machine-accessible way Copyright IKS Consortium

RDF Serialization Formats RDF/XML N3 N-Triples TRiG TRiX Turtle JSON JSON-LD RDFa Copyright IKS Consortium

RDF/XML RDF/XML is the most common serialization format for RDF statements Example: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rel="http://example.org/rel/"> <rdf:Description rdf:about="http://example.org/Car"> <rel:Brand rdf:resource="http://example.org/Jaguar"/> </rdf:Description> <rel:Model>XF</rel:Model> </rdf:RDF> http://www.w3.org/TR/2004/REC-rdf-syntax-grammar-20040210/ Copyright IKS Consortium

Root Element and Namespaces Root element of the RDF/XML document. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rel="http://example.org/rel/"> .... </rdf:RDF> Defined namespaces <rdf:RDF> Root element of RDF documents xmlns:rdf Specifies that elements with the “rdf” prefix are using the namespace “..” xmlns:abc Specifies that elements with the “abc” prefix are using the namespace “..” Copyright IKS Consortium

Description Element Node element Assigns a resource to <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rel="http://example.org/rel/"> <rdf:Description rdf:about="http://example.org/Car"> ... </rdf:Description> </rdf:RDF> Assigns a resource to the node element. <rdf:Description> Introduces node element (subject). <rdf:about> Defines the URI reference for the node element. Copyright IKS Consortium

Objects defined by Resources Assigning resources to objects (property values) in RDF/XML <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rel="http://example.org/rel/"> <rdf:Description rdf:about="http://example.org/Car"> <rel:Brand rdf:resource="http://example.org/Jaguar"/> </rdf:Description> </rdf:RDF> Defines predicate “Brand” in namespace “rel”. The object is defined by a resource. http://example.org/Car http://example.org/Jaguar http://example.org/rel/Brand Copyright IKS Consortium

Objects defined by Literals Definition of objects (properties) with constant values (literals) <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rel="http://example.org/rel/"> <rdf:Description rdf:about="http://example.org/Car"> <rel:Model>XF</rel:Model> </rdf:Description> </rdf:RDF> http://example.org/Car XF http://example.org/rel/Model The object is defined by a literal. Copyright IKS Consortium

RDF Container Elements “A container is a resource that contains things. The contained things are called members. The members of a container may be resources (including blank nodes) or literals.” Container provide the ability to describe groups of things, e.g. several authors of a book RDF defines three types of containers: Bag Sequence Alternatives http://www.w3.org/TR/2004/REC-rdf-primer-20040210/ Copyright IKS Consortium

Container Element - Bag “A Bag (a resource having type rdf:Bag) represents a group of resources or literals, possibly including duplicate members, where there is no significance in the order of the members.” Example: Describe equipment features of the car. http://www.w3.org/TR/2004/REC-rdf-primer-20040210/ Copyright IKS Consortium

Container Element - Bag http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag http://example.org/Car http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://example.org/features#equipment http://example.org/AC http://www.w3.org/1999/02/22-rdf-syntax-ns#_1 http://www.w3.org/1999/02/22-rdf-syntax-ns#_2 http://example.org/CarRadio Blank Node http://www.w3.org/1999/02/22-rdf-syntax-ns#_3 http://example.org/SeatHeating Copyright IKS Consortium

Container Element - Bag The subject “Car” is described by the predicate “equipment”. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:e="http://example.org/features#"> <rdf:Description rdf:about="http://example.org/Car"> <e:equipment> <rdf:Bag> <rdf:li rdf:resource="http://example.org/AC"/> <rdf:li rdf:resource="http://example.org/CarRadio"/> <rdf:li rdf:resource="http://example.org/SeatHeating"/> </rdf:Bag> </e:equipment> </rdf:Description> </rdf:RDF> The different members of the Bag container are listed. The object is a container of type “Bag” <x:xyz> Defines predicate “xyz” in namespace “x”. <rdf:Bag> Defines a container of type “Bag”. <rdf:li> Defines members of the Bag container. Copyright IKS Consortium

Container Element - Sequence “A Sequence or Seq (a resource having type rdf:Seq) represents a group of resources or literals, possibly including duplicate members, where the order of the members is significant.” Example: Describe a list of previous owners of the car in chronological order. http://www.w3.org/TR/2004/REC-rdf-primer-20040210/ Copyright IKS Consortium

Container Element - Sequence http://example.org/Car http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://example.org/owner#preOwners http://example.org/JohnDoe http://www.w3.org/1999/02/22-rdf-syntax-ns#_1 http://www.w3.org/1999/02/22-rdf-syntax-ns#_2 http://example.org/RickMiller http://www.w3.org/1999/02/22-rdf-syntax-ns#_3 http://example.org/SarahHouse Copyright IKS Consortium

Container Element - Sequence The subject “Car” is described by the predicate “preOwners”. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:p="http://example.org/owner#"> <rdf:Description rdf:about="http://example.org/Car"> <p:preOwners> <rdf:Seq> <rdf:li rdf:resource="http://example.org/JohnDoe"/> <rdf:li rdf:resource="http://example.org/RickMiller"/> <rdf:li rdf:resource="http://example.org/SarahHouse"/> </rdf:Seq> </p:preOwners> </rdf:Description> </rdf:RDF> The different members of the Sequence container are listed. The object is a container of type “Sequence”. <x:xyz> Defines predicate “xyz” in namespace “x”. <rdf:Seq> Defines a container of type “Sequence”. <rdf:li> Defines members of Sequence container. Copyright IKS Consortium

Container Element - Alternative “An Alternative or Alt (a resource having type rdf:Alt) represents a group of resources or literals that are alternatives (typically for a single value of a property).” Example: Describe a list of possible colors of the car. http://www.w3.org/TR/2004/REC-rdf-primer-20040210/ Copyright IKS Consortium

Container Element - Alternative http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt http://example.org/Car http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://example.org/exterior#colors http://example.org/Black http://www.w3.org/1999/02/22-rdf-syntax-ns#_1 http://www.w3.org/1999/02/22-rdf-syntax-ns#_2 http://example.org/White http://www.w3.org/1999/02/22-rdf-syntax-ns#_3 http://example.org/Green Copyright IKS Consortium

Container Element - Alternative The subject “Car” is described by the predicate “colors”. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:c="http://example.org/exterior#" <rdf:Description rdf:about="http://example.org/Car"> <c:colors> <rdf:Alt> <rdf:li rdf:resource="http://example.org/Black"/> <rdf:li rdf:resource="http://example.org/White"/> <rdf:li rdf:resource="http://example.org/Green"/> </rdf:Alt> </c:colors> </rdf:Description> </rdf:RDF> The different members of the Alternative container are listed. The object is a container of type “Alternative”. <x:xyz> Defines predicate “xyz” in namespace “x”. <rdf:Alt> Defines a container of type “Alternative”. <rdf:li> Defines members of Alternative container. Copyright IKS Consortium

RDF Collections A RDF Container can be used to define groups, but lacks the ability to “close” them. That means to define that "these are all the members of the container". RDF Collections provide the ability to describe groups, that contain only the specified resources. “An RDF collection is a group of things represented as a list structure in the RDF graph.” Example: All equipment features of a car. http://www.w3.org/TR/2004/REC-rdf-primer-20040210/ Copyright IKS Consortium

RDF Collection http://example.org/Car http://example.org/features#equipment http://www.w3.org/1999/02/22-rdf-syntax-ns#_first http://example.org/AC http://www.w3.org/1999/02/22-rdf-syntax-ns#rest http://www.w3.org/1999/02/22-rdf-syntax-ns#_first http://example.org/CarRadio http://www.w3.org/1999/02/22-rdf-syntax-ns#rest http://www.w3.org/1999/02/22-rdf-syntax-ns#_first http://example.org/SeatHeating http://www.w3.org/1999/02/22-rdf-syntax-ns#rest http://www.w3.org/1999/02/22-rdf-syntax-ns#nil Copyright IKS Consortium

The predicate “equipment” is described by a Collection. RDF Collection The predicate “equipment” is described by a Collection. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:e="http://example.org/features#"> <rdf:Description rdf:about="http://example.org/Car"> <e:equipment rdf:parseType="Collection"> <rdf:Description rdf:about="http://example.org/AC"/> <rdf:Description rdf:about="http://example.org/CarRadio"/> <rdf:Description rdf:about="http://example.org/SeatHeating"/> </e:equipment> </rdf:Description> </rdf:RDF> <x:xyz rdf:parseType=“Collection”> Defines that the predicate “xyz” is described by a collection. Copyright IKS Consortium

Validation Tool http://www.w3.org/RDF/Validator/ Copyright IKS Consortium http://www.w3.org/RDF/Validator/

Semantic Layer Web Cake Web Engineering WT 2006/07 Chapter 4: Web Services 11.04.2017 Semantic Layer Web Cake A model for describing resources with properties and property values. A format for specifying structured data in a machine-readable form Unique identification of resources Semantic Web Layer Cake, Image source: http://www.w3.org/2007/03/layerCake.svg Copyright IKS Consortium © Gregor Engels University of Paderborn

How do I get all black Jaguars? RDF RDF provides a model for describing resources with properties and property values. @prefix ex: <http://www.example.org/>. ex:Car1 ex:Brand ex:Jaguar ex:Car1 ex:Colour “Black” ex:Car2 ex:Brand ex:Jaguar ex:Car2 ex:Colour “White” ex:Car3 ex:Brand ex:VW ex:Car3 ex:Colour “Black” How do I get all black Jaguars? Copyright IKS Consortium

SPARQL SPARQL Protocol and RDF Query Language W3C Recommendation since 2008 SPARQL provides a standard for querying information, that is specified in RDF SPARQL consists of three specifications Query language Query results XML format Data access protocol Copyright IKS Consortium

Exemplary SPARQL Query Web Engineering WT 2006/07 Chapter 4: Web Services 11.04.2017 Exemplary SPARQL Query “Return the models and prices for all cars of brand ‘Jaguar’ ” SPARQL Query: Exemplary Result: Declares namespaces for abbreviated resources identifiers. PREFIX ex: <http://example.org/> SELECT ?model ?price WHERE { ?car ex:Brand ex:Jaguar . ?car ex:Model ?model . ?car ex:Price ?price . } Identifies the variables to appear in the query results. Provides the basic graph pattern to match against the data graph. Model Price “XJ” “79.750,00” “XF” “44.900,00” Copyright IKS Consortium © Gregor Engels University of Paderborn

Basic Graph Patterns (BGP) A SPARQL query contains a set of triple patterns called a basic graph pattern Triple patterns are like RDF triples except that each of the subject, predicate and object may be a variable. A basic graph pattern matches a subgraph of the RDF data when RDF terms from that subgraph may be substituted for the variables and the result is a RDF graph equivalent to the subgraph. Variables are defined by “?varname” or “$varname” WHERE { ?car ex:Brand ex:Jaguar . ?car ex:Model ?model . ?car ex:Price ?price . } Copyright IKS Consortium

Group Graph Patterns “For a Group Graph Pattern, a set of graph patterns must all match” In a SPARQL query string, a group graph pattern is delimited with braces: {...} PREFIX ex: <http://example.org/> SELECT ?model ?price WHERE { { ?car ex:Brand ex:Jaguar . ?car ex:Model ?model . } ?car ex:Price ?price . } Copyright IKS Consortium

Optional Pattern Matching Basic graph patterns allow applications to make queries where the entire query pattern must match. It is useful to be able to have queries that allow information to be added to the solution where the information is available, but do not reject the solution because some part of the query pattern does not match. If the optional part does not match, it creates no bindings but does not eliminate the solution. Copyright IKS Consortium http://www.w3.org/TR/rdf-sparql-query

Optional Pattern Matching Web Engineering WT 2006/07 Chapter 4: Web Services 11.04.2017 Optional Pattern Matching Example: Result PREFIX ex: <http://example.org/> SELECT ?model ?price WHERE { ?car ex:Brand ex:Jaguar . ?car ex:Model ?model . OPTIONAL { ?car ex:Price ?price . } } Model Price “XJ” “79.750,00” “XF” “44.900,00” “S-Type” Copyright IKS Consortium © Gregor Engels University of Paderborn

Scope of Filters “A constraint, expressed by the keyword FILTER, is a restriction on solutions over the whole group in which the filter appears.” Result: PREFIX ex: <http://example.org/> SELECT ?model ?price WHERE { ?car ex:Brand ex:Jaguar . ?car ex:Model ?model . ?car ex:Price ?price . FILTER (?price < 50.000,00) } Model Price “XF” “44.900,00” Copyright IKS Consortium

Unary Operators (1/2) Operator Type(A) Result Type BOUND(A) variable xsd:boolean IsURI(A) RDF term isBLANK(A) isLITERAL(A) Copyright IKS Consortium

Unary Operators (2/2) Operator Type(A) Result Type STR(A) literal simple literal URI / IRI LANG(A) DATATYPE(A) typed literal Copyright IKS Consortium

Binary Operators (1/2) Operator Type(A) Type(B) Result Type A = B numeric simple literal xsd:string xsd:boolean xsd:dateTime A != B A < B A > B A <= B A >= B Copyright IKS Consortium

Binary Operators (2/2) Operator Type(A) Type(B) Result Type sameTERM (A,B) RDF term xsd:boolean langMATCHES(A,B) simple literal REGEX Filter can be combined by “&&” or “||” Copyright IKS Consortium

Alternative Graph Patterns “SPARQL provides a means of combining graph patterns so that one of several alternative graph patterns may match. If more than one of the alternatives matches, all the possible pattern solutions are found.” Pattern alternatives are syntactically specified with the UNION keyword. PREFIX ex: <http://example.org/> SELECT ?office WHERE { ?x rdf:type ex:CarManufacturer . { ?x ex:Headquarter ?office . } UNION { ?x ex:Office ?office . } } Copyright IKS Consortium

Solution Sequences and Modifiers “Query patterns generate an unordered collection of solutions. These solutions are then treated as a sequence (a solution sequence), initially in no specific order; any sequence modifiers are then applied to create another sequence.” There are several use cases in which the results shall be presented in a defined order, e.g. alphabetical order Shall duplicates be presented or deleted? Copyright IKS Consortium

Order By “Following the ORDER BY clause is a sequence of order comparators, composed of an expression and an optional order modifier (either ASC() or DESC()). Each ordering comparator is either ascending (indicated by the ASC() modifier or by no modifier) or descending (indicated by the DESC() modifier).” PREFIX ex: <http://example.org/> SELECT ?constructionYear ?price WHERE { ?car ex:Brand ex:Jaguar . ?car ex:ConstructionYear ?constructionYear . ?car ex:Price ?price . } ORDER BY DESC(?constructionYear) ?price . Copyright IKS Consortium

Some more Solution Sequence Modifiers Web Engineering WT 2006/07 Chapter 4: Web Services 11.04.2017 Some more Solution Sequence Modifiers LIMIT “The LIMIT clause puts an upper bound on the number of solutions returned. If the number of actual solutions is greater than the limit, then at most the limit number of solutions will be returned.” OFFSET “OFFSET causes the solutions generated to start after the specified number of solutions. An OFFSET of zero has no effect.” SELECT DISTINCT “The DISTINCT solution modifier eliminates duplicate solutions. Duplicates are eliminated before either limit or offset is applied.” Copyright IKS Consortium © Gregor Engels University of Paderborn

Semantic Web Layer Cake Web Engineering WT 2006/07 Chapter 4: Web Services 11.04.2017 Semantic Web Layer Cake A language for querying information specified in RDF. A model for describing resources with properties and property values. A format for specifying structured data in a machine-readable form Unique identification of resources Semantic Web Layer Cake, Image source: http://www.w3.org/2007/03/layerCake.svg Copyright IKS Consortium © Gregor Engels University of Paderborn

Lessons Learned Now you should know ... ... the general idea of the Semantic Web and the differences to the World Wide Web. ... the underlying technologies of the Semantic Web. ... how resources can be identified and specified. .. the importance of XML for expressing data in a machine-readable way. ... the concept of the RDF and the way it is expressed (e.g.: RDF/XML). ... how SPARQL can used to query data specified in RDF. Copyright IKS Consortium

References and Additional Material Introduction to RDF http://www.w3schools.com/rdf/rdf_intro.asp RDF Syntax Specification http://www.w3.org/TR/2004/REC-rdf-syntax-grammar-20040210 RDF Validation Tool http://www.w3.org/RDF/Validator/ Copyright IKS Consortium