important concepts from the w3c rdf vocabulary/schema sungtae kim snu oopsla lab. august 19, 2004

26
Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

Upload: sharon-simmons

Post on 18-Jan-2016

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

Important Concepts from the W3CRDF Vocabulary/Schema

Sungtae KimSNU OOPSLA Lab.

August 19, 2004

Page 2: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

Contents

Introduction RDF Vocabulary : Describing the Data Core RDF Schema Elements Refining RDF Vocabularies with

Constraints RDF Schema Alternatives

Page 3: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

Introduction

RDF (Resource Description Framework) specification Syntax specification

A way of describing data

Schema specification Domain-neutral way of describing the metadata Define element domain Describe how these elements relate to one another

Page 4: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

RDF Vocabulary : Describing the Data (1/3)

Metadata – data about data Same specification can be used with many

different domain

Concept of metadata’s role Relational database

Store many different types of data by using metadata structures

Page 5: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

RDF Vocabulary : Describing the Data (2/3)

Example

Changing of the domain Domain-specific storage constructs become useless

CUSTOMER

PK CUSTOMER_ID

CUSTOMER_ORDER

PK,FK1PK,FK2

CUSTOMER IDORDER_ID

ORDER

PK ORDER_ID

Page 6: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

RDF Vocabulary : Describing the Data (3/3)

Multiple use of the same storage mechanism Relational database schema

defines below Database tables Primary and foreign key Columns

Provide a domain-neutral description of information

Example MS SQL Server

Same syntax for web resource rdf:Description , not WEB-PAGE

RDF Schema Provides the resources necessary

to describe the objects and properties of a domain-specific schema -- a vocabulary used to describe objects and their attributes and relationships within a specific area of interest

Table 1 Table 2 Table 3 ….

customer

order Customer_order

table Col name1

Col name2

Col name3

….

order data count …

customer

name Address …

Schema table

Schema column

Page 7: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

Core RDF Schema Elements (1/16)

RDF Schema elements Marked by a specific namespace

xmlns:rdfs=http://www.w3c.org/2000/01/rdf-schema#

Overview of the RDF Schema classes rdfs:Resource rdfs:Class rdfs:Literal rdfs:XMLLiteral rdfs:Container rdfs:ContainerMembershipProperty rdfs:Datatype

Page 8: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

Core RDF Schema Elements (2/16)

rdfs:Resource All resources within RDF are implicitly member

rdfs:Class

<? Xml version=“1.0”?><rdf:RDF

xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#”xmlns:pstcn=“http://buringbird.net/postcon/elements/1.0”><rdf:Descriptoin

rdf:about=“http://burningbird.net/articles/monsters3.htm”><pstcn:author>Shelley Powers></pstcn:author><pstcn:title>Architeuthis Dux</pstcn:title>

<rdf:Description></rdf:RDF>

<rdfs:Class rdf:ID=“Article”><rdfs:subClassOf rdf:resource=“

http://www.w3.org/2000/01/rdf-schema#Resource/”></rdfs:Class>

Page 9: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

Core RDF Schema Elements (3/16)

rdfs:Container Superclass of all RDF container elements

rdf:Bag rdf:Seg rdf:Alt

rdfs:ContainerMembershipProperty Resource is a member of a container

_1, _2, _3 and so on

Page 10: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

Core RDF Schema Elements (4/16)

rdfs:Datatype Class of all data types Subclass of rdfs:Literal

rdfs:XMLLiteral Allows to embed XML into the RDF/XML

document Subclass of rdfs:Literal Instance of rdfs:Datatype Class of all XML literals

Page 11: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

Core RDF Schema Elements (5/16)

A few RDF classes Cross the boundary between the

metalanguage and instances of the same rdf:Statement

Include as member al reified RDF statements rdf:Bag, rdf:Seq, rdf:Alt

Used to group members rdf:List

Has members all RDF lists rdf:Property

Define the attributes that, in turn, describe the resource

Page 12: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

Core RDF Schema Elements (6/16)

RDF Schema for Article<? Xml version=“1.0”?><rdf:RDF

xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#”xmlns:rdfs=“http://www.w3.org/2000/01/rdf-schema#”xmlns:pstcn=“http://buringbird.net/postcon/elements/1.0”>

<rdfs:Class rdf:about=“http://burningbird.net/postcon/elements/1.0/Article”><rdfs:subClassOf rdf:resource=“

http://www.w3.org/2000/01/rdf-schema#Resource”/></rdfs:Class>

