Foundations of Semantic Web Technologies - Introduction to RDF

429 downloads 259 Views 533KB Size Report
Apr 9, 2013 ... Hypertableau I. 7 JUN DS3. Q&A Session. 19 JUL DS5. TU Dresden, 9 Apr 2013. Foundations of Semantic Web Technologies slide 2 of 78 ...
FOUNDATIONS OF SEMANTIC WEB TECHNOLOGIES Introduction to RDF Sebastian Rudolph

Dresden, 9 Apr 2013

Content Overview & XML Introduction into RDF RDFS – Syntax & Intuition RDFS – Semantics RDFS Rule-based Reasoning Tutorial 1 OWL – Syntax & Intuition Tutorial 2 OWL & Description Logics OWL 2 Tutorial 3 Tableau I Tableau II Tutorial 4 Tableau – Optimizations Hypertableau I TU Dresden, 9 Apr 2013

9 APR DS2 9 APR DS3 12 APR DS5 16 APR DS2 16 APR DS3 19 APR DS5 26 APR DS5 3 MAY DS5 7 MAY DS2 7 MAY DS3 10 MAY DS5 14 MAY DS2 14 MAY DS3 17 MAY DS5 7 JUN DS2 7 JUN DS3

Hypertableau II Tutorial 5 SPARQL Syntax & Intuition SPARQL – Semantics SPARQL 1.1 SPARQL Entailment Tutorial 6 SPARQL Implementation Ontology Editing Ontology Engineering Tutorial 7 Linked Data Applications Test Exam Test Exam Evaluation Q&A Session

Foundations of Semantic Web Technologies

7 JUN DS5 11 JUN DS2 11 JUN DS3 14 JUN DS2 14 JUN DS3 14 JUN DS5 18 JUN DS2 18 JUN DS3 2 JUL DS2 2 JUL DS3 9 JUL DS2 9 JUL DS3 12 JUL DS5 16 JUL DS2 16 JUL DS3 19 JUL DS5 slide 2 of 78

Introduction to RDF

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 3 of 78

Introduction to RDF

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 3 of 78

Agenda • • • • • • • • •

XML – Motivation RDF data model Syntax for RDF: Turtle and XML Datatypes Multi-Valued Relationships Blank Nodes Lists Graph Definitions RDF in Practice

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 4 of 78

Agenda • • • • • • • • •

XML – Motivation RDF data model Syntax for RDF: Turtle and XML Datatypes Multi-Valued Relationships Blank Nodes Lists Graph Definitions RDF in Practice

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 4 of 78

Disadvantages of XML • tag names ambiguous (can be tackled by name spaces and URIs) • tree structure not optimal for – intuitive description of the data – information integration

• Example: how to encode in a tree the sentence: “The book ‘Semantic Web – Grundlagen’ was published by Springer-Verlag.”

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 5 of 78

Modeling Problems in XML “The book ‘Semantic Web – Grundlagen’ was published by Springer-Verlag.”

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 6 of 78

Modeling Problems in XML “The book ‘Semantic Web – Grundlagen’ was published by Springer-Verlag.” Springer-Verlag Semantic Web -- Grundlagen

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 6 of 78

Modeling Problems in XML “The book ‘Semantic Web – Grundlagen’ was published by Springer-Verlag.” Springer-Verlag Semantic Web -- Grundlagen

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 6 of 78

Modeling Problems in XML “The book ‘Semantic Web – Grundlagen’ was published by Springer-Verlag.” Springer-Verlag Semantic Web -- Grundlagen

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 6 of 78

RDF: Graphs instead of Trees Solution: Representation as (directed) Graphs http://example.org/SemanticWeb

ex:publishedBy

http://springer.com/Publisher

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 7 of 78

Agenda • • • • • • • • •

XML – Motivation RDF data model Syntax for RDF: Turtle and XML Datatypes Multi-Valued Relationships Blank Nodes Lists Graph Definitions RDF in Practice

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 8 of 78

General Remarks about RDF • • • •

