Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


What Is the Resource Description Framework? : Page 4

You might be familiar with RDF as a technology for describing resources like images, audio, and video. However, take a deeper look into its core model, syntax, and features to see how this framework is shaping the semantic web.

Other RDF Features
The rest of the features of RDF assist in increasing the composeability of statements. Two main categories of features do this: a simple container model and reification (making statements about statements). The container model allows groups of resources or values. Reification allows higher-level statements to capture knowledge about other statements. Both of these features add some complexity to RDF, so we will demonstrate them with basic examples.

We need a container to model the sentence "The people at the meeting were Joe, Bob, Susan, and Ralph." To do this in RDF, we create a container, called a bag, for the objects in the statement, as shown in Listing 3.

In Listing 3 we see one rdf:Description element (one subject), one predicate (attendees), and an object, which is a bag (or collection) of resources. A bag is an unordered collection where each element of the bag is referred to by an rdf:li or "list item" element. Figure 5 graphs the RDF in Listing 3.

Figure 5. A graph of an RDF bag.
IsaViz is copyrighted by the W3C. All Rights Reserved.

Figure 5 nicely demonstrates that the "meeting" is "attended" by "people" and that people is a type of bag. The members of the bag are specially labeled as a member with an rdf:_# predicate. RDF containers are different than XML containers in that they are explicit. This is the same case as relations between elements, which are also implicit in XML, whereas such relations (synonymous with predicates) are explicit in RDF. This explicit modeling of containers and relations is an effort to remove ambiguity from our models so that computers can act reliably in our behalf. On the downside, such explicit modeling is harder than the implicit modeling in XML documents. This has had an effect on adoption, as discussed in the next section.

Three types of RDF containers are available to group resources or literals:

  • Bag. An rdf:bag element is used to denote an unordered collection. Duplicates are allowed in the collection. An example of when to use a bag would be when all members of the collection are processed the same without concern for order.
  • Sequence. An rdf:seq element is used to denote an ordered collection (a "sequence" of elements). Duplicates are allowed in the collection. One reason to use a sequence would be to preserve the alphabetical order of elements. Another example would be to process items in the order in which items were added to the document.
  • Alternate. An rdf:alt element is used to denote a choice of multiple values or resources. This is referred to as a choice in XML. Some examples would be a choice of image formats (JPEG, GIF, BMP) or a choice of makes and models, or any time you wish to constrain a value to a limited set of legal values.

Now that we have added the idea of collections to our statements, we need a way to make statements either about the collection or about individual members of the collection. You can make statements about the collection by attaching an rdf:ID attribute to the container. Making statements about the individual members is the same as making any other statement by simply referring to the resource in the collection as the object of your statement.

While containers affect the modeling of a single statement (for example, an object becoming a collection of values), reification allows you to treat a statement as the object of another statement. This is often referred to as "making statements about statements" and is called reification. Listing 4 shows a simple example of reification.

Listing 4 demonstrates (in N3 notation) that Jane has tested Mary's Web page and asserts that it passes the accessibility tests. The key part relating to reification is the statement with explicit subject, predicate, and object parts that are the object of "asserts." Listing 5 shows the same example in RDF.

The method for reifying statements in RDF is to model the statement as a resource via explicitly specifying the subject, predicate, object, and type of the statement. Once the statement is modeled, you can make statements about the modeled statement. The reification is akin to statements as argument instead of statements as fact, which is useful in cases where the trustworthiness of the source is carefully tracked (for example, human intelligence collection). This is important to understand, as reification is not applicable to all data modeling tasks. It is easier to treat statements as facts.

Figure 6 displays a graph of the reified statement. Note that the statement is treated as a single entity via an anonymous node. The anonymous node is akin to a Description element without an rdf:about attribute. The rdf:parseType attribute in Listing 5 means that the content of the element is parsed similar to a new Description element.

Figure 6. A graph of reification.
IsaViz is copyrighted by the W3C. All Rights Reserved.

Admittedly, reification is not simple. Many people come to RDF understanding the basics of the triple but missing the utility of reification. Most databases treat data as facts, so it is a stretch to think about data as assertions. One commonsense application of reification is annotations of other people's work. Annotations, by nature, are statements about someone else's statements. So, clearly, reification fits there. At the same time, it will take training for developers and modelers to understand where to use reification and what rules apply to reified statements. In fact, some current Semantic Web applications explicitly eliminate reification from their knowledgebases to reduce the complexity. Complexity hurts adoption, and the adoption of RDF by mainstream developers has been significantly slower than other W3C technologies.

This article answered the question "What is RDF?" It began by highlighting its most obvious use in describing opaque resources like images, audio, and video. We then began dissecting the technology into its core model, syntax, and additional features. The core model revolves around denoting concepts with Universal Resource Identifiers (URIs) and structured knowledge as a collection of statements. An RDF statement has three parts: a subject, a predicate, and an object. The RDF/XML syntax uses a striped syntax and a set of elements like rdf:Description and attributes like rdf:about and rdf:resource. The other features discussed in the section were RDF containers and reification. RDF containers allow an object to contain multiple values or resources. RDF reification allows you to make statements about statements.

This article is excerpted from "The Semantic Web" copyright 2003 Michael C. Daconta, Leo J. Obrst, Kevin B. Smith (ISBN: 0471432571, Wiley Publishing Inc.) used by permission of the publisher, all rights reserved.

Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.