XML.com: XML From the Inside Out
oreilly.comSafari Bookshelf.Conferences.

advertisement

What Is RDF
by Joshua Tauberer | Pages: 1, 2, 3

Distributed Knowledge

One can use RDF to model any type of knowledge without having to use any centrally approved notions. If no one has coined a URI for something you want to describe, you can create your own URI for it. This goes for not just subjects and objects but predicates as well. The trouble is that if I make up all of my own URIs, my RDF document has no meaning to anyone else unless I explain what each URI is intended to denote or mean. On the flip side, two documents that have some URIs in common are talking about some of the same things--necessarily because URIs always refer to the same thing in any RDF document.

And this is where the emergent aspect of the Semantic Web appears. Without much planning, RDF documents created by different people for different purposes can come together. Let's take a concrete example. Say one person--call this person Developer A--encodes the geographic and population statistics from the United States Census in N3 RDF like this:

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix usgovt: <http://www.example1.org/> .
@prefix census: <http://www.example2.org/> .

<tag:www.example.org,2005:us/ny>
    rdf:type usgovt:State ;
    dc:title "New York" ;
    census:population "18976457" ;
    census:landArea "122283145776 m^2" .
...
(repeated for other states)

When it comes time to write RDF, one faces a modeling issue. What entities and predicates will be used to represent the information to be encoded? It's a problem similar to programming design, deciding what classes will be needed for a program, and what relations among the classes there will be. When you decide on the classes, each class has some purpose, or some meaning. Like "the Customer class represents a person." You don't tell the computer this. Rather, you document it for other programmers.

The same thing happens in RDF. To represent the relation between a state and its population, a modeling decision was made to use a predicate between an entity denoting the state and the literal value containing the numeric value. One doesn't tell the computer that census:population represents the relation between a state and its population--that's impossible of course. Instead, one tells other people that that's how census:population should be used. Then they use the URI accordingly in their RDF documents and applications.

Now, separately, Developer B might be publishing RDF/XML files for members of the U.S. Congress:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:foaf="http://xmlns.com/foaf/0.1/" 
    xmlns:usgov="http://www.example1.org" xmlns:pol="http://www.example4.org">
    <pol:Politician rdf:about="tag:govshare.info,2005:data/us/congress/people/S000148">
        <foaf:name>Charles Schumer</foaf:name>
        <usgov:party>Democrat</usgov:party>
    </pol:Politician>
    ...
    (repeated for other senators)
</rdf:RDF>

Charles Schumer is a New York senator. Developer B wants to indicate this in the RDF/XML file. If he's seen Developer A's N3 file and knows how Developer A intended tag:www.example.org,2005:us/ny to be used, he could use this:

    <pol:Politician rdf:about="tag:govshare.info,2005:data/us/congress/people/S000148">
        <usgov:represents rdf:resource="tag:www.example.org,2005:us/ny"/>
    </pol:Politician>

By reusing the URI that Developer A coined for New York, Developer B has created a bridge between their two RDF files. Because URIs are globally unique, anyone looking at the two files knows they are both referring to the very same New York (e.g., the state versus the city). And because RDF vocabularies can be mixed together, Developer C, a third party who wants to create a table of senators and the populations of the states they represent, can take the two RDF files and merge them, simply by concatenating the triples of each file:

         Subject               Predicate               Object
-------------------------  -----------------  -----------------------
<tag:govshare.../S000148>  foaf:name          "Charles Schumer"
<tag:govshare.../S000148>  usgov:party        "Democrat"
<tag:govshare.../S000148>  usgov:represents   <tag:www.example...us/ny>
...
<tag:www.example...us/ny>  dc:title           "New York"
<tag:www.example...us/ny>  census:population  "18976457"
...
(repeated for other senators)

Developer C can then write a program, or use an existing RDF query language, to trace paths through the graph starting with senators, through usgov:represents predicates or edges, then through census:population predicates to the corresponding population.

Looking Forward

The simplicity and flexibility of the triple in combination with the use of URIs for globally unique names makes RDF unique, and very powerful. It's a specification that fills a very particular niche for decentralized, distributed knowledge and provides a framework to enable computer applications to answer questions we wouldn't dream of asking computers today.

This article hardly scratches the surface of RDF, and here is a quick list of things to look at from here:



1 to 3 of 3
  1. Great.....
    2010-08-03 00:31:16 Vinfotech
  2. Thanks
    2010-07-26 09:49:04 seed882
  3. #1 Locksmith L.A 1-310-925-1720
    2009-06-30 17:36:22 carpetcare
1 to 3 of 3