Download presentation
Presentation is loading. Please wait.
Published byMarlee Colling Modified over 9 years ago
1
Shelley Powers, O’Reilly SNU IDB Lab. Hyewon Kim
Practical RDF Chapter 5. Important Concepts from the W3C RDF Vocabulary/Schema Shelley Powers, O’Reilly SNU IDB Lab. Hyewon Kim
2
Outline Introduction RDF Vocabulary: Describing the Data
Core RDF Schema Elements Refining RDF Vocabularies with Constraints RDF Schema Alternatives
3
Introduction RDF (Resource Description Framework) specification
Syntax specification How RDF constructs relate to each other How they can be diagrammed in XML Schema specification A ruled-based dictionary that defines the elements of importance to a domain Describes how these elements relate to one another
4
RDF Vocabulary: Describing the Data
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
5
RDF Vocabulary: Describing the Data Metadata’s Role in Existing Applications (1/3)
Example Change the domain and the domain-specific storage constructs become pretty useless CUSTOMER PK CUSTOMER_ID ORDER PK ORDER_ID CUSTOMER_ORDER PK,FK1 PK,FK2 CUSTOMER ID ORDER_ID
6
Multiple uses of the same storage mechanism for different domains
RDF Vocabulary: Describing the Data Metadata’s Role in Existing Applications (2/3) Multiple uses of the same storage mechanism for different domains Relational database schema defines below Database tables Primary and foreign key Columns Provide a domain-neutral description of information Schema table Schema column Table 1 Table 2 Table 3 …. customer order Customer_order table Col name1 Col name2 Col name3 …. Order data count … customer name Address
7
Same syntax for web resource
RDF Vocabulary: Describing the Data Metadata’s Role in Existing Applications (3/3) Same syntax for web resource Don’t store information about a web resource in a domain-specific XML element called WEB_PAGE Store it on an rdf:Description element and use RDF to define the properties for this new resource
8
RDF Vocabulary: Describing the Data RDF Schema: Metadata Repository
Provides the same functionality as the relational database schema Provides the resources necessary to describe the objects and properties of a domain-specific schema Vocabulary It describes Objects Attributes Relationships within a specific area of interest
9
Core RDF Schema Elements
Marked by a specific namespace xmlns:rdfs = “
10
Core RDF Schema Elements Overview of the RDF Schema classes (1/6)
All resources within RDF are implicitly members of this class rdfs:Resource Type or category of resource rdfs:Class Literals within RDF documents, such as text strings rdfs:Literal Literals with RDf documents that use XML syntax rdfs:XMLLiteral Superclass of all container classes rdfs:Container Members of containers rdfs:Container MembershipProperty Data typing information rdfs:Datatype
11
Core RDF Schema Elements Overview of the RDF Schema classes (2/6)
rdfs:Resource & rdfs:Class Every resource within an RDF document has a common ancestor class : rdf:resource All new resource types are identified by an rdfs:Class statement, including the rdfs:Resource element itself <? Xml version=“1.0”?> <rdf:RDF xmlns:rdf=“ xmlns:pstcn=“ <rdf:Descriptoin rdf:about=“ <pstcn:author>Shelley Powers></pstcn:author> <pstcn:title>Architeuthis Dux</pstcn:title> <rdf:Description> </rdf:RDF> Schema <rdfs:Class rdf:ID=“Article”> <rdfs:subClassOf rdf:resource=“ </rdfs:Class>
12
Core RDF Schema Elements Overview of the RDF Schema classes (3/6)
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
13
Core RDF Schema Elements Overview of the RDF Schema classes (4/6)
rdfs:Datatype Class of all data types Subclass of rdfs:Literal rdfs:XMLLiteral Allows to embed XML into the RDF/XML document Instance of rdfs:Datatype Class of all XML literals
14
Core RDF Schema Elements Overview of the RDF Schema classes (5/6)
A few RDF classes Cross the boundary between the metalanguage and instances of the same Include as member all reified RDF statements rdf:Statement Used to group members rdf:Bag, rdf:Seq, rdf:Alt Has members all RDF lists rdf:List Define the attributes that, in turn, describe the resource rdf:Property
15
Core RDF Schema Elements Overview of the RDF Schema classes (6/6)
RDF Schema for Article <? Xml version=“1.0”?> <rdf:RDF xmlns:rdf=“ xmlns:rdfs=“ xmlns:pstcn=“ <rdfs:Class rdf:about=“ <rdfs:subClassOf rdf:resource=“ </rdfs:Class> <rdf:Property rdf:about=“ <rdfs:domain rdf:resource= /> </rdf:Property> <rdf:Property rdf:about=“ </rdf:RDF>
16
RDF specification’s purpose RDF Schema specification’s purpose
Core RDF Schema Elements Demonstrations of the RDF Schema Properties (1/10) Demonstrations of the RDF Schema Properties RDF specification’s purpose Define resource and associated facts 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)
17
Core properties (from both the RDF and RDFS namespaces ) of RDF Schema
Core RDF Schema Elements Demonstrations of the RDF Schema Properties (2/10) 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
18
Core RDF Schema Elements Demonstrations of the RDF Schema Properties (3/10)
rdfs:subClassOf Identify a class that is a subclass of another <rdfs:Class rdf:ID=“WebPage”> rdfs:subClassOf rdf:resource=“ /> </rdfs:Class> <rdfs:Class rdf:ID=“Article”> rdfs:subClassOf rdf:resource=“ />
19
Core RDF Schema Elements Demonstrations of the RDF Schema Properties (4/10)
rdfs:subPropertyOf <? Xml version=“1.0”?> <rdf:RDF xmlns:rdf=“ xmlns:rdfs=“ xmlns:pstcn=“ <rdfs:Class rdf:about=“ <rdfs:subClassOf rdf:resource=“ </rdfs:Class> <rdf:Property rdf:about=“ <rdfs:domain rdf:resource= /> </rdf:Property> <rdf:Property rdf:about=“ <rdf:Property rdf:about=“ <rdfs:domain rdf:resource=“ /> <rdfs:subPropertyOf rdf:resource=“ /> <rdf:Property rdf:about=“ </rdf:Property>/rdf:RDF>
20
Core RDF Schema Elements Demonstrations of the RDF Schema Properties (5/10)
rdfs:seeAlso Another resource contains additional information <rdfs:Class rdf:about=“ > <rdfs:subClassOf rdf:resource=“ /> </rdfs:Class> <rdfs:Class rdf:about=“ > <rdfs:subClassOf rdf:resource= /> <rdfs:seeAlso rdf:resource=“ />
21
Core RDF Schema Elements Demonstrations of the RDF Schema Properties (6/10)
rdfs:isDefinedBy Identify the namespace for the resource <rdfs:Class rdf:about=" > <rdfs:isDefinedBy rdf:resource=“ /> <rdfs:label xml:lang=“en”>Statement</rdfs:label> <rdfs:subClassOf rdf:resource=“ /> <rdfs:comment>The class of RDF statement.</rdfs:comment> </rdfs:Class> <rdfs:Class rdf:about=" > <rdfs:isDefinedBy rdf:resource=“ /> <rdfs:label xml:lang=“en”>Literal</rdfs:label> <rdfs:comment>This represents the set of atomic values, eg. Textual string</rdfs:comment> </rdfs:Class>
22
Core RDF Schema Elements Demonstrations of the RDF Schema Properties (7/10)
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
23
RDF Schema documentation elements
Core RDF Schema Elements Demonstrations of the RDF Schema Properties (8/10) RDF Schema documentation elements <? xml version=“1.0”?> <rdf:RDF xmlns:rdf=“ xmlns:rdfs=“ xmlns:pstcn=“ <rdfs:Class rdf:about=“ <rdfs:subClassOf rdf:resource=“ <rdfs:comment>Unique Online article</rdfs:comment> <rdfs:label xml:lang=“en”>Article</rdfs:label> </rdfs:Class> <rdf:Property rdf:about=“ <rdf:type rdf:resource=“ /> <rdfs:domain rdf:resource=“ /> <rdfs:comment>Online Article Title</rdfs:comment> </rdf:Property> <rdf:Property rdf:about=“ <rdfs:comment>Primary author of article</rdfs:comment> <rdfs:label xml:lang=“en”>Author</rdfs:label> </rdf:RDF>
24
Core RDF Schema Elements Demonstrations of the RDF Schema Properties (9/10)
rdf:type Define the type of resources Usually assumed and is not explicitly given <rdfs:Property rdf:about=“ > <rdfs:domain rdf:resource= /> <rdfs:comment>Primary author of article</rdfs:comment> <rdfs:label xml:lang=“en”>Author</rdfs:label> <rdf:type rdf:resource=“ /> </rdfs:Property>
25
rdf:subject, rdf:predicate, rdf:object
Core RDF Schema Elements Demonstrations of the RDF Schema Properties (10/10) 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
26
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=“ xmlns:rdfs=“ xmlns:pstcn=“ <rdfs:Class rdf:about=“ <rdfs:subClassOf rdf:resource=“ <rdfs:comment>Unique Online article</rdfs:comment> <rdfs:label xml:lang=“en”>Article</rdfs:label> </rdfs:Class> <rdf:Property rdf:about=“ <rdf:type rdf:resource= /> <rdfs:domain rdf:resource=“ /> <rdfs:comment>Online Article Title</rdfs:comment> </rdf:Property> <rdf:Property rdf:about=“ <rdfs:comment>Primary author of article</rdfs:comment> <rdfs:label xml:lang=“en”>Author</rdfs:label> </rdf:RDF>
27
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=“ xmlns:rdfs=“ xmlns:pstcn=“ <rdfs:Class rdf:about=“ <rdfs:subClassOf rdf:resource=“ </rdfs:Class> <rdf:Class rdf:about=“ <rdf:subClassOf rdf:resource=“ /> </rdf:Class> <rdf:Class rdf:about=“ <rdf:Class rdf:about=“ <rdf:subClassOf rdf:resource=“ /> <rdf:Property rdf:about=“ <rdf:domain rdf:resource=“ /> <rdf:range rdf:resource= /> </rdf:Property> </rdf:RDF> range domain WebPage Directory Article Example
28
RDF Schema Alternatives (1/3)
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)>
29
RDF Schema Alternatives (2/3)
DTD(Document Type Declarations) & XML Schema <xsd:element name=“Items”> <xsd:complexType name=“items”> <xsd:sequence> <xsd:element name=“item” minOccurs=“0” maxOccurs=“unbounded”> <xsd:complexType> <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:complxType>
30
RDF Schema Alternatives (3/3)
RELAX NG Compact Syntax Combination of DTD readability and W3C XML Schema data typing Items = 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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.