1 MASWS XML, RDF and RDFS Contents
1 Outline 1
2 RDF in XML 1 2.1 Tree-based View ...... 1
3 RDFS 4
4 Summary 6
2 RDF in XML 2.1 Tree-based View Document Trees Again, 1
• As before, we can represent XML documents as trees.
• An example from last lecture:
Example XML Document
Document Trees Again, 1
• Elements are represented as nodes.
• So are Attributes and Text items!
Element: title
Element: film Element: title
Element: date Attr: lang Text: "en" Element: title
Text: "Seven Samurai"
Attr: lang Text: "ja" Element: film Element: title
Text: "Shichinin no samurai"
Element: date Text: "1954"
RDF Triples as XML Trees, 1
• RDF Triples are encoded as rdf:Description elements.
RDF Triple with literal Object edstaff:104599 foaf:name ‘Jacques Fleuriot’
RDF Triples as XML Trees, 2 RDF Triples with resource Object infcourses:masws dc:creator edstaff:104599
RDF Triples as XML Trees, 3
• RDF Triples are serialized as rdf:Description elements.
• The Subject is the value of the rdf:about attribute on rdf:Description.
• The Predicate becomes a child element of rdf:Description. • Objects:
– Literal Objects are text content of the ‘Predicate’ element. – Resource Objects are values of the rdf:resource attribute of the ‘Predicate’ element. – URIs have to be written out in full (no Qnames) when they are attribute values.
2 RDF Triples as XML Trees, 4 RDF Triple with literal Object edstaff:104599 foaf:name ‘Jacques Fleuriot’
Linear version
RDF Triples as XML Trees, 5 RDF Triples with resource Object infcourses:masws dc:creator edstaff:104599
Linear version
Abbreviating Multiple Properties RDF Triples with shared Subject edstaff:104599 foaf:name ’Jacques Fleuriot’ edstaff:104599 foaf:homepage http://.../~jdf/
Linear version