<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>web(cslai) &#187; Resource Description Framework</title>
	<atom:link href="http://cslai.coolsilon.com/category/semantic-web/resource-description-framework/feed/" rel="self" type="application/rss+xml" />
	<link>http://cslai.coolsilon.com</link>
	<description>Findings and Notes in Web Development</description>
	<lastBuildDate>Tue, 06 Sep 2011 08:15:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Resource Definition Framework</title>
		<link>http://cslai.coolsilon.com/2010/06/04/resource-definition-framework/</link>
		<comments>http://cslai.coolsilon.com/2010/06/04/resource-definition-framework/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 10:38:18 +0000</pubDate>
		<dc:creator>Jeffrey04</dc:creator>
				<category><![CDATA[Resource Description Framework]]></category>
		<category><![CDATA[RDF]]></category>
		<category><![CDATA[RDF Graph]]></category>
		<category><![CDATA[RDF Triple]]></category>
		<category><![CDATA[Semantic Network]]></category>
		<category><![CDATA[Semantic Web]]></category>
		<category><![CDATA[URI]]></category>
		<category><![CDATA[URL]]></category>

		<guid isPermaLink="false">http://cslai.coolsilon.com/?p=168</guid>
		<description><![CDATA[As the name implies, Resource Definition Framework, or RDF in short, is a language to represent information about resources in world wide web. Information that can be represented is mostly metadata like title (assuming the resource is a web-page), author, last modified date etc. Besides representing resource that is network-accessible, it can be used to [...]]]></description>
			<content:encoded><![CDATA[<p>As the name implies, Resource Definition Framework, or RDF in short, is a language to represent information about resources in world wide web. Information that can be represented is mostly metadata like title (assuming the resource is a web-page), author, last modified date etc. Besides representing resource that is network-accessible, it can be used to represent things that cannot be accessed through the network, as long as it can be identified using a URI.</p>
<p><span id="more-168"></span></p>
<p>The main objective of RDF is to generate information that can be processed by applications by defining a standardized approach to represent resources. The usage of standardized language also enables interchanging of information between applications without loss of meaning. This allows third party applications to use / consume information created and because the information format is standardized, tools are readily available to manipulate the information.</p>
<p>As mentioned earlier, as long as a thing can be represented in the form of Universal Resource Identifier, URI, then it can be represented / described by RDF. URI is generally used to represent not only network-accessible things, but also non-network accessible things like a arbitrary human being, corporation, or even a book in a library as well as abstract concepts that do not necessarily exist physically like creator / author / modified date. URL, which stands for Uniform Resource Locator is a subset of URI.</p>
<p>RDF is a simple language that deals with only binary relationship, which involves a Subject, a Predicate and a Object. Given an example &#8220;web(cslai) is Jeffrey04&#8242;s blog&#8221;, we can re-structure the statement into subject = <strong>web(cslai)</strong>, predicate = <strong>owner</strong>, object = <strong>Jeffrey04</strong>. Then we can put this into a graph (kinda reminds me of Semantic Network), as follows (not RDF graph):</p>
<img src="http://cslai.coolsilon.com/wp-content/tfo-graphviz/005ba1ec678785f105db96331df36ce2.png" class="graphviz" />
<p>From the graph, we can see that the relationship between a subject and object is described by the predicate. Or another way of saying, <strong>subject</strong> ( web(cslai) ) has a property in the form of <strong>predicate</strong> (owner) that has a value of <strong>object</strong> ( Jeffrey04 ). </p>
<p>Before going to construct a RDF graph, it is important to know that as RDF is used to provide information on a resource, there are a set of basic rules to follow when constructing a RDF statement. Subject should always be a URI, or a blank node (will be discussed later) that denotes a resource, predicate must always be a URI and object can be another resource, a blank node or a constant represented by a character string.</p>
<p>Besides serializing a RDF graph into an XML file, the statements can also be written in the form of triples. Each statement in a graph is written as a simple triple of subject, predicate and object in exact order. Another point to note is that a graph is a primary manner of represent statement, and any other way to represent a statement is considered secondary.</p>
<p>The basic syntax of a triple requires URI to be enclosed in angle bracket or QNAME which kinda resembles XML vocabulary/namespace thingy, and literals to be enclosed in double quotes. For example</p>
<p><code>&lt;http://cslai.coolsilon.com/&gt; csterms:owner "Jeffrey04".</code></p>
<p>Blank node is introduced when a structured data presents as the object value. For example, given a triple as follows</p>
<p><code>exstaff85740 exterms:address "1501 Grant Avenue, Bedford, Massachusetts 01730"</code></p>
<img src="http://cslai.coolsilon.com/wp-content/tfo-graphviz/01bf64a8f3d55b53cd59a772f2668fea.png" class="graphviz" />
<p>Before discussing the graph, it is worth pointing out that each URI node is denoted by an ellipse, and literals denoted by a box. As seen on the graph, all the nodes are either a subject or an object while arcs are predicates. The respective RDF triples for the above graph are shown as follows:</p>
<pre><code>
exstaff:85740     exterms:address    exaddressid:85740 .
exaddressid:85740 exterms:street     "1501 Grant Avenue" .
exaddressid:85740 exterms:city       "Bedford" .
exaddressid:85740 exterms:state      "Massachusette" .
exaddressid:85740 exterms:postalCode "01730" .
</code></pre>
<p>As seen in both the graph as well as the RDF triples, a new node is created just to describe the concept of address. To represent the same piece of information in another way without having to create a new node, a blank node can be introduced, as follows</p>
<img src="http://cslai.coolsilon.com/wp-content/tfo-graphviz/4006e169b7558e7ad1cb9c673bf152de.png" class="graphviz" />
<p>In RDF triples form</p>
<pre><code>
exstaff:85740 exterms:address    ??? .
???           exterms:street     "1501 Grant Avenue" .
???           exterms:city       "Bedford" .
???           exterms:state      "Massachusette" .
???           exterms:postalCode "01730" .
</code></pre>
<p>As seen from the graph, address node is changed from a node with URI address into a node that doesn&#8217;t have address which is called a blank node. Then in the triplets it is written as a &#8216;???&#8217; instead of the complete URI as shown in the above example. However, besides using a &#8216;???&#8217; to denote a blank node in triples, we can also use another form of representation in case there are a lot of blank nodes that represents different things within a graph. By reusing the same example, the triples can be rephrased as follows</p>
<pre><code>
exstaff:85740 exterms:address    _:johnaddress .
_:johnaddress exterms:street     "1501 Grant Avenue" .
_:johnaddress exterms:city       "Bedford" .
_:johnaddress exterms:state      "Massachusette" .
_:johnaddress exterms:postalCode "01730" .
</code></pre>
<p>By breaking up the address into smaller structured parts, it enables external applications to manipulate the information in a more standardized way to produce a more predictable result. However, because RDF only deals with binary relationship, to properly describes N-ary relationship, it has to be broken into a list of binary relationship with the use of blank nodes. Somehow, this reminds me of something similar in prolog where you can create a kind of variable that the programmer do not need to explicitly name them.</p>
<p>Besides being used for the above situation, blank node is also often used in situation where there is no other way to properly and accurately describe a resource. For example, a person with email address johndoe@example.com, although mailto:johndoe@example.com is a valid URI, but as mailbox address is also used as an attribute, the better way of representing John Doe is by using a blank node with mailto:johndoe@example.com as object, as follows:</p>
<p><code>_:john exterms:mailbox &lt;mailto:johndoe@example.com&gt; .</code></p>
<p>An example of combining multiple RDF that is scattered around the internet is assuming there is a book that is authored by an author that uses johndoe@example.com, we can make inference by comparing the following triple</p>
<p><code>ex2terms:book78354 exterms:mailbox &lt;mailto:johndoe@example.com&gt; .</code></p>
<p>We can then deduce that The book is written by John Doe that has email address of johndoe@example.com.</p>
<p>However, because by default object allows any literals, it may make other application that consumes the information in trouble. For example, by looking at the triple below,</p>
<p><code>_:jeff exterms:age "24" .</code></p>
<p>There is no way to tell whether that 24 is a base 10 decimal, or is an octal number. Things can only go worse if the application is actually expecting a float. Type literal is introduced to solve the problem by allowing the specification of a particular datatype to be used in literals. Back to the previous example, to properly define my age, I should prepare a triple as follows:</p>
<p><code>_:jeff exterms:age "24"^^xsd:integer .</code> </p>
<p>Content is summarized / oversimplified from <a href="http://www.w3.org/TR/2004/REC-rdf-primer-20040210/">RDF Primer</a>.</p>
<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://cslai.coolsilon.com/2010/06/04/resource-definition-framework/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