<rdf:Property rdf:about=“http://burningbird.net/postcon/elements/1.0/title”><rdfs:domain rdf:resource=

http://burningbird.net/postcon/elements/1.0/Article” /></rdf:Property>

<rdf:Property rdf:about=“http://burningbird.net/postcon/elements/1.0/author”>

<rdfs:domain rdf:resource=http://burningbird.net/postcon/elements/1.0/Article” />

</rdf:Property>

</rdf:RDF>

Page 13: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

Core RDF Schema Elements (7/16)

Demonstrations of the RDF Schema Properties RDF specification’s purpose

Purely to define resource and associated facts, and then provide a way to allow these resource/fact mappings to interact

RDF Schema specification’s purpose Statement about each resource Individual properties

Only difference between two One is instance of business data (such as Article) The other is metadata ( related to the RDF model)

Page 14: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

Core RDF Schema Elements (8/16)

Core properties (from both the RDF and RDFS namespaces ) of RDF Schema

rdfs:subClassOf rdfs:seeAlso rdfs:member rdfs:label rdf:subject rdf:object rdf:rest rdfs:range

rdfs:subPropertyOf rdfs:isDefinedBy rdfs:comment rdf:type rdf:predicate rdf:first rdfs:domain rdf:value

Page 15: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

Core RDF Schema Elements (9/16)

rdfs:subClassOf Identify a class that is a subclass of another

<rdfs:Class rdf:ID=“WebPage”>rdfs:subClassOf rdf:resource=“

http://www.w3.org/2000/01/rdf-schema#Resource” /></rdfs:Class>

<rdfs:Class rdf:ID=“Article”>rdfs:subClassOf rdf:resource=“

http://burningbird.net/schema#WebPage” /></rdfs:Class>

Page 16: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

Core RDF Schema Elements (10/16)

rdfs:subPropertyOf<? Xml version=“1.0”?><rdf:RDF

xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#”xmlns:rdfs=“http://www.w3.org/2000/01/rdf-schema#”xmlns:pstcn=“http://buringbird.net/postcon/elements/1.0”>

<rdfs:Class rdf:about=“http://burningbird.net/postcon/elements/1.0/Article”><rdfs:subClassOf rdf:resource=“

http://www.w3.org/2000/01/rdf-schema#Resource”/></rdfs:Class>

<rdf:Property rdf:about=“http://burningbird.net/postcon/elements/1.0/title”><rdfs:domain rdf:resource=

http://burningbird.net/postcon/elements/1.0/Article” /></rdf:Property>

<rdf:Property rdf:about=“http://burningbird.net/postcon/elements/1.0/author”><rdfs:domain rdf:resource=

http://burningbird.net/postcon/elements/1.0/Article” /></rdf:Property>

<rdf:Property rdf:about=“http://burningbird.net/postcon/elements/1.0/primaryAuthor”><rdfs:domain rdf:resource=“

http://burningbird.net/postcon/elements/1.0/Article” /><rdfs:subPropertyOf rdf:resource=“

http://burningbird.net/postcon/elements/1.0/author” /></rdf:Property>

<rdf:Property rdf:about=“http://burningbird.net/postcon/elements/1.0/secondaryAuthor”><rdfs:domain rdf:resource=“

http://burningbird.net/postcon/elements/1.0/Article” /><rdfs:subPropertyOf rdf:resource=“

http://burningbird.net/postcon/elements/1.0/author” /></rdf:Property>/rdf:RDF>

Page 17: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

Core RDF Schema Elements (11/16)

rdfs:seeAlso Another resource contains additional

information<rdfs:Class rdf:about=“http://burningbird.net/postcon/elements/1.0/Article/History” ><rdfs:subClassOf rdf:resource=“

http://www.w3.org/2000/01/rdf-schema#Resource” /></rdfs:Class>

<rdfs:Class rdf:about=“http://burningbird.net/postcon/elements/1.0/Article” ><rdfs:subClassOf rdf:resource=

http://www.w3.org/2000/01/rdf-schema#Resource” /><rdfs:seeAlso rdf:resource=“

http://burningbird.net/postcon/elements/1.0/Article/History” /></rdfs:Class>

Page 18: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

Core RDF Schema Elements (12/16)

rdfs:isDefinedBy Identify the namespace for the resource

<rdfs:Class rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement” ><rdfs:isDefinedBy rdf:resource=“http://www.w3.org/1999/02/22-rdf-syntax-

