Chapter 7: Resource Description Framework (RDF) Service-Oriented Computing: Semantics, Processes, Agents – Munindar P. Singh and Michael N. Huhns, Wiley, 2005 RDF Chapter 7 Provides a basis for knowledge representation Simple language to capture assertions (statements), which help capture knowledge, e.g., about resources RDF puts together old KR ideas but uses the Web to enhance their range and avoid some longstanding problems Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 2 Why RDF? XML Chapter 7 Gives us a document tree Doesn’t identify the content represented by a document Enables multiple representations for the same content RDF expresses the content itself Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 3 Resources and Literals RDF captures descriptions of resources A resource is an object A literal is something simpler Chapter 7 Of which a description can be given Identified via a URI A value, e.g., string or integer Cannot be given a description Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 4 Statements or Triples RDF is based on a simple grammar An RDF document is just a set of statements or triples Each statement consists of Chapter 7 Subject: a resource Object: a resource or a literal Predicate: a resource Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 5 Rendering RDF RDF is not about the surface syntax but the content it captures In principle, RDF is not tied to XML, which makes it verbose, but it is the common syntax, which we will use Uses standard XML namespace syntax Namespace defined by the RDF standard Chapter 7 Typically abbreviated rdf and rdfs Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 6 Example (Using Dublin Core) Chapter 7 <?xml version='1.0' encoding='UTF-8'?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdfsyntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> <rdf:Description rdf:about="http://www.wiley.com/SOC"> <dc:title>Service-Oriented Computing</dc:title> <dc:creator>Munindar</dc:creator> <dc:creator>Michael</dc:creator> <dc:publisher>Wiley</dc:publisher> </rdf:Description> </rdf:RDF> rdf:Description gathers statements about one subject Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 7 N-Triples Notation <http://www.wiley.com/SOC> <http://purl.org/dc/elements/1.1/title> "Service-Oriented Computing" . <http://www.wiley.com/SOC> <http://purl.org/dc/elements/1.1/creator> "Munindar" . <http://www.wiley.com/SOC> <http://purl.org/dc/elements/1.1/creator> "Michael" . <http://www.wiley.com/SOC> <http://purl.org/dc/elements/1.1/publisher> "Wiley” . Chapter 7 Could also write individual statements in the XML syntax, but the rdf:Description element simplifies the notation Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 8 Collections Function as containers Accompanied by properties to extract elements Chapter 7 rdf:Bag rdf:Sequence rdf:Alt Schematically represented as rdf:_1, and so on Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 9 Reification of Statements Reify: to make referenceable Chapter 7 Needed to quote statements (e.g., to agree or disagree with them); assert modalities Make a statement into a resource; then talk about it rdf:Statement is the class whose rdf:type the given statement (object) is; additional properties such as rdf:subject, rdf:object, and rdf:predicate Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 11 RDF Schema Analogous to an object-oriented type system built on top of RDF. Defines Chapter 7 rdfs:Class, rdfs:subClassOf rdfs:Resource, rdfs:Literal rdfs:Property, rdfs:subPropertyOf rdfs:range, rdfs:domain rdfs:label, rdfs:comment, rdfs:seeAlso Applications of RDF Schema deferred to OWL, which greatly enhances the above Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 12 RDF Schema versus XML Schema Both help define custom vocabularies An XML Schema document gives us syntactic details An RDF Schema document gives us meaning An OWL document (next chapter) captures richer meaning Chapter 7 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 13 Chapter 7 Summary RDF captures the deep structure whereas XML captures the surface structure RDF is based on an simple linguistic representation: subject, predicate, object But “webified” via URIs RDF comes with RDF Schema Chapter 7 RDF captures graphs in general In essence, an object-oriented type system Has been used for important custom vocabularies For our purposes, best used as part of OWL Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 14