1 / 18

The Semantic Web – WEEK 4: RDF

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. Recap. Last week we saw how complex data structures can be SPECIFIED in XML Schema documents.

Download Presentation

The Semantic Web – WEEK 4: RDF

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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 http://scom.hud.ac.uk/scomtlm/Artform/planning.html is Lee McCluskey.” IN RDF: <rdf:Description about= http://scom.hud.ac.uk/scomtlm/Artform/planning.html'> <Author> Lee McCluskey </Author> </rdf:Description> Resource, Property, Values can all have URI’s The Semantic Web

  7. RDF example http://scom.hud.ac.uk/scomtlm/Artform/planning.html 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 = http://www.w3.org/1999/02/22-rdf-syntax-ns# Then where ever we see ‘fred:subject’ we read http://www.w3.org/1999/02/22-rdf-syntax-ns#subject The Semantic Web

  9. RDF - QNames Common QNames used throughout the semantic web: rdf: refers to namespace URI: http://www.w3.org/1999/02/22-rdf-syntax-ns#rdfs: refers to namespace URI: http://www.w3.org/2000/01/rdf-schema# owl: refers to namespace URI: http://www.w3.org/2002/07/owl# xsd: refers to namespace URI: http://www.w3.org/2001/XMLSchema# dc: refers to namespace URI: http://purl.org/dc/elements/1.1/ 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: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> </exterms:Tent> The Semantic Web

  12. <?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 rdf:resource="mailto:em@w3.org"/> <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. [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:Description> </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. ..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

More Related