<?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>lexanderA &#187; Data manipulation</title>
	<atom:link href="http://lexandera.com/tag/data-manipulation/feed/" rel="self" type="application/rss+xml" />
	<link>http://lexandera.com</link>
	<description>A blog about the web, mobile web, semantic web and mobile semantic web.</description>
	<lastBuildDate>Sun, 06 Jun 2010 18:27:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>jQuery as a tool for manipulating RDF data?</title>
		<link>http://lexandera.com/2009/01/jquery-as-a-database-abstraction-layer/</link>
		<comments>http://lexandera.com/2009/01/jquery-as-a-database-abstraction-layer/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 09:42:09 +0000</pubDate>
		<dc:creator>Aleksander Kmetec</dc:creator>
				<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Semantic Web]]></category>
		<category><![CDATA[Data manipulation]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[RDF]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[XPath]]></category>

		<guid isPermaLink="false">http://lexandera.com/?p=105</guid>
		<description><![CDATA[It occurred to me today that RDF documents are a lot like documents we call web pages. I realized that while I was looking at some jQuery examples, and it struck me that tag and attribute names used in XPath expressions are similar concepts as instance and property IDs and that creating and appending new [...]]]></description>
			<content:encoded><![CDATA[<p>It occurred to me today that <a class="zem_slink" title="Resource Description Framework" rel="wikipedia" href="http://en.wikipedia.org/wiki/Resource_Description_Framework">RDF</a> documents are a lot like documents we call web pages. I realized that while I was looking at some jQuery examples, and it struck me that tag and attribute names used in <a class="zem_slink" title="XPath" rel="wikipedia" href="http://en.wikipedia.org/wiki/XPath">XPath</a> expressions are similar concepts as instance and property IDs and that creating and appending new nodes is essentially the same as creating new instances. So, if we apply some &#8220;if she weighs as much as a duck, <a href="http://www.youtube.com/watch?v=k3jt5ibfRzw#t=1m59s">she is a witch</a>&#8221; logic to it, we can conclude that <a class="zem_slink" title="JQuery" rel="homepage" href="http://jquery.com/">jQuery</a>-like syntax should also work very well for querying and manipulating data stored as RDF.</p>
<p>Let&#8217;s have a look a what this might look like.</p>
<p>A simple select:</p>
<pre name="code" class="javascript">
authors = $(&#039;author[@name = &quot;Clay Shirky&quot;]&#039;);
</pre>
<p>Setting a property value:</p>
<pre name="code" class="javascript">
$(&#039;author[@name = &quot;Clay Shirky&quot;]&#039;).set(&#039;homepage&#039;, &#039;http://www.shirky.com&#039;);
</pre>
<p>Appending a new value to an object property:</p>
<pre name="code" class="javascript">
$(&#039;author[@name = &quot;Clay Shirky&quot;]&#039;).append(&#039;books&#039;, $.create(&#039;book&#039;, {&#039;title&#039;: &#039;Here comes everybody&#039;, &#039;year&#039;: 2008}));
</pre>
<p>Deleting an instance:</p>
<pre name="code" class="javascript">
$(&#039;author[@name = &quot;Clay Shirky&quot;]&#039;).delete();
</pre>
<p>The code would then go and and update your triple store or something like that. I really like how it combines querying and data modification in a single syntax. Also, it&#8217;s quite a bit more compact than <a class="zem_slink" title="SPARQL" rel="wikipedia" href="http://en.wikipedia.org/wiki/SPARQL">SPARQL</a> and <a class="zem_slink" title="SPARUL" rel="wikipedia" href="http://en.wikipedia.org/wiki/SPARUL">SPARUL</a> statements.</p>
<p>All I have so far are these very simple cases, but it does look like I might be on to something. It might make an interesting weekend project.</p>
<p><strong>UPDATE (20. jan)</strong>: it turns out that a similar project already exists. It&#8217;s called <a href="http://code.google.com/p/rdfquery/wiki/RdfPlugin">rdfQuery</a>.</p>
<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/603cfc57-f0d9-42d7-beb8-8fa81934b688/" title="Zemified by Zemanta"><img style="border: medium none ; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=603cfc57-f0d9-42d7-beb8-8fa81934b688" alt="Reblog this post [with Zemanta]"></a></div>
]]></content:encoded>
			<wfw:commentRss>http://lexandera.com/2009/01/jquery-as-a-database-abstraction-layer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
