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
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
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
RDF Vocabulary : Describing the Data (2/3) Example Changing of the domain Domain-specific storage constructs become useless CUSTOMER PKCUSTOMER_ID CUSTOMER_ORDER PK,FK1 PK,FK2 CUSTOMER ID ORDER_ID ORDER PKORDER_ID
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 1Table 2Table 3…. customerorderCustomer_order tableCol name1Col name2Col name3…. orderdatacount… customernameAddress… Schema table Schema column
Core RDF Schema Elements (1/16) RDF Schema elements Marked by a specific namespace xmlns:rdfs= Overview of the RDF Schema classes rdfs:Resource rdfs:Class rdfs:Literal rdfs:XMLLiteral rdfs:Container rdfs:ContainerMembershipProperty rdfs:Datatype
Core RDF Schema Elements (2/16) rdfs:Resource All resources within RDF are implicitly member rdfs:Class <rdf:RDF xmlns:rdf=“ xmlns:pstcn=“ Shelley Powers> Architeuthis Dux
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
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
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
Core RDF Schema Elements (6/16) RDF Schema for Article <rdf:RDF xmlns:rdf=“ xmlns:rdfs=“ xmlns:pstcn=“
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)
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
Core RDF Schema Elements (9/16) rdfs:subClassOf Identify a class that is a subclass of another rdfs:subClassOf rdf:resource=“ /> rdfs:subClassOf rdf:resource=“ />
Core RDF Schema Elements (10/16) rdfs:subPropertyOf <rdf:RDF xmlns:rdf=“ xmlns:rdfs=“ xmlns:pstcn=“ /rdf:RDF>
Core RDF Schema Elements (11/16) rdfs:seeAlso Another resource contains additional information
Core RDF Schema Elements (12/16) rdfs:isDefinedBy Identify the namespace for the resource Statement The class of RDF statement. Literal This represents the set of atomic values, eg. Textual string
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
Core RDF Schema Elements (14/16) RDF Schema documentation elements <rdf:RDF xmlns:rdf=“ xmlns:rdfs=“ xmlns:pstcn=“ Unique Online article Article Online Article Title Article Primary author of article Author
Core RDF Schema Elements (15/16) rdf:type Define the type of resources Usually assumed and is not explicitly given Primary author of article Author
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
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 <rdf:RDF xmlns:rdf=“ xmlns:rdfs=“ xmlns:pstcn=“ Unique Online article Article Online Article Title Article Primary author of article Author
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) <rdf:RDF xmlns:rdf=“ xmlns:rdfs=“ xmlns:pstcn=“ WebPage ExampleArticle Directory domainrange
RDF Schema Alternatives (1/2) DTD(Document Type Declarations) & XML Schema <!ELEMENT Items(item*)
RDF Schema Alternatives (2/2) 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