RDF Tutorial
From Wiki
Contents |
What is RDF
- A language for representing propositional information (classification facts and property facts) on the Web.
- A lightweight ontology system to support the exchange of knowledge on the Web
- RDF is the basis of the Semantic Web.
The RDF Jargon
- Entities/things are called "resources"
- Properties are special resources
- Property facts are called "subject-predicate-object triples":
For example, foaf:name( http://www.informatik.tu-cottbus.de/~agiurca, Giurca) is represented as the triple
http://www.informatik.tu-cottbus.de/~agiurca foaf:name "Giurca"^^xs:string
where
the subject is http://www.informatik.tu-cottbus.de/~agiurca
the predicate is http://xmlns.com/foaf/0.1/name
the object is the typed literal "Giurca"^^xs:string
A set (conjunction) of property facts is called a graph, because such a set can be visualized as a graph.
RDF Terms
URI References as Individual Names
RDF uses URI References as globally unique names for resources
Examples:
btu-teachers:AG = "http://www.BTU.de/teachers#AG"
rdf:type = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
Plain Literals
Typed Literals
Blank Nodes
An RDF Graph
Expressing Facts
Data-Valued Property Facts
The data-valued property fact course:modNo( SemWeb, "12-4-39") is expressed in RDF/XML as
<rdf:Description rdf:about="course:SemWeb"> <course:modNo>12-4-39</course:modNo> </rdf:Description>
Object-Valued Property Facts
The object-valued property fact course:teacher( sem:SemWeb, btu-teachers:AG) is expressed in RDF/XML as
<rdf:Description rdf:about="sem:SemWeb"> <course:teacher rdf:resource="btu-teachers:AG"/> </rdf:Description>
Classification Facts
Classification facts, such as uni:Seminar(sem:SemWeb), are expressed in the form of special property facts using the pre-defined property rdf:type:
<rdf:Description rdf:ID="sem:SemWeb"> <rdf:type rdf:resource="uni:Seminar"/> </rdf:Description>
Or, equivalently (short syntax), using the class name as XML element name:
<uni:Seminar rdf:ID="sem:SemWeb"/>
Several facts about the same object/resource
The following facts (conjunction)
uni:Seminar(sem:SemWeb) ∧ course:teacher( sem:SemWeb, btu-teachers:AG) ∧ course:modNo( sem:SemWeb, "12-4-39")
can be aggregated in an object description fact:
<uni:Seminar rdf:ID="sem:SemWeb"> <course:modNo>12-4-39</course:modNo> <course:teacher rdf:resource="btu-teachers:AG"/> </uni:Seminar>
An RDF Graph as a set of sentences
RDF Graph without blank nodes is
- Set of variable-free triples
- Conjunction of property facts
RDF Graph with blank nodes is:
- Set of triples
- Existentially quantified conjunction of property atoms
The following graph
corresponds to the logical formula
∃ x ( foaf:topic(webTech:RDF_Tutorial, webTech:Category:Semantic Web) ∧ dc:creator(webTech:RDF_Tutorial, x)∧ foaf:homePage( x, btu-teachers:AG) ∧ foaf:name( x, "Adrian Giurca") )
What is the triple representation of this ?
<rdf:Description rdf:about="http://hydrogen.informatik.tu-cottbus.de/wiki/index.php/RDF_Tutorial">
<foaf:topic rdf:resource="http://hydrogen.informatik.tu-cottbus.de/wiki/index.php/Category:Semantic_Web"/>
<dc:creator>
<foaf:Person>
<foaf:homePage rdf:resource="btu-teachers:AG" />
<foaf:name>Adrian Giurca</foaf:name>
</rdf:Person>
</dc:creator>
</rdf:Description>
Answer:
// to be completed