“Resource Description Framework” W3C Recommendation (http://www.w3.org/RDF) currently being revised RDF is a data model – originally: assign metadata to Web resources, later more general usage – encodes structured information – universal, machine-readable exchange format

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 9 of 78

Constituents of RDF Graphs • URIs – for uniquely referencing resources – (already discussed at XML lecture)

• literals – describe data values that do not have an independent existence

• blank nodes – allow for stating the existence of some individual (and describing its properties) without giving it a name

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 10 of 78

Literals • • • •

for representing data values noted as strings interpreted by an associated datatype literals without datatype are treated like strings

http://example.org/publishedBy

http://example.org/SemanticWeb

http://springer.com/Publisher

http://example.org/Title Semantic Web – Grundlagen

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

http://example.org/Name Springer Verlag

slide 11 of 78

Graph as a Set of Triples • there are several different ways to represent graphs • we use list of (node-edge-node) triples http://example.org/publishedBy

http://example.org/SemanticWeb

http://springer.com/Publisher

http://example.org/Titel Semantic Web – Grundlagen

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

http://example.org/Name Springer Verlag

slide 12 of 78

RDF Triple Constituents of an RDF triple subject

predicate

object

http://example.org/publishedBy

http://example.org/SemanticWeb

http://springer.com/Publisher

• inspired by linguistic but not always an exact match • permitted occurrences of constituents:



subject : URI or blank node predicate: URI (also called properties) object: URI or blank node or literal node and edge labels are unique, thus the original graph can be reconstructed from the list of triples

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 13 of 78

Agenda • • • • • • • • •

XML – Motivation RDF data model Syntax for RDF: Turtle and XML Datatypes Multi-Valued Relationships Blank Nodes Lists Graph Definitions RDF in Practice

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 14 of 78

Simple Syntax for RDF • direct enumeration of triples: – N3: “Notation 3” – comprehensive formalism – N-Triples: fraction of N3 – Turtle: extension of N-Triples (by abbreviations)

• Turtle syntax: – – – –

URIs in angular brackets literals in quotes tripels terminated by full stop spaces and line breaks outside such delimiters are ignored

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 15 of 78

Turtle Syntax: Abbreviations Example . "Semantic Web -- Grundlagen" . "Springer Verlag" . In Turtle we can define prefix abbreviations: @prefix ex: . @prefix springer: . ex:SemanticWeb ex:publishedBy springer:Publisher . ex:SemanticWeb ex:Title "Semantic Web -- Grundlagen" . springer:Publisher ex:Name "Springer Verlag" . TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 16 of 78

Turtle Syntax: Abbreviations Multiple triples with the same subject can be grouped: @prefix ex: . @prefix springer: . ex:SemanticWeb

ex:publishedBy springer:Publisher ; ex:Title "Semantic Web -- Grundlagen" . springer:Publisher ex:Name "Springer Verlag" .

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 17 of 78

Turtle Syntax: Abbreviations Multiple triples with the same subject can be grouped: @prefix ex: . @prefix springer: . ex:SemanticWeb

ex:publishedBy springer:Publisher ; ex:Title "Semantic Web -- Grundlagen" . springer:Publisher ex:Name "Springer Verlag" .

likewise triples with coinciding subject and predicate: @prefix ex:

.

ex:SemanticWeb ex:Author ex:Hitzler, ex:Kr¨ otzsch, ex:Rudolph, ex:Sure ; ex:Titel "Semantic Web -- Grundlagen" .

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 17 of 78

XML Syntax of RDF • Turtle intuitively understandable, machine-processable • yet, better tool support and available libraries for XML • thus: XML syntax more wide-spread

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 18 of 78

XML Syntax of RDF • like in XML, name spaces are used in order to disambiguate tag names • RDF-specific tags have a predefined name space, by convention abbreviated with ’rdf’ TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 19 of 78

XML Syntax of RDF • the rdf:Description element encodes the subject (the URI of which is stated as the value of the associated rdf:about attribute)

• every element directly nested into an rdf:Description element denotes a predicate (the URI of which is the element name),

• predicate elements in turn contain the triple’s object as rdf:Description element : : : TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 20 of 78

XML Syntax of RDF ex:publishedBy ex:SemanticWeb TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

springer:Publisher slide 21 of 78

XML Syntax of RDF ex:publishedBy ex:SemanticWeb TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

springer:Publisher slide 21 of 78

XML Syntax of RDF ex:publishedBy ex:SemanticWeb TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

springer:Publisher slide 21 of 78

XML Syntax of RDF ex:publishedBy ex:SemanticWeb TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

springer:Publisher slide 21 of 78

XML Syntax of RDF • untyped literals can be included as free text into the predicate element • condensed forms admissible: – one subject containing several property elements – one object description serves as subject for another triple Semantic Web -- Grundlagen Springer VerlagName> ex:publishedBy springer:Publisher ex:SemanticWeb ex:Title Semantic Web – Grundlagen

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

ex:Name Springer Verlag

slide 22 of 78

XML Syntax of RDF • alternative (but semantically equivalent) representation of literals as XML attributes

• property URIs are then used as attribute names • object URIs can be given as value of the rdf:resource attribute inside a property tags ex:publishedBy ex:SemanticWeb

ex:Title

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies Semantic Web – Grundlagen

springer:Publisher

ex:Name

slide 23 of 78 Springer Verlag

RDF/XML Syntax: Complications • name spaces are needed (not just for abbreviation reasons), because colons inside XML elements and attributes are always interpreted as name space delimiters

• problem: in XML, no name spaces in attribute values allowed (would be interpreted as URI schema), thus we cannot write: rdf:about="ex:SemanticWeb"

• “work around” via XML entities: Deklaration: Usage: rdf:resource="&ex;SemanticWeb"

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 24 of 78

RDF/XML Syntax: Base URIs • usage of base URIs:



• relative URIs (i.e. those that are to be preceded by the given base URI) are recognized by the absence of a schema part

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 25 of 78

Agenda • • • • • • • • •

XML – Motivation RDF data model Syntax for RDF: Turtle and XML Datatypes Multi-Valued Relationships Blank Nodes Lists Graph Definitions RDF in Practice

TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 26 of 78

Datatypes Example: xsd:decimal

For xsd:decimal holds ”3.14”=”+03.14” But not for xsd:string ! TU Dresden, 9 Apr 2013

Foundations of Semantic Web Technologies

slide 27 of 78

Datatypes in RDF • by now: untyped literals, treated like strings (e.g.: ”02”