Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Semantic Web – WEEK 4: RDF

Similar presentations


Presentation on theme: "The Semantic Web – WEEK 4: RDF"— Presentation transcript:

1 The Semantic Web – WEEK 4: RDF
Tutorial/Practical: Exercises using the Suns Lee McCluskey NB most examples below courtesy of the RDF Primer WC3 document

2 Recap Last week we saw how complex data structures can be SPECIFIED in XML Schema documents. These are then used as the validating definitions of XML documents. The elements defined in the Schema give us a ‘namespace’. XML Schema are considered better than DTD’s as they are XML docs, they are more expressive etc The Semantic Web

3 RDF - the Resource Description Framework
The web is like an enormous library with no structure. The purpose of RDF is to act as a uniform or standard language for describing and representing information about Web resources or things identifiable on the Web. This will mean a change from the current ‘brute force’ search engines to much more powerful services… The Semantic Web

4 RDF vs XML Main difference between XML and RDF (and higher level languages like OWL) RDF/ RDFS have a FIXED and pre-defined set of tags -XML does not. For scalability, we need a fairly standard format for documents (eg RDF’s list of triples). RDF application area more specific than XML – describing properties of ‘web resources’ The Semantic Web

5 RDF - basis everything having a URI = Universal Resource Identifier
Properties - resources with a ‘name’ such as slots in an object frame An RDF document is a series of Statements which are triples - (Resource, Property, Value) Or (Subject, Predicate, Object) NB the Property/Predicate is NOT functional – there can be many values for the same resource+property The Semantic Web

6 RDF example RDF ~ set of (Resource, Property, Value)
"The Author of is Lee McCluskey.” IN RDF: <rdf:Description about= <Author> Lee McCluskey </Author> </rdf:Description> Resource, Property, Values can all have URI’s The Semantic Web

7 RDF example The orange box denotes a literal - literals may not be used as subjects or predicates in RDF statements, only objects. Author Lee McCluskey The Semantic Web

8 RDF - QNames RDF (and XML) docs rely on short hand to keep their size down. One mechanism is called the Qualified Name or QName. Example: Start of document we might have.. fred = Then where ever we see ‘fred:subject’ we read The Semantic Web

9 RDF - QNames Common QNames used throughout the semantic web:
rdf: refers to namespace URI: rdfs: refers to namespace URI: owl: refers to namespace URI: xsd: refers to namespace URI: dc: refers to namespace URI: dc is the ‘Dublin Core’ – meta data convention for describing documents The Semantic Web

10 RDF example Example below shows.. Multiple property/values shorthand
Value that is a URI is an attribute [example 1] <rdf:Description rdf:about="http://scom.hud.ac.uk/index.html"> <exterms:creation-date>August 16, 1999 </exterms:creation-date> <dc:language>en</dc:language> <dc:creator rdf:resource="http://www.hud.ac.uk/staffid/85740"/> </rdf:Description> Here ‘exterms’ is some pre-defined vocabulary .. The Semantic Web

11 Examples - rdf:type’s .. are properties that describe the resources as instances of specific types or classes [example 2] <rdf:Description rdf:ID="item10245"> <rdf:type rdf:resource="http://www.example.com/terms/Tent"/> <exterms:model rdf:datatype="&xsd;string">Overnighter</exterms:model> <exterms:sleeps rdf:datatype="&xsd;integer">2</exterms:sleeps> <exterms:weight rdf:datatype="&xsd;decimal">2.4</exterms:weight> <exterms:packedSize rdf:datatype="&xsd;integer">784</exterms:packedSize> </rdf:Description> OR…………………… [example 3] <exterms:Tent rdf:ID="item10245"> </exterms:Tent> The Semantic Web

12 <rdf:RDF = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
<?xml version="1.0"?> <rdf:RDF = "http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:contact = "http://www.w3.org/2000/10/swap/pim/contact#"> <contact:Person rdf:about="http://www.w3.org/People/EM/contact#me"> <contact:fullName>Eric Miller </contact:fullName> <contact:mailbox <contact:personalTitle>Dr. </contact:personalTitle> </contact:Person> </rdf:RDF> from W3C RDF Primer [example4] The Semantic Web

13 Blank Nodes RDF allows only Binary Predicates
This can cause problems where an object has a property that has many facets eg Person’s address Person’s DoB …../:fred_bloggs Date:year Date:month june 1931 The Semantic Web

14 RDF/XML Syntax Specification (Revised) </dc:title>
[example 5] <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:exterms="http://example.org/stuff/1.0/"> <rdf:Description rdf:about="http://www.w3.org/TR/rdf-syntax-grammar"> <dc:title> RDF/XML Syntax Specification (Revised) </dc:title> <exterms:editor rdf:nodeID="abc"/> </rdf:Description> <rdf:Description rdf:nodeID="abc"> <exterms:fullName>Dave Beckett</exterms:fullName> <exterms:homePage rdf:resource=http://purl.org/net/dajobe/ /> </rdf:RDF> Example from “W3C RDF Primer” The Semantic Web

15 RDFS - RDF Schema = RDF + classes, properties of properties, etc - gives more structure to RDF RDF is expanded by new tags such as rdf:Class rdf:Property rdf:label which allow vocabulary – schema to be written (in a similar manner to xml schema) The Semantic Web

16 Vocabularies…. RDF/RDFS allows anyone to write their own
name-space document (a ‘schema’). This defines properties and classes in some application domain These form vocabularies which can be used globally for sharing the meaning of tags The Semantic Web

17 formalised conceptual structure
..and Ontologies Vocabularies are like Ontologies….! An Ontology is a formalised conceptual structure The Semantic Web

18 Summary RDF is a standard language for describing meta-data for the web. It is an XML application. It consists, basically, of sets of triples (statements) of the form “subject, predicate, object” RDF Schema is a way of introducing classes/instances of resources The Semantic Web


Download ppt "The Semantic Web – WEEK 4: RDF"

Similar presentations


Ads by Google