Resource Description Framework (RDF) A basis for knowledge - - PowerPoint PPT Presentation

resource description framework rdf
SMART_READER_LITE
LIVE PREVIEW

Resource Description Framework (RDF) A basis for knowledge - - PowerPoint PPT Presentation

Resource Description Framework Resource Description Framework (RDF) A basis for knowledge representation on the Web Simple language to capture assertions (as statements) Captures elements of knowledge about a resource Facilitates


slide-1
SLIDE 1

Resource Description Framework

Resource Description Framework (RDF)

A basis for knowledge representation on the Web

◮ Simple language to capture assertions (as statements)

◮ Captures elements of knowledge about a resource ◮ Facilitates incremental acquisition of knowledge ◮ Supports inferencing to extract and use knowledge

◮ Consolidates old KR ideas

◮ Frames ◮ Object-oriented modeling

◮ Applies URIs to

◮ Clarify meanings ◮ Handle vocabulary differences ◮ Crucial for heterogeneity Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 75

slide-2
SLIDE 2

Resource Description Framework

Why RDF?

◮ Whereas XML and JSON

◮ Produce a document tree ◮ Don’t identify the content represented by a document, i.e., ◮ Concepts the document is about ◮ Relationships among the concepts ◮ Enable multiple representations for the same content

◮ RDF expresses the content itself in a standard form

Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 76

slide-3
SLIDE 3

Resource Description Framework

Resources and Literals

◮ RDF captures descriptions of resources ◮ A resource is an “addressable” object

◮ Of which a description can be given ◮ Identified via a URI ◮ Worth talking about and possible to talk about

◮ A literal is something simpler

◮ A value, e.g., string or integer ◮ Cannot be given a description Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 77

slide-4
SLIDE 4

Resource Description Framework

Statements or Triples

◮ RDF is based on a simple grammar

◮ An RDF document is simply a set of statements also known as triples

◮ Each statement consists of

◮ Subject: a resource ◮ Object: a resource or a literal ◮ Predicate: a resource

◮ Comes with RDFS, a vocabulary to create vocabularies

Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 78

slide-5
SLIDE 5

Resource Description Framework

Rendering RDF

◮ RDF is not about the surface syntax but about the underlying content ◮ Using the XML serialization of RDF

◮ RDF is not tied to XML ◮ Standard XML namespace syntax ◮ Namespaces defined by the RDF standard ◮ Typically abbreviated rdf and rdfs Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 79

slide-6
SLIDE 6

Example of N-Triples Notation

The basic syntax: Subject-Predicate-Object

<http ://www. w i l e y . com/SOC > <http :// p u r l . org /dc/ elements /1.1/ t i t l e > ” S e r v i c e −Oriented Computing” . <http ://www. w i l e y . com/SOC > <http :// p u r l . org /dc/ elements /1.1/ c r e a t o r > ”Munindar” . <http ://www. w i l e y . com/SOC > <http :// p u r l . org /dc/ elements /1.1/ c r e a t o r > ” Michael ” . <http ://www. w i l e y . com/SOC > <http :// p u r l . org /dc/ elements /1.1/ p u b l i s h e r > ” Wiley ” .

Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 80

slide-7
SLIDE 7

Example in XML

Using the Dublin Core vocabulary

<?xml v e r s i o n=’ 1.0 ’ encoding=’UTF−8 ’ ?> <rdf:RDF x m l n s : r d f=” h t t p : //www. w3 . org /1999/02/22− rdf −syntax −ns#” xmlns:dc=” h t t p : // p u r l . org /dc/ elements /1.1/ ”> <r d f : D e s c r i p t i o n r d f : a b o u t=” h t t p : //www. w i l e y . com/SOC”> < d c : t i t l e>S e r v i c e −Oriented Computing</ d c : t i t l e> <d c : c r e a t o r>Munindar</ d c : c r e a t o r> <d c : c r e a t o r>Michael</ d c : c r e a t o r> <d c : p u b l i s h e r>Wiley</ d c : p u b l i s h e r> </ r d f : D e s c r i p t i o n> </ rdf:RDF> ◮ rdf:Description gathers statements about one subject ◮ Distinguish rdf:ID from rdf:about

Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 81

slide-8
SLIDE 8

Resource Description Framework

Exercise