ns” /><rdfs:label xml:lang=“en”>Statement</rdfs:label><rdfs:subClassOf rdf:resource=“

http://www.w3.org/2000/01/rdf-schema#Resource” /><rdfs:comment>The class of RDF statement.</rdfs:comment>

</rdfs:Class>

<rdfs:Class rdf:about="http://www.w3.org/2000/01/rdf-schema#Literal” ><rdfs:isDefinedBy rdf:resource=“http://www.w3.org/2000/01/rdf-

schema#” /><rdfs:label xml:lang=“en”>Literal</rdfs:label><rdfs:comment>This represents the set of atomic values, eg. Textual

string</rdfs:comment></rdfs:Class>

Page 19: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

Core RDF Schema Elements (13/16)

rdfs:member Superproperty for each numbered container element

_1, _2, and so on

rdfs:comment Provide human readability to an RDF model Provide documentation of resources

rdfs:label Provide a readable version of the resource’s name Can attach xml:lang

Page 20: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

Core RDF Schema Elements (14/16)

RDF Schema documentation elements<? xml version=“1.0”?><rdf:RDF

xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#”xmlns:rdfs=“http://www.w3.org/2000/01/rdf-schema#”xmlns:pstcn=“http://buringbird.net/postcon/elements/1.0”>

<rdfs:Class rdf:about=“http://burningbird.net/postcon/elements/1.0/Article”><rdfs:subClassOf rdf:resource=“

http://www.w3.org/2000/01/rdf-schema#Resource”/><rdfs:comment>Unique Online article</rdfs:comment><rdfs:label xml:lang=“en”>Article</rdfs:label>

</rdfs:Class>

<rdf:Property rdf:about=“http://burningbird.net/postcon/elements/1.0/title”><rdf:type rdf:resource=“http://www.w3.org/2000/01/rdf-schema#Prpoerty

” /><rdfs:domain rdf:resource=“

http://burningbird.net/postcon/elements/1.0/Article” /><rdfs:comment>Online Article Title</rdfs:comment><rdfs:label xml:lang=“en”>Article</rdfs:label>

</rdf:Property>

<rdf:Property rdf:about=“http://burningbird.net/postcon/elements/1.0/author”><rdf:type rdf:resource=“http://www.w3.org/2000/01/rdf-schema#Prpoerty

” />

<rdfs:domain rdf:resource=“http://burningbird.net/postcon/elements/1.0/Article” />

<rdfs:comment>Primary author of article</rdfs:comment><rdfs:label xml:lang=“en”>Author</rdfs:label>

</rdf:Property></rdf:RDF>

Page 21: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

Core RDF Schema Elements (15/16)

rdf:type Define the type of resources Usually assumed and is not explicitly given

<rdfs:Property rdf:about=“http://burningbird.net/postcon/elements/1.0/author” >

<rdfs:domain rdf:resource=http://burningbird.net/postcon/elements/1.0/Article” />

<rdfs:comment>Primary author of article</rdfs:comment><rdfs:label xml:lang=“en”>Author</rdfs:label><rdf:type rdf:resource=“http://www.w3.org/1999/02/22-rdf-

schema#Property” /></rdfs:Property>

Page 22: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

Core RDF Schema Elements (16/16)

rdf:subject, rdf:predicate, rdf:object Used with reification to explicitly define an RDF

statement

rdf:first, rdf:rest Explicitly define the relationships within a

collection

Page 23: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

Refining RDF Vocabularies with Constraints (1/2)

rdfs:domain Associate a property with the resource An RDF property can be used for more than

one resource type<? Xml version=“1.0”?><rdf:RDF

xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#”xmlns:rdfs=“http://www.w3.org/2000/01/rdf-schema#”xmlns:pstcn=“http://buringbird.net/postcon/elements/1.0”>

<rdfs:Class rdf:about=“http://burningbird.net/postcon/elements/1.0/Article”><rdfs:subClassOf rdf:resource=“

http://www.w3.org/2000/01/rdf-schema#Resource”/><rdfs:comment>Unique Online article</rdfs:comment><rdfs:label xml:lang=“en”>Article</rdfs:label>

</rdfs:Class>

<rdf:Property rdf:about=“http://burningbird.net/postcon/elements/1.0/title”><rdf:type rdf:resource=http://www.w3.org/2000/01/rdf-schema#Prpoerty /><rdfs:domain rdf:resource=

http://burningbird.net/postcon/elements/1.0/Article” /><rdfs:comment>Online Article Title</rdfs:comment><rdfs:label xml:lang=“en”>Article</rdfs:label>

