Comparing
version 17 and
version 16 backThis is a short info burst about RDF, which represents the foundation of the
Semantic Web, and how the concepts of RDF relate to ActiveRDF.
Read this if you have no prior knowledge about the Semantic Web. Don't worry,
we'll be short and to the point.
h2. Basic RDF Concepts
RDF, the Resource Description Framework, is designed to describe
store graphs of interconnected information. Such a graph is made out of
_triples_, and every triple has a _subject_, _predicate_ and _object_. A triple
is like a simple sentence in English and might for example express information
such as: _"Peter knows Paula"_.
There are three types of "information objects" that you can use in a triple:
* URI: a uniform resource identifier (a globally unique identifier, like the URLs you type in your browser),
* literals: simple values such as numbers or strings,
* blank nodes: which are like strangers in a crowd that you cannot really identify: you can see the skinny red-haired girl in the crowd but you don't have her name or her telephone number.
Using three URIs we can construct a triple to express that Peter knows Paula:
person:peter fact:knows person:paula .
h2. How ActiveRDF relates to the concepts of RDF
In the real world we talk about _persons_, _things_ and _concepts_, which have
_properties_: We might know a Person, of this Person, we know a lot of things,
like an age, email address or occupation. Because in the real world the focus
is on _objects_ and their _properties_, we naturally express this in ActiveRDF
through Ruby objects, their properties and the accessors to those properties.
In ActiveRDF Peter simply is a _Ruby object_, with properties age, email and occupation:
Peter = FOAF::Person.new
Peter.age = "33"
Peter.mbox = "emailto:peter@NoRealPlace.net"
puts Peter.occupation ... "student"
ActiveRDF handles all the details about storing the right triples in the triple
store for you. Even better, you don't have to worry about long and tedious
URIs. Just use the part of the URI behind the last "/" or "#" and Active RDF
will figure out what property you mean on its own. (In "Peter.email", the
property "email" might just be an abbreviation for
"http://xmlns.com/foaf/0.1/mbox").
*Just remember*: In order for Active RDF to be able to fill in the complete URIs
for the abbreviations you use, there has to be some data in the triple store. It
does not work with an empty store, but we are working on ways to most easily
define the mapping between URIs and properties manually, in case you want to
start from scratch, with an empty store.
h2. Further Information
If you want some further homework, check out these resources:
* "What is RDF":http://www.xml.com/pub/a/2001/01/24/rdf.html article is a good and short
introduction to RDF;
* "What is RDF and what is it good for?":http://www.rdfabout.com/intro/?section=contents compares RDF to XML, and introduces RDF Schema;
* The official "RDF Primer":http://www.w3.org/TR/rdf-primer/ should give you the complete picture.
* For the Big Vision behind the Semantic Web, read Tim Berners-Lee's Scientific American "article":http://www.sciam.com/print_version.cfm?articleID=00048144-10D2-1C70-84A9809EC588EF21.