Reproduce previous example in JSON Linked Data syntax

Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 82

slide-9
SLIDE 9

Resource Description Framework

Exercise

◮ Graphs represent binary relationships naturally

◮ The vendor ships SKU-99

◮ Express a three-party relationship

◮ The vendor ships SKU-99 quickly ◮ Hint: think of gerunds from natural language grammar Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 83

slide-10
SLIDE 10

Resource Description Framework

Multiparty Relationships

◮ An edge has two terminals, so limited to binary relationships ◮ To represent a multiparty relationship, introduce a resource

corresponding to the relationship itself

◮ That’s what a gerund does in NL ◮ Analogous to an association entity ◮ Include edges originating or targeting this resource Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 84

slide-11
SLIDE 11

Resource Description Framework

RDF Schema

In essence, an object-oriented type system built on top of RDF

◮ Defines

rdfs:Class, rdfs:subClassOf, rdfs:Resource, rdfs:Literal, rdfs:Property, rdfs:subPropertyOf, rdfs:range, rdfs:domain, rdfs:label, rdfs:comment, rdfs:seeAlso

◮ Applications of RDF Schema

◮ Definining custom vocabularies ◮ Discussed in conjunction with OWL, which greatly enhances the above Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 85

slide-12
SLIDE 12

Resource Description Framework

RDF Schema versus XML Schema

Both help define custom vocabularies

◮ An XML Schema document gives us syntactic details ◮ An RDF Schema document gives us a way to capture part of the

meaning through a standard vocabulary (rdfs)

◮ An OWL document (next topic) captures richer meaning

Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 86

slide-13
SLIDE 13

Resource Description Framework

Collections

◮ Function as containers

◮ rdf:Bag ◮ rdf:Sequence ◮ rdf:Alt (choice)

◮ Accompanied by properties to extract elements

◮ Schematically represented as rdf: 1, rdf: 2, and so on ◮ That is, the properties 1, 2, . . . are defined in the rdf namespace

◮ Collections are applied within OWL

◮ Not otherwise emphasized in this course Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 87

slide-14
SLIDE 14

Resource Description Framework

Reification Motivation

◮ Express a quotation

◮ Alice says the vendor ships SKU-99

◮ Hint(?): In RDF, we can only talk about resources

◮ And literals, but literals are where a graph ends (no out edges) Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 88

slide-15
SLIDE 15

Resource Description Framework

Reification of Statements

◮ Reify: to make referenceable, essential for quoting statements to

◮ Agree or disagree with them ◮ Assert modalities: possible, desirable, . . .

◮ Make a statement into a resource; then talk about it

◮ rdf:Statement is a class ◮ the given statement’s rdf:type is rdf:Statement ◮ rdf:Statement defines important properties: rdf:subject, rdf:object, and

rdf:predicate

Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 89

slide-16
SLIDE 16

Resource Description Framework

Reification Exercise

Produce a model using RDF and RDF Schema of the following assertions.

◮ (a) Statement (b) is false. ◮ (b) Statement (a) is true.

Express your solution as a graph with suitable annotations.

◮ Notation

◮ Resources: solid ellipses ◮ Properties (hence, also resources): dashed ellipses ◮ Literals: rectangles

◮ Definitions

◮ Two resources named true and false ◮ Property: is Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 90

slide-17
SLIDE 17

Resource Description Framework

Reification Exercise Solution

Problem-specific constructs: (a), (b), True, False, hasName is Generic: everything else

Statement (a) (b) ”false” False is True ”true” type type subject

  • bject

predicate hasName subject

  • bject

predicate hasName

Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 91

slide-18
SLIDE 18

Resource Description Framework

RDF Summary

◮ RDF captures deeper structure than XML

◮ RDF captures graphs in general ◮ Meaning depends on the graph, not the document that represents a

graph

◮ RDF is based on an simple linguistic representation: subject,

predicate, object

◮ But webified via URIs

◮ RDF comes prepackaged with RDF Schema

◮ In essence, an object-oriented type system: a vocabulary to create new

vocabularies, such as

◮ Friend of a Friend (FOAF) ◮ Dublin Core ◮ Mozilla extensions ◮ Provides a basis for OWL (next topic) Munindar P. Singh (NCSU) Service-Oriented Computing Fall 2017 92