140 likes | 281 Views
Sheet 9 RDF. Organization. Exam will be on Tue. 17.07.2007 from 10-12 Room A9 Please register via email Old exams are posted Exams have English and German version. @prefix r: < http://ismll.de/rdf/uni# >. r: uniHI r:locatedat r: uniHI_location.
E N D
Organization • Exam will be on Tue. 17.07.2007 from 10-12 • Room A9 • Please register via email • Old exams are posted • Exams have English and German version
@prefix r: <http://ismll.de/rdf/uni#>. r: uniHI r:locatedat r: uniHI_location. r: uniHI_location r:street “Marienburger Platz 22”; r:ZIP “31134”; r:city “Hildesheim”; r:country “Germany”.
Marienburger…. r:street 31134 r:uniHI r:ZIP r:locatedat r:locatedat r:city Hildesheim r:country Germany @prefix r: <http://ismll.de/rdf/uni#>. r: uniHI r:locatedat _:abc. _:abc r:street “Marienburger Platz 22”; r:ZIP “31134”; r:city “Hildesheim”; r:country “Germany”.
What’s wrong? @prefix r: <http://ismll.de/rdf/uni#>. r: uniHI _:locatedat r: uniHI_location. r: uniHI_location r:street “Marienburger Platz 22”; r:ZIP “31134”; r:city “Hildesheim”; r:country “Germany”. @prefix r: <http://ismll.de/rdf/uni#>. “Uni HI” r:locatedat r: uniHI_location. r: uniHI_location r:street “Marienburger Platz 22”; r:ZIP “31134”; r:city “Hildesheim”; r:country “Germany”.
@prefix xs: <http.//www.w3.org/2001/XMLSchema#>. @prefix p: <http://www.cgnm.de/rdf/products#>. @prefix : <#>. :Products rdf:type rdfs:Class. :title rdf:type rdf:Property; rdf:domain :Products; rdf:range xs:string. :price rdf:type rdfs:Property; rdf:domain :Products; rdf:range xs:decimal. :Book rdf:type rdfs:subClassOf:Products. :author rdf:type rdf:Property; rdf:domain :Book; rdf:range xs:string. :CD rdf:type rdfs:subClassOf:Products. :interpret rdf:type rdf:Property; rdf:domain :CD; rdf:range xs:string. :DVD rdf:type rdfs:subClassOf:Products. :director rdf:type rdf:Property; rdf:domain :DVD; rdf:range xs:string. :title rdf:type rdf:Property; rdf:domain :book; rdf:domain :cd; rdf:domain :dvd; rdf:range xs:string. :price rdf:type rdf:Property; rdf:domain :book; rdf:domain :cd; rdf:domain :dvd; rdf:range xs:decimal. :book :title „Learning XML“ . :book :author „EricRay“ . :book :price „30.00“ . :cd :title „for you“ . :cd :interpret „Frank Chastenier“ . :cd :price „15.00“ . :dvd :title „Goldrush“ . :dvd :director „Charly Chaplin“ . :dvd :price „19.00“ .
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE rdf:RDF [ <!ENTITY xs "http://www.w3.org/2001/XMLSchema#"> <!ENTITY v "http://www.cgnm.de/rdf/vehicles#"> <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <!ENTITY p "http://www.cgnm.de/rdf/person#"> ]> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:v="http://www.cgnm.de/rdf/vehicles#" xml:base="http://www.cgnm.de/rdf/vehicles#" xmlns:p="http://www.cgnm.de/rdf/vehicles#"> <rdfs:Class rdf:about="#Vehicle"/> <rdfs:Class rdf:about="#Truck"> <rdfs:subClassOf rdf:resource="#Vehicle"/> </rdfs:Class> <rdfs:Class rdf:about="#Van"> <rdfs:subClassOf rdf:resource="#Vehicle"/> </rdfs:Class> <rdfs:Class rdf:about="#FamilyVehicle"> <rdfs:subClassOf rdf:resource="#Vehicle"/> </rdfs:Class> <rdfs:Class rdf:about="SUV"> <rdfs:subClassOf rdf:resource="#Van"/> <rdfs:subClassOf rdf:resource="#FamilyVehicle"/> </rdfs:Class>
<rdf:Description rdf:about="belongsTo"> <rdf:type rdf:resource="&rdf;Property"/> <rdfs:domain rdf:resource="#Vehicle"/> <rdfs:range rdf:resource="&p;person"/> </rdf:Description> <rdf:Property rdf:about="numberOfDoors"> <rdfs:domain rdf:resource="#FamilyVehicle"/> <rdfs:range rdf:resource="&xs;integer"/> </rdf:Property> <rdf:Description rdf:type="#FamilyVechicle"> <v:belongsTo rdf:resource="&p;Karen"/> <v:numberOfDoors rdf:datatype="&xs;integer"> 5</v:numberOfDoors> </rdf:Description> </rdf:RDF> <v:FamilyVechicle rdf:ID="myCar"> <v:belongsTo rdf:resource="&p;Karen"/> <v:numberOfDoors rdf:datatype="&xs;integer"> 5</v:numberOfDoors> </v:FamilyVechicle>
rdf:ID vs. rdf:about • The rdf:ID (node element) can be used instead of rdf:about • E.g. rdf:ID="name", the same as rdf:about="#name". • rdf:ID provides an additional check • name can only appear once
Redland Raptor RDF Parser Demonstration • http://librdf.org/parse