</rdf:Property>

<rdf:Property rdf:about=“http://burningbird.net/postcon/elements/1.0/author”><rdf:type rdf:resource=http://www.w3.org/2000/01/rdf-schema#Prpoerty /><rdfs:domain rdf:resource=

http://burningbird.net/postcon/elements/1.0/Article” /><rdfs:comment>Primary author of article</rdfs:comment><rdfs:label xml:lang=“en”>Author</rdfs:label>

</rdf:Property></rdf:RDF>

Page 24: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

Refining RDF Vocabularies with Constraints (2/2)

rdfs:range Only one RDF range constraint can be attached to any

property Can use a master class for a property (more than one

data type)<? Xml version=“1.0”?><rdf:RDF

xmlns:rdf=“http://www.w3.org/1999/02/22-rdf-syntax-ns#”xmlns:rdfs=“http://www.w3.org/2000/01/rdf-schema#”xmlns:pstcn=“http://buringbird.net/postcon/elements/1.0”>

<rdfs:Class rdf:about=“http://burningbird.net/postcon/elements/1.0/WebPage”><rdfs:subClassOf rdf:resource=“http://www.w3.org/2000/01/rdf-schema#Resource”/>

</rdfs:Class>

<rdf:Class rdf:about=“http://burningbird.net/postcon/elements/1.0/Article”><rdf:subClassOf rdf:resource=“http://burningbird.net/postcon/elements/1.0/WebPage” />

</rdf:Class>

<rdf:Class rdf:about=“http://burningbird.net/postcon/elements/1.0/Example”><rdf:subClassOf rdf:resource=“http://burningbird.net/postcon/elements/1.0/WebPage” />

</rdf:Class>

<rdf:Class rdf:about=“http://burningbird.net/postcon/elements/1.0/Directory”><rdf:subClassOf rdf:resource=“http://www.w3.org/2000/01/rdf-schema#Resource” />

</rdf:Class>

<rdf:Property rdf:about=“http://buringbird.net/postcon/elements/1.0/contains”><rdf:domain rdf:resource=“http://burningbird.net/postcon/elements/1.0/Directory” /><rdf:range rdf:resource=http://burningbird.net/postcon/elements/1.0/WebPage” />

</rdf:Property></rdf:RDF>

WebPage

ExampleArticle

Directory

domainrange

Page 25: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

RDF Schema Alternatives (1/2)

DTD(Document Type Declarations) & XML Schema<!ELEMENT Items(item*)

<!ELEMENT item(productName, quantity, USPrice, comment? shipDate?)>

<!ATTLIST item partNum CDATA #REQUIRED>

<!ELEMENT productName (#PCDATA)>

<!ELEMENT quantity (#PCDATA)>

<!ELEMENT USPrice(#PCDATA)>

<!ELEMENT comment(#PCDATA)>

<!ELEMENT shipDate(#PCDATA)>

<xsd:element name=“Items”> <xsd:complexType name=“items”> <xsd:sequence> <xsd:element name=“item” minOccurs=“0” maxOccurs=“unbounded”> <xsd:complexType> <xsd:sequence> <xsd:element name=“productName” type=“xsd:string”/> <xsd:element name=“quantity”> <simpleType> <xsd:restriction base=“xsd:positiveInteger”> <xsd:maxExclusive value=“100”/> <xsd:restriction> </xsd:simpleType> </xsd:element> <xsd:element name=“USPrice” type=“xsd:decimal”/> <xsd:element name=“comment” minOccurs=“0”/> <xsd:element name=“shipDate” type=“xsd:date” minOccurs=“0”/> </xsd:sequence> <xsd:attribute name=“partNum” type=“SKU” use=“required” /> </complexType> </xsd:element> </xsd:sequence> </xsd:complxType></xsd:element>

Page 26: Important Concepts from the W3C RDF Vocabulary/Schema Sungtae Kim SNU OOPSLA Lab. August 19, 2004

RDF Schema Alternatives (2/2)

RELAX NG Compact Syntax Combination of DTD readability and W3C XML

Schema data typingItems = element Items {item*}

Item = element item {att.partNum, productName, quantity, USPrice, comment?, shipDate? }

att.partNum = attribute partNum {text}

productName = element productName {text}

Quantity = element quantity {xsd:positiveInteger {maxExclusive=“100”}}

USPrice = element USPrice {xsd:decimal}

Comment = element comment {text}

shipDate = element shipDate {xsd:date}

Start = Items