Presentation on theme: "1 RDF Tutorial. C. Abela RDF Tutorial2 What is RDF? RDF stands for Resource Description Framework It is used for describing resources on the web Makes."— Presentation transcript:
C. Abela RDF Tutorial2 What is RDF? RDF stands for Resource Description Framework It is used for describing resources on the web Makes use of URIs to identify web resources and is written in XML RDF is a web standard
C. Abela RDF Tutorial3 Designed to be read by Computers RDF was designed to provide a common way to describe information so it can be read (and understood) by computer applications. RDF descriptions are not designed to be displayed on the web.
C. Abela RDF Tutorial4 Makes use of URIs RDF uses a URI (Uniform Resource Identifier) to identify a web resource, and properties to describe the resource Unlike URLs, URIs are not limited to identifying things that have a network location A URI reference (URIref) is a URI, together with an optional fragment identifier at the end. http://www.example.org/index.html#section2
C. Abela RDF Tutorial5 Simple Example Jan Egil Refsnes November 1, 1999 February 1, 2004
C. Abela RDF Tutorial6 Example explained In the example: the URI "http://www.w3schools.com/- default.asp" is used to identify a web page, the property "author" describes the author of the page, the property value is "Jan Egil Refsnes". The property "created" tells when the page was created, and the property "modified" when it was last modified.
C. Abela RDF Tutorial7 Subject, Predicate & Object RDF terminology also use the words subject, predicate and object. The resource http://www.w3schools.com/default.asp is the subject http://www.w3schools.com/default.asp The property "author" is the predicate The value "Jan Egil Refsnes" is the object
C. Abela RDF Tutorial8 Example 2 Bob Dylan USA Columbia 10.90 1985......
C. Abela RDF Tutorial9 Example 2 (cont) Bonnie Tyler UK CBS Records 9.90 1988
C. Abela RDF Tutorial10 List of Triples NumberSubjectPredicateObject 1http://www.recshop.fake/cd/Empire Burlesquehttp://www.recshop.fake/cdartist"Bob Dylan" 2http://www.recshop.fake/cd/Empire Burlesquehttp://www.recshop.fake/cdcountry"USA" 3http://www.recshop.fake/cd/Empire Burlesquehttp://www.recshop.fake/cdcompany"Columbia" 4http://www.recshop.fake/cd/Empire Burlesquehttp://www.recshop.fake/cdprice"10.90" 5http://www.recshop.fake/cd/Empire Burlesquehttp://www.recshop.fake/cdyear"1985"
C. Abela RDF Tutorial11 Directed Graph Representation Using RDF Validator: http://www.w3.org/RDF/Validator/
C. Abela RDF Tutorial12 Details of Example 2 The first line in the XML file is the XML declaration, telling the version of XML. The rdf:RDF element indicates that the content is RDF. The xmlns:rdf namespace, specifies that tags with the rdf: prefix are from the namespace defined by "http://www.w3.org/1999/02/22-rdf- syntax-ns#". The xmlns:cd namespace, specifies that tags with the cd: prefix are from the namespace defined by "http://www.recshop.fake/cd". The rdf:Description element contains the description of a resource identified by the rdf:about attribute. The cd:artist element describes a property of the resource, and so does cd:country, etc.
C. Abela RDF Tutorial13 Main Elements The RDF Element The RDF element is the root of the RDF document. It defines the XML document to be an RDF document and contains a reference to the xmlns:rdf namespace:.. Description goes here. The root element must always have a reference to the RDF namespace: http://www.w3.org/1999/02/22-rdf-syntax- ns#
C. Abela RDF Tutorial14 Main Elements (cont) The Description Element The Description element describes a resource. The about attribute identifies the resource. Property elements are used to describe the resource In example 2: The property elements (artist, country, company, price, and year) are defined in the namespace xmln:cd.
C. Abela RDF Tutorial15 RDF Container Elements The Bag Element The Bag element contains an unordered list of value elements The Seq Element The Seq element contains an ordered list of value elements The Alt Element The Alt element contains a list of alternative values for an element
C. Abela RDF Tutorial18 RDF Collections An RDF collection is a group of things represented as a list structure in the RDF graph. A list structure constructed using a predefined collection vocabulary consisting of predefined type rdf:List, predefined properties rdf:first and rdf:rest, predefined resource rdf:nil. In RDF/XML, a collection can be described by a property element that has the attribute rdf:parseType="Collection", and that contains a group of nested elements representing the members of the collection.
C. Abela RDF Tutorial19 RDF Collections RDF/XML
C. Abela RDF Tutorial21 RDF Schema RDF Schema provides the framework to describe application-specific classes and properties Classes in RDF Schema are much like classes in object oriented programming languages. This allows resources to be defined as instances of classes, and subclasses of classes