<?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>Xavier Llorà &#187; sparql</title>
	<atom:link href="http://www.xavierllora.net/tag/sparql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xavierllora.net</link>
	<description>A notebook about data-intensive computing, genetics-based machine learning, semantic-web technology, cloud computing,  and more.</description>
	<lastBuildDate>Thu, 15 Jul 2010 19:50:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Liquid: RDF endpoint for FluidDB</title>
		<link>http://www.xavierllora.net/2009/09/24/liquid-rdf-endpoint-for-fluiddb/</link>
		<comments>http://www.xavierllora.net/2009/09/24/liquid-rdf-endpoint-for-fluiddb/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 20:45:19 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[Data-Intensive Computing]]></category>
		<category><![CDATA[FluidDB]]></category>
		<category><![CDATA[meandre]]></category>
		<category><![CDATA[RDF]]></category>
		<category><![CDATA[sparql]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://www.xavierllora.net/?p=593</guid>
		<description><![CDATA[A while ago I wrote some thoughts about how to map RDF to and from FluidDB. There I explored how you could map RDF onto FluidDB, and how to get it back. That got me thinking about how to get a simple endpoint you could query for RDF. Imagine that you could pull FluidDB data [...]


Related posts:<ol><li><a href='http://www.xavierllora.net/2009/08/25/liquid-rdf-meandering-in-fluiddb/' rel='bookmark' title='Permanent Link: Liquid: RDF meandering in FluidDB'>Liquid: RDF meandering in FluidDB</a></li>
<li><a href='http://www.xavierllora.net/2009/09/29/temporary-storage-for-meandres-distribute-flow-execution/' rel='bookmark' title='Permanent Link: Temporary storage for Meandre&#8217;s distributed flow execution'>Temporary storage for Meandre&#8217;s distributed flow execution</a></li>
<li><a href='http://www.xavierllora.net/2009/02/04/efficient-serialization-for-java-and-beyond/' rel='bookmark' title='Permanent Link: Efficient serialization for Java (and beyond)'>Efficient serialization for Java (and beyond)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>A while ago I wrote some thoughts about how to map RDF to and from <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a>. There I explored how you could map RDF onto FluidDB, and how to get it back. That got me thinking about how to get a simple endpoint you could query for RDF. Imagine that you could pull <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> data in RDF, then I could just get all the flexibility of <a href="http://www.w3.org/TR/rdf-sparql-query/">SPARQL</a> for free. With this idea in my mind I just went and grabbed <a href="http://seasr.org/meandre">Meandre</a>, the <a href="http://github.com/rossjones/JFluidDB">JFLuidDB</a> library started by <a href="http://github.com/rossjones">Ross Jones</a>, and build a few components.</p>
<p>The main goal was to be able to get an object, list of the tags, and express the result in RDF. <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> helps the mapping since objects are uniquely identified by URIs. For instance, the unique object <code>5ff74371-455b-4299-83f9-ba13ae898ad1</code> (FluidDB relies on UUID version four with the form <code>xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx</code>) is uniquely identified by <code>http://sandbox.fluidinfo.com/objects/5ff74371-455b-4299-83f9-ba13ae898ad1</code> (or a url of the form <code>http://sandbox.fluidinfo.com/objects/xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx</code>), in case you are using the sandbox or <code>http://fluiddb.fluidinfo.com/objects/5ff74371-455b-4299-83f9-ba13ae898ad1</code> if you are using the main instance. Same story for tags. The tag <code>fluiddb/about</code> can be uniquely identified by the URI <code>http://sandbox.fluidinfo.com/tags/fluiddb/about</code>, or <code>http://fluiddb.fluidinfo.com/tags/fluiddb/about</code>.</p>
<h2>A simple RDF description for and object<br />
<h2>
<p>Once you get the object back the basic translated RDF version for object <code>a10ab0f3-ef56-4fc0-a8fa-4d452d8ab1db</code> should look like as the listing below in TURTLE notation.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//sandbox.fluidinfo.com/objects/a10ab0f3-ef56-4fc0-a8fa-4d452d8ab1db<span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//www.w3.org/1999/02/22-rdf-syntax-ns#type<span style="color: #000000; font-weight: bold;">&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//sandbox.fluidinfo.com/objects<span style="color: #000000; font-weight: bold;">/&gt;</span></span> , <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//www.w3.org/1999/02/22-rdf-syntax-ns#Bag<span style="color: #000000; font-weight: bold;">&gt;</span></span> ;
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//www.w3.org/1999/02/22-rdf-syntax-ns#_1<span style="color: #000000; font-weight: bold;">&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//sandbox.fluidinfo.com/tags/fluiddb/about<span style="color: #000000; font-weight: bold;">&gt;</span></span> ;
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//www.w3.org/1999/02/22-rdf-syntax-ns#_2<span style="color: #000000; font-weight: bold;">&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//sandbox.fluidinfo.com/tags/fluiddb/tags/path<span style="color: #000000; font-weight: bold;">&gt;</span></span> ;
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//www.w3.org/1999/02/22-rdf-syntax-ns#_3<span style="color: #000000; font-weight: bold;">&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//sandbox.fluidinfo.com/tags/fluiddb/tags/description<span style="color: #000000; font-weight: bold;">&gt;</span></span> ;
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//purl.org/dc/elements/1.1/description<span style="color: #000000; font-weight: bold;">&gt;</span></span>
              &quot;Object for the attribute fluiddb/default/tags/permission/update/policy&quot;^^<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//www.w3.org/2001/XMLSchema#string<span style="color: #000000; font-weight: bold;">&gt;</span></span> .</pre></div></div>

<p>I will break the above example into small chunks and explain the above example into the three main pieces involved (the id, the about, and the tags). The basic construct is simple. First a triple to mark the object as a <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> object.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//sandbox.fluidinfo.com/objects/a10ab0f3-ef56-4fc0-a8fa-4d452d8ab1db<span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//www.w3.org/1999/02/22-rdf-syntax-ns#type<span style="color: #000000; font-weight: bold;">&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//sandbox.fluidinfo.com/objects<span style="color: #000000; font-weight: bold;">/&gt;</span></span>   
.</pre></div></div>

<p>Then if the object has an <code>about</code> associated on creation, another triple gets generated and added, as shown below. To be consistent, I suggest reusing DC description since that is what the <code>about</code> for an object tend to indicate.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//sandbox.fluidinfo.com/objects/a10ab0f3-ef56-4fc0-a8fa-4d452d8ab1db<span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//purl.org/dc/elements/1.1/description<span style="color: #000000; font-weight: bold;">&gt;</span></span>
              &quot;Object for the attribute fluiddb/default/tags/permission/update/policy&quot;^^<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//www.w3.org/2001/XMLSchema#string<span style="color: #000000; font-weight: bold;">&gt;</span></span> 
.</pre></div></div>

<p>Finally, if there are tags associated to the object, a bag gets created, and all the URI describing the tags get pushed into the bag as shown below.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//sandbox.fluidinfo.com/objects/a10ab0f3-ef56-4fc0-a8fa-4d452d8ab1db<span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//www.w3.org/1999/02/22-rdf-syntax-ns#type<span style="color: #000000; font-weight: bold;">&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//www.w3.org/1999/02/22-rdf-syntax-ns#Bag<span style="color: #000000; font-weight: bold;">&gt;</span></span> ;
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//www.w3.org/1999/02/22-rdf-syntax-ns#_1<span style="color: #000000; font-weight: bold;">&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//sandbox.fluidinfo.com/tags/fluiddb/about<span style="color: #000000; font-weight: bold;">&gt;</span></span> ;
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//www.w3.org/1999/02/22-rdf-syntax-ns#_2<span style="color: #000000; font-weight: bold;">&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//sandbox.fluidinfo.com/tags/fluiddb/tags/path<span style="color: #000000; font-weight: bold;">&gt;</span></span> ;
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//www.w3.org/1999/02/22-rdf-syntax-ns#_3<span style="color: #000000; font-weight: bold;">&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;http:</span>//sandbox.fluidinfo.com/tags/fluiddb/tags/description<span style="color: #000000; font-weight: bold;">&gt;</span></span>
.</pre></div></div>

<h2>Creating and RDF endpoint</h2>
<p>Armed with the previous, the thing should be easy. Just allow querying for objects, then collect the object information, and finally generate the final RDF. Using <a href="http://seasr.org/meandre">Meandre</a> and <a href="http://github.com/rossjones/JFluidDB">JFLuidDB</a> I wrote a few components that allow the simple creation of such an endpoint as illustrated by the picture below.</p>
<p><a href="http://www.xavierllora.net/wp-content/uploads/2009/09/meandre-fluiddb-rdf.png"><img src="http://www.xavierllora.net/wp-content/uploads/2009/09/meandre-fluiddb-rdf.png" alt="Meandre FluidDB RDF endpoint" title="Meandre FluidDB RDF endpoint" width="500" height="204" class="aligncenter size-full wp-image-602" /></a></p>
<p>The basic mechanism is simple. Just push the query into the <em>Query for objects</em> component. This component will stream each of the <code>uuid</code> of the matched objects to <em>Read object</em> which pulls the object information. Then the object is passed to <em>Object to RDF model</em> that basically generates the RDF snipped shown in the example shown above for each of the objects pushed. Finally all the RDF fragments are reduced together by component <em>Wrapped models reducer</em>. Then the resulting RDF model just gets serialize into text using the Turtle notation. Finally the serialized text is printed to the console. The equivalent code could be express as a <a href="http://seasr.org/meandre/documentation/for-developers/zigzag/">ZigZag</a> script as:</p>
<pre>
#
# Imports eliminated for clarity
#

#
# Create the component aliases
#
alias <meandre://fluidinfo.com/fluiddb/meandre/component/object-to-rdf> as OBJECT_TO_RDF
alias <meandre://fluidinfo.com/fluiddb/meandre/component/print-object> as PRINT_OBJECT
alias <meandre://fluidinfo.com/fluiddb/meandre/component/query-for-objects> as QUERY_FOR_OBJECTS
alias <meandre://fluidinfo.com/fluiddb/meandre/component/reads-the-requested-object> as READS_THE_REQUESTED_OBJECT
alias <meandre://seasr.org/components/tools/wrapped-models-reducer> as WRAPPED_MODELS_REDUCER
alias <meandre://seasr.org/components/tools/model-to-rdf-text> as MODEL_TO_RDF_TEXT
alias <meandre://fluidinfo.com/fluiddb/meandre/component/push-string> as PUSH_STRING

#
# Create the component instances
#
push_query_string = PUSH_STRING()
wrapped_models_reducer = WRAPPED_MODELS_REDUCER()
query_for_objects = QUERY_FOR_OBJECTS()
reads_object = READS_THE_REQUESTED_OBJECT()
model_to_rdf_text = MODEL_TO_RDF_TEXT()
print_rdf_text = PRINT_OBJECT()
object_to_rdf_model = OBJECT_TO_RDF()

#
# Set component properties
#
push_query_string.message = "has fluiddb/tag/path"
query_for_objects.fluiddb_url = "http://sandbox.fluidinfo.com"
eads_object.fluiddb_url = "http://sandbox.fluidinfo.com"
model_to_rdf_text.rdf_dialect = "TTL"

#
# Create the flow by connecting the components
#
@query_for_objects_outputs = query_for_objects()
@model_to_rdf_text_outputs = model_to_rdf_text()
@push_query_string_outputs = push_query_string()
@object_to_rdf_model_outputs = object_to_rdf_model()
@reads_object_outputs = reads_object()
@wrapped_models_reducer_outputs = wrapped_models_reducer()

query_for_objects(text: push_query_string_outputs.text)
model_to_rdf_text(model: wrapped_models_reducer_outputs.model)
object_to_rdf_model(object: reads_object_outputs.object)
reads_object(uuid: query_for_objects_outputs.uuid)[+200!]
print_rdf_text(object: model_to_rdf_text_outputs.text)
wrapped_models_reducer(model: object_to_rdf_model_outputs.model)
</pre>
<p>The only interesting element in the script is the [+200!] entry that creates 200 parallel copies of read object that will concurrently hit FluidDB to pull the data, trying to minimize the latency. The script could be compiled into a MAU and run. The output of the execution would look like the following:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">$ java <span style="color: #339933;">-</span>jar zzre<span style="color: #339933;">-</span>1.4.7.<span style="color: #006633;">jar</span> pull<span style="color: #339933;">-</span>test.<span style="color: #006633;">mau</span> 
Meandre MAU Executor <span style="color: #009900;">&#91;</span>1.0.1vcli<span style="color: #339933;">/</span>1.4.7<span style="color: #009900;">&#93;</span>
All rights reserved by DITA, NCSA, UofI <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2007</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">2009</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">THIS</span> SOFTWARE IS PROVIDED UNDER University of Illinois<span style="color: #339933;">/</span>NCSA OPEN SOURCE LICENSE.
&nbsp;
<span style="color: #006633;">Executing</span> MAU file pull<span style="color: #339933;">-</span>test.<span style="color: #006633;">mau</span>
Creating temp dir pull<span style="color: #339933;">-</span>test.<span style="color: #006633;">mau</span>.<span style="color: #006633;">run</span>
Creating temp dir pull<span style="color: #339933;">-</span>test.<span style="color: #006633;">mau</span>.<span style="color: #006633;">public_resources</span>
&nbsp;
Preparing flow<span style="color: #339933;">:</span> meandre<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//seasr.org/zigzag/1253813636945/4416962494019783033/flow/pull-test-mau/</span>
<span style="color: #cc66cc;">2009</span><span style="color: #339933;">-</span>09<span style="color: #339933;">-</span><span style="color: #cc66cc;">24</span> <span style="color: #cc66cc;">12</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">34</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">38.480</span><span style="color: #339933;">::</span>INFO<span style="color: #339933;">:</span>  jetty<span style="color: #339933;">-</span>6.1.<span style="color: #006633;">x</span>
<span style="color: #cc66cc;">2009</span><span style="color: #339933;">-</span>09<span style="color: #339933;">-</span><span style="color: #cc66cc;">24</span> <span style="color: #cc66cc;">12</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">34</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">38.495</span><span style="color: #339933;">::</span>INFO<span style="color: #339933;">:</span>  Started SocketConnector@0.0.0.0<span style="color: #339933;">:</span><span style="color: #cc66cc;">1715</span>
Preparation completed correctly
&nbsp;
Execution started at<span style="color: #339933;">:</span> <span style="color: #cc66cc;">2009</span><span style="color: #339933;">-</span>09<span style="color: #339933;">-</span>24T12<span style="color: #339933;">:</span><span style="color: #cc66cc;">34</span><span style="color: #339933;">:</span><span style="color: #cc66cc;">38</span>
<span style="color: #339933;">----------------------------------------------------------------------------</span>
<span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/objects/a24b4a18-5483-47c6-9b62-0955210c7ebd&gt;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#type&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/objects/&gt; , &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#_1&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/tags/fluiddb/about&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#_2&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/tags/fluiddb/tags/path&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#_3&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/tags/fluiddb/tags/description&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//purl.org/dc/elements/1.1/description&gt;</span>
              <span style="color: #0000ff;">&quot;Object for the attribute test/Net::FluidDB-name-1253772095.82845-0.944567286499904&quot;</span><span style="color: #339933;">^^&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/2001/XMLSchema#string&gt; .</span>
&nbsp;
<span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/objects/5ff74371-455b-4299-83f9-ba13ae898ad1&gt;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#type&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/objects/&gt; , &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#_1&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/tags/fluiddb/about&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#_2&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/tags/fluiddb/tags/path&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#_3&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/tags/fluiddb/tags/description&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//purl.org/dc/elements/1.1/description&gt;</span>
              <span style="color: #0000ff;">&quot;Object for the attribute test/Net::FluidDB-name-1253622685.3231461-0.437099602163897316&quot;</span><span style="color: #339933;">^^&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/2001/XMLSchema#string&gt; .</span>
&nbsp;
<span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/objects/67e52346-527e-4bb7-b8f3-05fa8a8ae35b&gt;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#type&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/objects/&gt; , &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#_1&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/tags/fluiddb/about&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#_2&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/tags/fluiddb/tags/path&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#_3&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/tags/fluiddb/tags/description&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//purl.org/dc/elements/1.1/description&gt;</span>
              <span style="color: #0000ff;">&quot;Object for the attribute test/Net::FluidDB-name-1253620190.69175-0.861614257420541&quot;</span><span style="color: #339933;">^^&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/2001/XMLSchema#string&gt; .</span>
&nbsp;
<span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/objects/8a65a184-03d9-4881-95df-02fa0561a86f&gt;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#type&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/objects/&gt; , &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#_1&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/tags/fluiddb/about&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#_2&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/tags/fluiddb/tags/path&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#_3&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/tags/fluiddb/tags/description&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//purl.org/dc/elements/1.1/description&gt;</span>
              <span style="color: #0000ff;">&quot;Object for the attribute fluiddb/namespaces/permission/update/exceptions&quot;</span><span style="color: #339933;">^^&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/2001/XMLSchema#string&gt; .</span>
&nbsp;
<span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/objects/335b44e9-a72f-479d-ad60-3661a35231ba&gt;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#type&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/objects/&gt; , &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#_1&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/tags/fluiddb/about&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#_2&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/tags/fluiddb/tags/path&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#_3&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/tags/fluiddb/tags/description&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//purl.org/dc/elements/1.1/description&gt;</span>
              <span style="color: #0000ff;">&quot;Object for the attribute test/Net::FluidDB-name-1253776141.95577-0.284175700598524&quot;</span><span style="color: #339933;">^^&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/2001/XMLSchema#string&gt; .</span>
&nbsp;
<span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/objects/3bbf1cc6-731c-4e56-a664-adeb5484334f&gt;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#type&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/objects/&gt; , &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#_1&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/tags/fluiddb/about&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#_2&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/tags/fluiddb/tags/path&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#_3&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/tags/fluiddb/tags/description&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//purl.org/dc/elements/1.1/description&gt;</span>
              <span style="color: #0000ff;">&quot;Object for the attribute fluiddb/namespaces/permission/delete/policy&quot;</span><span style="color: #339933;">^^&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/2001/XMLSchema#string&gt; .</span>
&nbsp;
<span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/objects/aba5adcf-fd44-40ab-b702-9cc635650bc3&gt;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#type&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/objects/&gt; , &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#_1&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/tags/fluiddb/about&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#_2&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/tags/fluiddb/tags/path&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#_3&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/tags/fluiddb/tags/description&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//purl.org/dc/elements/1.1/description&gt;</span>
              <span style="color: #0000ff;">&quot;Object for the attribute test/Net::FluidDB-name-1253614713.757-0.604769721717702&quot;</span><span style="color: #339933;">^^&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/2001/XMLSchema#string&gt; .</span>
&nbsp;
<span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/objects/f61ceb3b-33df-4356-8e7d-c56d3d0ae338&gt;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#type&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/objects/&gt; , &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#_1&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/tags/fluiddb/about&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#_2&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/tags/fluiddb/tags/path&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/1999/02/22-rdf-syntax-ns#_3&gt;</span>
              <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//sandbox.fluidinfo.com/tags/fluiddb/tags/description&gt; ;</span>
      <span style="color: #339933;">&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//purl.org/dc/elements/1.1/description&gt;</span>
              <span style="color: #0000ff;">&quot;Object for the attribute test/Net::FluidDB-name-1253615887.80879-0.0437609496034099&quot;</span><span style="color: #339933;">^^&lt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.w3.org/2001/XMLSchema#string&gt; .</span>
&nbsp;
...</pre></div></div>

<p>That&#8217;s it! A first RDF dump of the query!</p>
<h2>The not so great news</h2>
<p>The current <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> API does not provide any method to be able to pull data from more than one object at once. That basically means, that for each <code>uuid</code> a call to the server needs to be process. That is a huge latency overhead. The <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> guys know about it and they are scratching their heads on how to provide a &#8220;multi get&#8221;. A full trace of the output can be found on this <a href='http://www.xavierllora.net/wp-content/uploads/2009/09/fluiddb.txt'>FluidDB RDF endpoint trace</a>.</p>
<p>This element is crucial for any RDF endpoint. Above I left out a basic element, the time measures. That part looks like:</p>
<pre>
Flow execution statistics

Flow unique execution ID : meandre://seasr.org/zigzag/1253813636945/4416962494019783033/flow/pull-test-mau/8D8E354A/1253813678323/1493255769/
Flow state               : ended
Started at               : Thu Sep 24 12:34:38 CDT 2009
Last update              : Thu Sep 24 12:37:28 CDT 2009
Total run time (ms)      : 170144
</pre>
<p>Basically 170s to pull only 238 objects, where all the time is spent round tripping to <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a>. </p>
<h2>Getting there</h2>
<p>This basically means that such high latency would not allow efficient interactive usage of the end point. However, this exercise was useful to prof that simple RDF endpoints for <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> are possible and would greatly boost the flexibility of interaction with <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> . The current form of the endpoint is may still have value if you are not in a hurry, allowing you to run <a href="http://www.w3.org/TR/rdf-sparql-query/">SPARQL</a> queries against <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> data and get the best of both worlds.</p>
<h2>The code use</h2>
<p>If you are interested on running the code, you may need <a href="http://seasr.org/meandre">Meandre</a> and the components I put together for the experiment, that you can get from <a href="http://github.com/xllora/liquid">http://github.com/xllora/liquid</a>.</p>


<p>Related posts:<ol><li><a href='http://www.xavierllora.net/2009/08/25/liquid-rdf-meandering-in-fluiddb/' rel='bookmark' title='Permanent Link: Liquid: RDF meandering in FluidDB'>Liquid: RDF meandering in FluidDB</a></li>
<li><a href='http://www.xavierllora.net/2009/09/29/temporary-storage-for-meandres-distribute-flow-execution/' rel='bookmark' title='Permanent Link: Temporary storage for Meandre&#8217;s distributed flow execution'>Temporary storage for Meandre&#8217;s distributed flow execution</a></li>
<li><a href='http://www.xavierllora.net/2009/02/04/efficient-serialization-for-java-and-beyond/' rel='bookmark' title='Permanent Link: Efficient serialization for Java (and beyond)'>Efficient serialization for Java (and beyond)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xavierllora.net/2009/09/24/liquid-rdf-endpoint-for-fluiddb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
