<?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; Notes</title>
	<atom:link href="http://www.xavierllora.net/category/notes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xavierllora.net</link>
	<description>A notebook on data-intensive computing, genetics-based machine learning &#38; more.</description>
	<lastBuildDate>Sun, 08 Jan 2012 19:39:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>A Little Functionality and Face Lift</title>
		<link>http://www.xavierllora.net/2011/06/04/a-little-functionality-and-face-lift/</link>
		<comments>http://www.xavierllora.net/2011/06/04/a-little-functionality-and-face-lift/#comments</comments>
		<pubDate>Sat, 04 Jun 2011 06:19:51 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[+1]]></category>

		<guid isPermaLink="false">http://www.xavierllora.net/?p=748</guid>
		<description><![CDATA[It has been a while since the last face lift to this blog. No, I was not planning any major revamp, but a simple one. Since it was released, I had the little green ShareThis button hanging around. I just wanted to balance a bit the elements on the page. I decided to reposition the [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>It has been a while since the last face lift to this blog.  No, I was not planning any major revamp, but a simple one. Since it was released, I had the little green <a href="http://sharethis.com/">ShareThis</a> button hanging around. I just wanted to balance a bit the elements on the page. I decided to reposition the button on the top right of the excerpts and on the post themselves. While doing the repositioning I decided to simplify a bit its functionality and replace the button with something a bit lighter and still with purpose. After giving it a bit of a thought I replaced it with <a href="http://www.google.com/+1/button/">Google&#8217;s +1 button</a> for publishers. It looks a little best balanced and it does not clutter the layout. You can find more information on how to add the +1 button to your site can be found at the <a href="http://www.google.com/webmasters/+1/button/">+1 button page for webmasters</a>. </p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.xavierllora.net/2011/06/04/a-little-functionality-and-face-lift/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Minor Update</title>
		<link>http://www.xavierllora.net/2010/06/24/minor-update/</link>
		<comments>http://www.xavierllora.net/2010/06/24/minor-update/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 05:04:12 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[blogging]]></category>

		<guid isPermaLink="false">http://www.xavierllora.net/?p=694</guid>
		<description><![CDATA[If you used to check my Twitter stream in the center column at the bottom of my blog, you would have noticed  I have just replaced it with my Google Buzz profile stream instead. Yes, you can still see the my Twitter activity, but you will also be able to (1) see aggregated content/activity coming from other [...]
Related posts:<ol>
<li><a href='http://www.xavierllora.net/2009/02/16/revamping-my-twitter-accounts/' rel='bookmark' title='Revamping my Twitter accounts'>Revamping my Twitter accounts</a></li>
<li><a href='http://www.xavierllora.net/2006/01/28/2006-jose-luis-balcazar-open/' rel='bookmark' title='2006 José Luís Balcazar Open'>2006 José Luís Balcazar Open</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>If you used to check my <a href="http://twitter.com/xllora">Twitter stream</a> in the center column at the bottom of my blog, you would have noticed  I have just replaced it with my <a href="http://www.google.com/profiles/101892163699515371535">Google Buzz profile stream</a> instead. Yes, you can still see the my <a href="http://twitter.com/xllora">Twitter activity</a>, but you will also be able to (1) see aggregated content/activity coming from other sources in one place, (2) subscribe to the stream, and (3) comment on each of the entries. As, I said, a minor update to improve its functionality a bit more.</p>
<p>Related posts:<ol>
<li><a href='http://www.xavierllora.net/2009/02/16/revamping-my-twitter-accounts/' rel='bookmark' title='Revamping my Twitter accounts'>Revamping my Twitter accounts</a></li>
<li><a href='http://www.xavierllora.net/2006/01/28/2006-jose-luis-balcazar-open/' rel='bookmark' title='2006 José Luís Balcazar Open'>2006 José Luís Balcazar Open</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xavierllora.net/2010/06/24/minor-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Soaring the Clouds with Meandre</title>
		<link>http://www.xavierllora.net/2010/03/15/soaring-the-clouds-with-meandre/</link>
		<comments>http://www.xavierllora.net/2010/03/15/soaring-the-clouds-with-meandre/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 22:55:11 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Data-Intensive Computing]]></category>
		<category><![CDATA[Notes]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[hadoop]]></category>
		<category><![CDATA[meandre]]></category>
		<category><![CDATA[ZigZag]]></category>

		<guid isPermaLink="false">http://www.xavierllora.net/?p=659</guid>
		<description><![CDATA[You may find the slide deck and the abstract for the presentation we delivered today at the &#8220;Data-Intensive Research: how should we improve our ability to use data&#8221; workshop in Edinburgh. Abstract This talk will focus a highly scalable data intensive infrastructure being developed at the National Center for Supercomputing Application (NCSA) at the University [...]
Related posts:<ol>
<li><a href='http://www.xavierllora.net/2008/11/15/meandre-semantic-driven-data-intensive-flows-in-the-clouds/' rel='bookmark' title='Meandre: Semantic-Driven Data-Intensive Flows in the Clouds'>Meandre: Semantic-Driven Data-Intensive Flows in the Clouds</a></li>
<li><a href='http://www.xavierllora.net/2008/04/18/meandre-semantic-driven-data-intensive-flow-engine/' rel='bookmark' title='Meandre: Semantic-Driven Data-Intensive Flow Engine'>Meandre: Semantic-Driven Data-Intensive Flow Engine</a></li>
<li><a href='http://www.xavierllora.net/2009/01/29/data-intensive-computing-for-competent-genetic-algorithms-a-pilot-study-using-meandre/' rel='bookmark' title='Data-Intensive Computing for Competent Genetic Algorithms: A Pilot Study using  Meandre'>Data-Intensive Computing for Competent Genetic Algorithms: A Pilot Study using  Meandre</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>You may find the slide deck and the abstract for the presentation we delivered today at the <a href="http://wikis.nesc.ac.uk/escienvoy/Data-Intensive_Research:_how_should_we_improve_our_ability_to_use_data">&#8220;Data-Intensive Research: how should we improve our ability to use data&#8221;</a> workshop in Edinburgh.</p>
<p><center><iframe src="http://www.slideshare.net/slideshow/embed_code/3440242" width="425&type=s" height="356" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe><br/><br/></center></p>
<p><strong>Abstract</strong></p>
<p>This talk will focus a highly scalable data intensive infrastructure being developed at the National Center for Supercomputing Application (NCSA) at the University of Illinois and will introduce current research efforts to tackle the challenges presented by big-data. Research efforts include exploring potential ways of integration between cloud computing concepts—such as Hadoop or Meandre—and traditional HPC technologies and assets. These architecture models contrast significantly, but can be leveraged by building cloud conduits that connect these resources to provide even greater flexibility and scalability on demand. Orchestrating the physical computational environment requires innovative and sophisticated software infrastructure that can transparently take advantage of the functional features and to negotiate the constraints imposed by this diversity of computational resources. Research conducted during the development of the Meandre infrastructure has lead to the production of an agile conductor able to leverage the particular advantages in the physical diversity. It can also be implemented as services and/or in the context of another application benefitting from it reusability, flexibility, and high-scalability. Some example applications and an introduction to the data intensive infrastructure architecture will be presented to provide an overview of the diverse scope of Meandre usages. Finally, a case will be presented showing how software developers and system designers can easily transition to these new paradigms to address the primary data-deluge challenges and to soar to new heights with extreme application scalability using cloud computing concepts.</p>
<p>Related posts:<ol>
<li><a href='http://www.xavierllora.net/2008/11/15/meandre-semantic-driven-data-intensive-flows-in-the-clouds/' rel='bookmark' title='Meandre: Semantic-Driven Data-Intensive Flows in the Clouds'>Meandre: Semantic-Driven Data-Intensive Flows in the Clouds</a></li>
<li><a href='http://www.xavierllora.net/2008/04/18/meandre-semantic-driven-data-intensive-flow-engine/' rel='bookmark' title='Meandre: Semantic-Driven Data-Intensive Flow Engine'>Meandre: Semantic-Driven Data-Intensive Flow Engine</a></li>
<li><a href='http://www.xavierllora.net/2009/01/29/data-intensive-computing-for-competent-genetic-algorithms-a-pilot-study-using-meandre/' rel='bookmark' title='Data-Intensive Computing for Competent Genetic Algorithms: A Pilot Study using  Meandre'>Data-Intensive Computing for Competent Genetic Algorithms: A Pilot Study using  Meandre</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xavierllora.net/2010/03/15/soaring-the-clouds-with-meandre/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Meandre is going Scala</title>
		<link>http://www.xavierllora.net/2009/12/01/meandre-is-going-scala/</link>
		<comments>http://www.xavierllora.net/2009/12/01/meandre-is-going-scala/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 20:01:47 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[clojure]]></category>
		<category><![CDATA[data-intensive flows]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[jruby]]></category>
		<category><![CDATA[jython]]></category>
		<category><![CDATA[meandre]]></category>
		<category><![CDATA[scala]]></category>
		<category><![CDATA[ZigZag]]></category>

		<guid isPermaLink="false">http://www.xavierllora.net/?p=637</guid>
		<description><![CDATA[After quite a bit of experimenting with different alternatives, Meandre is moving into Scala. Scala is a general purpose programming language designed to express common programming patterns in a concise, elegant, and type-safe way. This is not a radical process, but a gradual one while I am starting to revisit the infrastructure for the next [...]
Related posts:<ol>
<li><a href='http://www.xavierllora.net/2010/07/15/meandre-2-0-alpha-preview-scala-mongodb/' rel='bookmark' title='Meandre 2.0 Alpha Preview = Scala + MongoDB'>Meandre 2.0 Alpha Preview = Scala + MongoDB</a></li>
<li><a href='http://www.xavierllora.net/2010/01/21/fast-rest-api-prototyping-with-crochet-and-scala/' rel='bookmark' title='Fast REST API prototyping with Crochet and Scala'>Fast REST API prototyping with Crochet and Scala</a></li>
<li><a href='http://www.xavierllora.net/2009/09/29/temporary-storage-for-meandres-distribute-flow-execution/' rel='bookmark' title='Temporary storage for Meandre&#8217;s distributed flow execution'>Temporary storage for Meandre&#8217;s distributed flow execution</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>After quite a bit of experimenting with different alternatives, <a href="http://seasr.org/meandre">Meandre</a> is moving into <a href="http://www.scala-lang.org/">Scala</a>. <a href="http://www.scala-lang.org/">Scala</a> is a general purpose programming language designed to express common programming patterns in a concise, elegant, and type-safe way. This is not a radical process, but a gradual one while I am starting to revisit the infrastructure for the next major release. <a href="http://www.scala-lang.org/">Scala</a> also generates code for the JVM making mix and match trivial. I started fuzzing around with Scala back when I started the development of <a href="http://seasr.org/meandre">Meandre</a> during the summer of 2007, however I did fall back to Java since that was what most of the people in the group was comfortable with. I was fascinated with <a href="http://www.scala-lang.org/">Scala</a> fusion of object oriented programming and functional programming. Time went by and the codebase has grown to a point that I cannot stand anymore cutting through the weeds of Java when I have to extend the infrastructure or do bug fixing&#8212;not to mention its verbosity even for writing trivial code.</p>
<p>This summer I decided to go on a quest to get me out of the woods. I do not mind relying on the JVM and the large collection of libraries available, but I would also like to get my sanity back. Yes, I tested some of the usual suspects for the JVM (<a href="http://www.jython.org/">Jython</a>, <a href="http://jruby.org/">JRuby</a>, <a href="http://clojure.org/">Clojure</a>, and <a href="http://groovy.codehaus.org/">Groovy</a>) but not quite what I wanted. For instance, I wrote most of the <a href="http://seasr.org/meandre">Meandre</a> infrastructure services using <a href="http://www.jython.org/">Jython</a> (much more concise than Java), but still not quite happy to jump on that boat. <a href="http://clojure.org/">Clojure</a> is also interesting (functional programming) but it would be hard to justify for the group to move into it since not everybody may feel comfortable with a pure functional language. I also toyed with some not-so-usual ones like <a href="http://www.erlang.org/">Erlang</a> and <a href="http://www.haskell.org/">Haskell</a>, but again, I ended up with no real argument that could justify such a decision. </p>
<p>So, as I started doing back in 2007, I went back to my original idea of using  <a href="http://www.scala-lang.org/">Scala</a> and its mixed object-oriented- and functional-programming- paradigm. To test it seriously, I started developing the distributed execution engine for <a href="http://seasr.org/meandre">Meandre</a> in  <a href="http://www.scala-lang.org/">Scala</a> using its Earlang-inspired actors. And, boom, suddenly I found myself spending more time thinking that writing/debugging threaded/networking code <img src='http://www.xavierllora.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . Yes, I regret my 2007 decision instead of running with my original intuition, but better late than never. With a working seed of the distributed engine working and tested (did I mention that <a href="http://code.google.com/p/scalacheck/">scalacheck</a> and <a href="http://code.google.com/p/specs/">specs</a> are really powerful tools for behavior driven development?), I finally decided to start gravitating the Meandre infrastructure development effort from Java to <a href="http://www.scala-lang.org/">Scala</a>&#8212;did I mention that <a href="http://www.scala-lang.org/">Scala</a> is Martin Odersky&#8217;s child? Yes, such a decision has some impact on my colleagues, but I envision that the benefits will eventually weight out the initial resistance and step learning curve. At least, the last two group meetings nobody jumped off the window while presenting the key elements of  <a href="http://www.scala-lang.org/">Scala</a>, and demonstrating how concise and elegant it made the first working seed of the distributed execution engine <img src='http://www.xavierllora.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . We even got in discussions about the benefits of using <a href="http://www.scala-lang.org/">Scala</a> if it delivered everything I showed. I am lucky to work with such smart guys. If you want to take a peek at the <a href="http://dev-tools.seasr.org/fisheye/browse/Snowfield">distributed execution engine (a.k.a. Snowfield) at SEASR&#8217;s Fisheye</a>.</p>
<p>Oh, one last thing. Are you using Atlassian&#8217;s Fisheye? Do you want <a href='http://www.xavierllora.net/wp-content/uploads/2009/12/scala.def_.gz'>syntax highlighting for Scala</a>? I tweaked the Java definitions to make it highlight  <a href="http://www.scala-lang.org/">Scala</a> code. Remember to drop the <code>scala.def</code> file on <code>$FISHEYE_HOME/syntax</code> directory add an entry on the filename.map to make it highlight anything with extension <code>.scala</code>.</p>
<p>Related posts:<ol>
<li><a href='http://www.xavierllora.net/2010/07/15/meandre-2-0-alpha-preview-scala-mongodb/' rel='bookmark' title='Meandre 2.0 Alpha Preview = Scala + MongoDB'>Meandre 2.0 Alpha Preview = Scala + MongoDB</a></li>
<li><a href='http://www.xavierllora.net/2010/01/21/fast-rest-api-prototyping-with-crochet-and-scala/' rel='bookmark' title='Fast REST API prototyping with Crochet and Scala'>Fast REST API prototyping with Crochet and Scala</a></li>
<li><a href='http://www.xavierllora.net/2009/09/29/temporary-storage-for-meandres-distribute-flow-execution/' rel='bookmark' title='Temporary storage for Meandre&#8217;s distributed flow execution'>Temporary storage for Meandre&#8217;s distributed flow execution</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xavierllora.net/2009/12/01/meandre-is-going-scala/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Temporary storage for Meandre&#8217;s distributed flow execution</title>
		<link>http://www.xavierllora.net/2009/09/29/temporary-storage-for-meandres-distribute-flow-execution/</link>
		<comments>http://www.xavierllora.net/2009/09/29/temporary-storage-for-meandres-distribute-flow-execution/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 15:14:28 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Data-Intensive Computing]]></category>
		<category><![CDATA[data-intensive flows]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[meandre]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[tokyo cabinet]]></category>

		<guid isPermaLink="false">http://www.xavierllora.net/?p=615</guid>
		<description><![CDATA[Designing the distributed execution of a generic Meandre flow involves several moving pieces. One of those is the temporary storage required by the computing nodes (think of it as one node as one isolated component of a flow) to keep up with the data generated by a component, and also be able to replicate such [...]
Related posts:<ol>
<li><a href='http://www.xavierllora.net/2009/08/13/easy-reliable-and-flexible-storage-for-python/' rel='bookmark' title='Easy, reliable, and flexible storage for Python'>Easy, reliable, and flexible storage for Python</a></li>
<li><a href='http://www.xavierllora.net/2008/07/01/efficient-storage-for-python/' rel='bookmark' title='Efficient storage for Python'>Efficient storage for Python</a></li>
<li><a href='http://www.xavierllora.net/2008/06/05/the-next-generation-of-data-bases/' rel='bookmark' title='The next generation of data bases'>The next generation of data bases</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Designing the distributed execution of a generic Meandre flow involves several moving pieces. One of those is the temporary storage required by the computing nodes (think of it as one node as one isolated component of a flow) to keep up with the data generated by a component, and also be able to replicate such storage to the node containing the consumer to be fed. Such storage, local to each node, must guarantee at least three basic properties.</p>
<ul>
<li>Transaction ready</li>
<li>Light weight implementation</li>
<li>Efficient write and read to minimize the contention on ports</li>
</ul>
<p>Also, it is important to keep in mind that in a distributed execution scenario, each node requires to have its one separated and standalone storage system. Thus, it is also important to minimize the overhead of installation and maintenance of such storage subsystem. There are several alternatives available ranging from traditional relational data base systems to home-brewed solutions. Relational data base systems provide a distributed, reliable, stable, and well tested environment, but they may tend to require a quite involved installation and maintenance. Also, tuning those systems to optimize performance may required quite an involved monitoring and tweaking. On the other hand, home-brewed solutions can be optimized for performance by dropping non required functionality and focussing on writing and reading performance. However, such solutions tend to be bug prone and tend to become time consuming, not to mention that proving transaction correctness can be quite involved.</p>
<p>Fortunately there is a middle ground where efficient and stable transaction aware solutions are available. They may not provide SQL interfaces, but they still provide transaction boundaries. Also, since they are oriented to maximize performance, they can provide better throughput and operation latency than having to traverse the SQL stack. Examples of such storage systems can be found under the areas of key-value stores and column stores. Several options were considered while writing these line, but key-value stores were the ones that better matches the three requirements described above. Several options were informally tested, including solutions like HDF and Berkely DB, however the best performing by far under similar stress test conditions as the sketched temporary storage subsystem was <a href="http://1978th.net/tokyocabinet/">Tokyo Cabinet</a>. I already <a href="/2008/06/05/the-next-generation-of-data-bases/">introduced and <a href="/2009/08/13/easy-reliable-and-flexible-storage-for-python/">tested</a> <a href="http://1978th.net/tokyocabinet/">Tokyo Cabinet</a> more than a year ago, but this time I was going to give it a stress test to basically convince myself that that was what I wanted to use for as temporary storage of the distributed flow execution.</p>
<h2>The experiment</h2>
<p>Tokyo cabinet is a collection of storage utilities including, among other facilities, key-value stores implemented as hash files or B-trees and flexible column stores. To illustrate the performance and throughput you can achieve. To implement multiple queues on a single casket (<a href="http://1978th.net/tokyocabinet/">Tokyo Cabinet</a> file containing the data store) B-trees with duplicated keys can help achieving such goal. The duplicated keys are the queue names, and the values are the <a href="http://en.wikipedia.org/wiki/Universally_Unique_Identifier">UUID</a>s of the objects being store. Objects are also stored in the same B-tree by using the <a href="http://en.wikipedia.org/wiki/Universally_Unique_Identifier">UIUD</a> as a key and the value become the payload to store (usually an array of bytes). </p>
<p>Previously, I have been heavily using Python bindings to test <a href="http://1978th.net/tokyocabinet/">Tokyo Cabinet</a>, but this time I went down the Java route (since the Meandre infrastructure is written on Java). The Java bindings are basically build around JNI and statically link to the C version of <a href="http://1978th.net/tokyocabinet/">Tokyo Cabinet</a> library, giving away the best of both world. To measure how fast can I write data out of a port into the local storage in a transactional mode, I used the following piece of code.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main <span style="color: #009900;">&#40;</span> <span style="color: #003399;">String</span> args <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">int</span> MAX <span style="color: #339933;">=</span> <span style="color: #cc66cc;">10000000</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">int</span> inc <span style="color: #339933;">=</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">int</span> cnt <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">float</span> fa <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">float</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">8</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">int</span> reps <span style="color: #339933;">=</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span> <span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;=</span>MAX <span style="color: #339933;">;</span> i<span style="color: #339933;">*=</span>inc  <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">//System.out.println(&quot;Size: &quot;+i);</span>
			<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> j<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span> <span style="color: #339933;">;</span> j<span style="color: #339933;">&lt;</span>reps <span style="color: #339933;">;</span> j<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>	
				<span style="color: #666666; font-style: italic;">//System.out.println(&quot;\tRepetition: &quot;+j);</span>
&nbsp;
				<span style="color: #666666; font-style: italic;">// open the database</span>
				BDB bdb <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> BDB<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
				<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>bdb.<span style="color: #006633;">open</span><span style="color: #009900;">&#40;</span>TEST_CASKET_TCB, BDB.<span style="color: #006633;">OWRITER</span> <span style="color: #339933;">|</span> BDB.<span style="color: #006633;">OCREAT</span> <span style="color: #339933;">|</span> BDB.<span style="color: #006633;">OTSYNC</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
					<span style="color: #000066; font-weight: bold;">int</span> ecode <span style="color: #339933;">=</span> bdb.<span style="color: #006633;">ecode</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					fail<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;open error: &quot;</span> <span style="color: #339933;">+</span> bdb.<span style="color: #006633;">errmsg</span><span style="color: #009900;">&#40;</span>ecode<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
&nbsp;
				<span style="color: #666666; font-style: italic;">// Add a bunch of duplicates</span>
				<span style="color: #000066; font-weight: bold;">long</span> start <span style="color: #339933;">=</span> <span style="color: #003399;">System</span>.<span style="color: #006633;">currentTimeMillis</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				bdb.<span style="color: #006633;">tranbegin</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> k<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> k<span style="color: #339933;">&lt;</span>i<span style="color: #339933;">;</span> k<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #003399;">String</span> uuid <span style="color: #339933;">=</span> UUID.<span style="color: #006633;">randomUUID</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					bdb.<span style="color: #006633;">putdup</span><span style="color: #009900;">&#40;</span>QUEUE_KEY, uuid<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					bdb.<span style="color: #006633;">putdup</span><span style="color: #009900;">&#40;</span>uuid.<span style="color: #006633;">getBytes</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, uuid.<span style="color: #006633;">getBytes</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
				<span style="color: #009900;">&#125;</span>
				bdb.<span style="color: #006633;">trancommit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				fa<span style="color: #009900;">&#91;</span>cnt<span style="color: #009900;">&#93;</span> <span style="color: #339933;">+=</span> <span style="color: #003399;">System</span>.<span style="color: #006633;">currentTimeMillis</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span>start<span style="color: #339933;">;</span>
&nbsp;
				<span style="color: #666666; font-style: italic;">// Clean up</span>
				bdb.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span>TEST_CASKET_TCB<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">delete</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			fa<span style="color: #009900;">&#91;</span>cnt<span style="color: #009900;">&#93;</span> <span style="color: #339933;">/=</span> reps<span style="color: #339933;">;</span>
			<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">+</span>i<span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #339933;">+</span>fa<span style="color: #009900;">&#91;</span>cnt<span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #339933;">+</span><span style="color: #009900;">&#40;</span>fa<span style="color: #009900;">&#91;</span>cnt<span style="color: #009900;">&#93;</span><span style="color: #339933;">/</span>i<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			cnt<span style="color: #339933;">++;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The idea is very simple. Just go and star storing 1, 10, 100, 1000, 10000, 1000000, and 10000000 pieces of data at once in a transaction. Measure the time. For each data number repeat the operation 10 times and average the time trying to palliate the fact that the experiment was run on a laptop running all sorts of other concurrent applications. Plot the results to illustrate:</p>
<ol>
<li>time required to insert one piece of data as a function of the number of data involve in the transaction</li>
<li>number of pieces of data wrote per second as a function of the number of data involve in the transaction</li>
</ol>
<p>The idea is to expose the behavior of <a href="http://1978th.net/tokyocabinet/">Tokyo Cabinet</a> as more data is involved in a transaction to check if degradation happens as the volume increase. This is an important issue, since data intensive flows can generate large volumes of data per firing event. </p>
<h2>The results</h2>
<p>Results are displayed on the figures below.</p>
<p><a href="http://www.xavierllora.net/wp-content/uploads/2009/09/tc_time.png"><img src="http://www.xavierllora.net/wp-content/uploads/2009/09/tc_time-400x400.png" alt="Time per data unit as a function of number of data involve in a transaction" title="Time per data unit as a function of number of data involve in a transaction" width="300" height="300" /></a><a href="http://www.xavierllora.net/wp-content/uploads/2009/09/tc_throughput.png"><img src="http://www.xavierllora.net/wp-content/uploads/2009/09/tc_throughput-400x400.png" alt="Throughput as a function of number of data in a transaction" title="Throughput as a function of number of data in a transaction" width="300" height="300" /></a></p>
<p>The first important element to highlight is that the time to insert one data element does not degrade as the volume increase. Actually, it is quite interesting that <a href="http://1978th.net/tokyocabinet/">Tokyo Cabinet</a> feels more comfortable as the volume per transaction grows. The throughput results are also interesting, since it shows that it is able to sustain transfers of around 40K data units per second, and that the only bottleneck is the disk cache management and bandwidth to the disk itself&#8212;which gets saturated after pushing more than 10K pieces of data.</p>
<h2>The lessons learned</h2>
<p><a href="http://1978th.net/tokyocabinet/">Tokyo Cabinet</a> is a excellent candidate to support the temporary transactional storage required in a distributed execution of a Meandre flow. Other alternatives like <a href="http://www.mysql.com/">MySQL</a>, embedded <a href="http://db.apache.org/derby/">Apache Derby</a>, the <a href="http://www.oracle.com/database/berkeley-db/je/index.html">Java edition of Berkeley DB</a>, <a href="http://www.zentus.com/sqlitejdbc/">SQLite JDBC</a> could not get even get close to such performance falling at least one order of magnitude behind.</p>
<p>Related posts:<ol>
<li><a href='http://www.xavierllora.net/2009/08/13/easy-reliable-and-flexible-storage-for-python/' rel='bookmark' title='Easy, reliable, and flexible storage for Python'>Easy, reliable, and flexible storage for Python</a></li>
<li><a href='http://www.xavierllora.net/2008/07/01/efficient-storage-for-python/' rel='bookmark' title='Efficient storage for Python'>Efficient storage for Python</a></li>
<li><a href='http://www.xavierllora.net/2008/06/05/the-next-generation-of-data-bases/' rel='bookmark' title='The next generation of data bases'>The next generation of data bases</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xavierllora.net/2009/09/29/temporary-storage-for-meandres-distribute-flow-execution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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='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='Temporary storage for Meandre&#8217;s distributed flow execution'>Temporary storage for Meandre&#8217;s distributed flow execution</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><span style="color: #cc66cc;">6.1</span>.<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='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='Temporary storage for Meandre&#8217;s distributed flow execution'>Temporary storage for Meandre&#8217;s distributed flow execution</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>
		<item>
		<title>Liquid: RDF meandering in FluidDB</title>
		<link>http://www.xavierllora.net/2009/08/25/liquid-rdf-meandering-in-fluiddb/</link>
		<comments>http://www.xavierllora.net/2009/08/25/liquid-rdf-meandering-in-fluiddb/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 18:04:20 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Data-Intensive Computing]]></category>
		<category><![CDATA[Notes]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Social Networks]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[FluidDB]]></category>
		<category><![CDATA[meandre]]></category>
		<category><![CDATA[RDF]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://www.xavierllora.net/?p=577</guid>
		<description><![CDATA[Meandre (NCSA pushed data-intensive computing infrastructure) relies on RDF to describe components, flows, locations and repositories. RDF has become the central piece that makes possible Meandre&#8216;s flexibility and reusability. However, one piece still remains largely sketchy and still has no clear optimal solution: How can we facilitate to anybody sharing, publishing and annotating flows, components, [...]
Related posts:<ol>
<li><a href='http://www.xavierllora.net/2009/09/24/liquid-rdf-endpoint-for-fluiddb/' rel='bookmark' title='Liquid: RDF endpoint for FluidDB'>Liquid: RDF endpoint for FluidDB</a></li>
<li><a href='http://www.xavierllora.net/2010/03/15/soaring-the-clouds-with-meandre/' rel='bookmark' title='Soaring the Clouds with Meandre'>Soaring the Clouds with Meandre</a></li>
<li><a href='http://www.xavierllora.net/2010/07/15/meandre-2-0-alpha-preview-scala-mongodb/' rel='bookmark' title='Meandre 2.0 Alpha Preview = Scala + MongoDB'>Meandre 2.0 Alpha Preview = Scala + MongoDB</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://seasr.org/meandre/">Meandre</a> (<a href="http://www.ncsa.illinois.edu">NCSA</a> pushed data-intensive computing infrastructure) relies on <a href="http://www.w3.org/RDF/">RDF</a> to describe components, flows, locations and repositories. <a href="http://www.w3.org/RDF/">RDF</a> has become the central piece that makes possible <a href="http://seasr.org/meandre/">Meandre</a>&#8216;s flexibility and reusability. However, one piece still remains largely sketchy and still has no clear optimal solution: How can we facilitate to anybody sharing, publishing and annotating flows, components, locations and repositories? More importantly, how can that be done in the cloud in an open-ended fashion and allow anybody to annotate and comment on each of the afore mentioned pieces?</p>
<h3>The FluidDB trip</h3>
<p>During my last summer trip to Europe, <a href="http://blogs.fluidinfo.com/terry/">Terry Jones</a> (CEO) invited me to visit <a href="http://www.fluidinfo.com/">FluidInfo</a> (based in Barcelona) where I also meet <a href="http://blogs.fluidinfo.com/esteve/">Esteve Fernandez</a> (CTO). I had a great opportunity to chat with the masterminds behind an intriguing concept I ran into after a short note I received from <a href="http://www.illigal.uiuc.edu/web/deg/vita/">David E. Goldberg</a>. <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a>, the main product being pushed by <a href="http://www.fluidinfo.com/">FluidInfo</a>, is an online collaborative &#8220;cloud&#8221;  database. On <a href="http://www.fluidinfo.com/">FluidInfo</a> words:</p>
<blockquote><p>
FluidDB lets data be social. It allows almost unlimited information personalization by individual users and applications, and also between them. This makes it simple to build a wide variety of applications that benefit from cooperation, and which are open to unanticipated future enhancements. Even more importantly, FluidDB facilitates and encourages the growth of applications that leave users in control of their own data.
</p></blockquote>
<p><a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> went live on a private alpha last week. The basic concept behind the scenes is simple. <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> stores objects. Objects do not belong to anybody. Objects may be &#8220;blank&#8221; or they may be about something (e.g. <a href="http://seasr.org/meandre">http://seasr.org/meandre</a>). You can create as many blank objects as you want. Creating an object with the same about always returns the same object (thus, there will only be one object about <a href="http://seasr.org/meandre">http://seasr.org/meandre</a>). Once objects exists, things start getting more interesting, you can go and tag any object with whatever tag you want. For instance I could tag the <a href="http://seasr.org/meandre">http://seasr.org/meandre</a> object <code>hosted_by</code> tag, and assign the tag the value <a href="http://www.ncsa.illinois.edu>&#8220;National Center for Supercomputing Applications&#8221;</a> value. Values can be anything you want, from text and numerals to blobs. Finally, <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> introduces one last trick: namespaces. For instance, I got xllora. that means that the above tag I mentioned would look like <code>/tag/xllora/hosted_by</code>. You can create as many nested namespaces under your main namespace as you want. <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> also provides mechanisms to control who can query and see the values of your created tags.</p>
<p>As you can see, the basic object model and mechanics is very simple. When the alpha went live, <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> only provide access via a simple REST-like HTTP API. In a few days a blossom of client libraries that wrap that API were develop by a dynamic community that gather on <code>#fluiddb</code> channel on <code>irc.freenode.net</code> where <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a and early adopters share experiences. </p>
<h3>You were saying something about RDF</h3>
<p>Back to the point. One thing I chatted with the <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> guys was what did they think about the similarities between <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a>&#8216;s object model and RDF. After playing with RDF for a while, the <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> model look awfully familiar, despite a much simplified and manageable model than <a href="http://www.w3.org/RDF/">RDF</a>. They did not have much to say about it, and the question got stuck in the back of my mind. So when I got access to the private alpha, I could not help it but get down the path of what would it mean to map <a href="http://www.w3.org/RDF/">RDF</a> on <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a>. Yes, the simple straight answer would be to stick serialized RDF into the value of a given tag (e.g. <code>xllora/rdf</code>). However, that option seemed poor, since I could not exploit the social aspect of collaborative annotations provided by <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a>. So back to the drawing board. What both models have in common: They are both descriptions about something. In RDF you can see those as the subjects of the triple predicates, whereas in <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> those are simple objects. <a href="http://www.w3.org/RDF/">RDF</a> use properties to qualify objects. <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> uses tags. Both enable you to add value to qualified objects. Mmh, there you go.</p>
<p>With this idea in mind, I started <a href="http://github.com/xllora/liquid/tree/master">Liquid</a>, a simple proof-of-concept library that maps <a href="http://www.w3.org/RDF/">RDF</a> on to <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> and then it gets it back. There was only one thing that needed a bit of patching. <a href="http://www.w3.org/RDF/">RDF</a> properties are arbitrary URIs. Those could not be easily map on the top of <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> tags, so I took a simple compromise route.</p>
<ul>
<li><a href="http://www.w3.org/RDF/">RDF</a>s subject URIs are mapped onto FluidDB qualified objects via the about tag</li>
<li>One <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> tag will contain all the properties for that object (basically a simple dictionary encoded in JSON)</li>
<li>Reference to other <a href="http://www.w3.org/RDF/">RDF</a> URIs will be mapped on to <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> object URIs, and vice versa</li>
</ul>
<p>Let&#8217;s make it a bit more chewable with a simple example.</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;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rdf:RDF</span></span>
<span style="color: #009900;"><span style="color: #000066;">xmlns:rdf</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">xmlns:cd</span>=<span style="color: #ff0000;">&quot;http://www.recshop.fake/cd#&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rdf:Description</span></span>
<span style="color: #009900;"><span style="color: #000066;">rdf:about</span>=<span style="color: #ff0000;">&quot;http://www.recshop.fake/cd/Empire Burlesque&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;cd:artist<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Bob Dylan<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/cd:artist<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rdf:Description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rdf:RDF<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>The above <a href="http://www.w3.org/RDF/">RDF</a> represents a single triple</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">http://www.recshop.fake/cd/Empire Burlesque	http://www.recshop.fake/cd#artist	   &quot;Bob Dylan&quot;</pre></div></div>

<p>This triple could be map onto <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> by creating one qualified <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> object and adding the proper tags. The example below shows how to do so using <a href="http://github.com/njr0/fdb.py/tree/master">Python&#8217;s fdb.py client library</a> by <a href="http://StochasticSolutions.com/about.html">Nicholas J. Radcliffe</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> fdb,<span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">version_info</span> <span style="color: #66cc66;">&lt;</span> <span style="color: black;">&#40;</span><span style="color: #ff4500;">2</span>, <span style="color: #ff4500;">6</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">import</span> simplejson <span style="color: #ff7700;font-weight:bold;">as</span> json
<span style="color: #ff7700;font-weight:bold;">else</span>:
    <span style="color: #ff7700;font-weight:bold;">import</span> json
&nbsp;
__RDF_TAG__ = <span style="color: #483d8b;">'rdf'</span>
__RDF_TAG_PROPERTIES__  = <span style="color: #483d8b;">'rdf_properties'</span>
__RDF_TAG_MODEL_NAME__ = <span style="color: #483d8b;">'rdf_model_name'</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Initialize the FluidDB client library</span>
<span style="color: #808080; font-style: italic;">#</span>
f = fdb.<span style="color: black;">FluidDB</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Create the tags (if they exist, this won't hurt)</span>
<span style="color: #808080; font-style: italic;">#</span>
f.<span style="color: black;">create_abstract_tag</span><span style="color: black;">&#40;</span>__RDF_TAG__<span style="color: black;">&#41;</span>
f.<span style="color: black;">create_abstract_tag</span><span style="color: black;">&#40;</span>__RDF_TAG_PROPERTIES__<span style="color: black;">&#41;</span>
f.<span style="color: black;">create_abstract_tag</span><span style="color: black;">&#40;</span>__RDF_TAG_MODEL_NAME__<span style="color: black;">&#41;</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Create the subject object of the triple</span>
<span style="color: #808080; font-style: italic;">#	</span>
o = f.<span style="color: black;">create_object</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'http://www.recshop.fake/cd/Empire Burlesque'</span><span style="color: black;">&#41;</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Map RDF properties</span>
<span style="color: #808080; font-style: italic;">#</span>
properties = <span style="color: black;">&#123;</span><span style="color: #483d8b;">'http://www.recshop.fake/cd#artist'</span>:<span style="color: black;">&#91;</span><span style="color: #483d8b;">'Bob Dylan'</span><span style="color: black;">&#93;</span><span style="color: black;">&#125;</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Tag the object as RDF aware, properties available, and to which model/named graph </span>
<span style="color: #808080; font-style: italic;"># it belongs</span>
<span style="color: #808080; font-style: italic;">#</span>
f.<span style="color: black;">tag_object_by_id</span><span style="color: black;">&#40;</span>o.<span style="color: #008000;">id</span>, __RDF_TAG__<span style="color: black;">&#41;</span>
f.<span style="color: black;">tag_object_by_id</span><span style="color: black;">&#40;</span>o.<span style="color: #008000;">id</span>,__RDF_TAG_PROPERTIES__,value=json.<span style="color: black;">dumps</span><span style="color: black;">&#40;</span>properties<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
f.<span style="color: black;">tag_object_by_id</span><span style="color: black;">&#40;</span>o.<span style="color: #008000;">id</span>, __RDF_TAG_MODEL_NAME__,<span style="color: #483d8b;">'test_dummy'</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Running along with this basic idea, I quickly stitched <a href="http://github.com/xllora/liquid/tree/master">a simple library (Liquid)</a> that allows ingestion and retrieval of <a href="http://www.w3.org/RDF/">RDF</a> from <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a>. It is still very rudimentary and may not totally map properly all possible <a href="http://www.w3.org/RDF/">RDF</a>, but it is a working proof-of-concept implementation that it is possible to do so.</p>
<p>The Python code above just saves a triple. You can easy retrieve the triple by performing the following operation</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> fdb,<span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">version_info</span> <span style="color: #66cc66;">&lt;</span> <span style="color: black;">&#40;</span><span style="color: #ff4500;">2</span>, <span style="color: #ff4500;">6</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">import</span> simplejson <span style="color: #ff7700;font-weight:bold;">as</span> json
<span style="color: #ff7700;font-weight:bold;">else</span>:
    <span style="color: #ff7700;font-weight:bold;">import</span> json
&nbsp;
__RDF_TAG__ = <span style="color: #483d8b;">'rdf'</span>
__RDF_TAG_PROPERTIES__  = <span style="color: #483d8b;">'rdf_properties'</span>
__RDF_TAG_MODEL_NAME__ = <span style="color: #483d8b;">'rdf_model_name'</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Initialize the FluidDB client library</span>
<span style="color: #808080; font-style: italic;">#</span>
f = fdb.<span style="color: black;">FluidDB</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Retrieve the annotated objects</span>
<span style="color: #808080; font-style: italic;">#</span>
objs = f.<span style="color: black;">query</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'has xllora/%s'</span><span style="color: #66cc66;">%</span><span style="color: black;">&#40;</span>__RDF_TAG__<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Optionally you could retrieve the ones only belonging to a given model by</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># objs = fdb.query('has xllora/%s and xllora/%s matches &quot;%s&quot;'%(__RDF_TAG__,__RDF_TAG_MODEL_NAME__,modelname))</span>
<span style="color: #808080; font-style: italic;">#</span>
subs = <span style="color: black;">&#91;</span>f.<span style="color: black;">get_tag_value_by_id</span><span style="color: black;">&#40;</span>s,<span style="color: #483d8b;">'/tags/fluiddb/about'</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">for</span> s <span style="color: #ff7700;font-weight:bold;">in</span> objs<span style="color: black;">&#93;</span>
props_tmp = <span style="color: black;">&#91;</span>f.<span style="color: black;">get_tag_value_by_id</span><span style="color: black;">&#40;</span>s,<span style="color: #483d8b;">'/tags/xllora/'</span>+__RDF_TAG_PROPERTIES__<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">for</span> s <span style="color: #ff7700;font-weight:bold;">in</span> objs<span style="color: black;">&#93;</span>
props = <span style="color: black;">&#91;</span>json.<span style="color: black;">loads</span><span style="color: black;">&#40;</span>s<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">if</span> s<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>==<span style="color: #ff4500;">200</span> <span style="color: #ff7700;font-weight:bold;">else</span> <span style="color: black;">&#123;</span><span style="color: black;">&#125;</span> <span style="color: #ff7700;font-weight:bold;">for</span> s <span style="color: #ff7700;font-weight:bold;">in</span> props_tmp<span style="color: black;">&#93;</span></pre></div></div>

<p>Now <code>subs</code> contains all the subject URIs for the predicates, and <code>props</code> all the dictionaries containing the properties.</p>
<h3>The bottom line</h3>
<p>OK. So, what is this mapping important? Basically, it will allow collaborative tagging of the created objects (subjects), allowing a collaborative and social gathering of information, besides them mapped <a href="http://www.w3.org/RDF/">RDF</a>. So, what does it all means?</p>
<p>It basically means, that if you do not have the need to ingest <a href="http://www.w3.org/RDF/">RDF</a> (where property URIs are not directly map and you need to Fluidify/reify), any data stored in <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> is already on some form of triplified RDF. Let me explain what I mean by that. Each <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> has a unique URI (e.g. <code>http://fluidDB.fluidinfo.com/objects/4fdf7ff4-f0da-4441-8e63-9b98ed26fc12</code>). Each tag is also uniquely identified by an URI (e.g. <code>http://fluidDB.fluidinfo.com/tags/xllora/rdf_model_name</code>). And finally each pair object/tag may have a value (e.g. a literal <code>'test_dummy'</code> or maybe another URI <code>http://fluidDB.fluidinfo.com/objects/a0dda173-9ee0-4799-a507-8710045d2b07</code>). If a object/tag does not have a value you can just point it to the no value URI (or some other convention you like). </p>
<p>Having said that, now you have all the pieces to express <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> data in plain shareable RDF. That would mean basically get all the tags for and object, query the values, and then just generate and <a href="http://www.w3.org/RDF/">RDF</a> model by adding the gathered triples. That&#8217;s easy. Also, if you align your properties to tags, the ingestion would also become that trivial. I will try to get that piece into <a href="http://github.com/xllora/liquid/tree/master">Liquid</a> as soon as other issues allow me to do so <img src='http://www.xavierllora.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>
<p>Just to close, I would mention once again a key element of this picture. <a href="http://www.fluidinfo.com/fluiddb">FluidDB</a> opens the door to a truly cooperative, distributed, and online fluid semantic web.  It is one of the first examples of how annotations (a.k.a. metadata) can be easily gathered and used on the &#8220;cloud&#8221; for the masses. Great job guys!</p>
<p>Related posts:<ol>
<li><a href='http://www.xavierllora.net/2009/09/24/liquid-rdf-endpoint-for-fluiddb/' rel='bookmark' title='Liquid: RDF endpoint for FluidDB'>Liquid: RDF endpoint for FluidDB</a></li>
<li><a href='http://www.xavierllora.net/2010/03/15/soaring-the-clouds-with-meandre/' rel='bookmark' title='Soaring the Clouds with Meandre'>Soaring the Clouds with Meandre</a></li>
<li><a href='http://www.xavierllora.net/2010/07/15/meandre-2-0-alpha-preview-scala-mongodb/' rel='bookmark' title='Meandre 2.0 Alpha Preview = Scala + MongoDB'>Meandre 2.0 Alpha Preview = Scala + MongoDB</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xavierllora.net/2009/08/25/liquid-rdf-meandering-in-fluiddb/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>LCS &amp; GBML Central under inspection</title>
		<link>http://www.xavierllora.net/2009/05/13/lcs-gbml-central-under-inspection/</link>
		<comments>http://www.xavierllora.net/2009/05/13/lcs-gbml-central-under-inspection/#comments</comments>
		<pubDate>Wed, 13 May 2009 15:07:21 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[GBML & LCS]]></category>
		<category><![CDATA[genetics-based machine learning]]></category>
		<category><![CDATA[Learning Classifier Systems]]></category>

		<guid isPermaLink="false">http://www.xavierllora.net/?p=541</guid>
		<description><![CDATA[It is very common that NCSA machine get continual attacks over the net. Today I got a note from the security team that LCS &#38; GBML Central may have been compromised. We are looking into it. As a precaution the automatic measures has been fired, that means, that the box is currently unroutable. Hope it [...]
Related posts:<ol>
<li><a href='http://www.xavierllora.net/2009/03/27/lcsweb-gbml-blog-lcs-gbml-central/' rel='bookmark' title='LCSweb + GBML blog = LCS &amp; GBML Central'>LCSweb + GBML blog = LCS &amp; GBML Central</a></li>
<li><a href='http://www.xavierllora.net/2010/06/03/lcs-gbml-central-get-a-new-home/' rel='bookmark' title='LCS &amp; GBML Central Gets a New Home'>LCS &#038; GBML Central Gets a New Home</a></li>
<li><a href='http://www.xavierllora.net/2009/05/13/lcs-gbml-central-back-to-production/' rel='bookmark' title='LCS &amp; GBML Central back to production'>LCS &#038; GBML Central back to production</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>It is very common that <a href="http://www.ncsa.uiuc.edu">NCSA</a> machine get continual attacks over the net. Today I got a note from the security team that <a href="http://lcs-gbml.ncsa.uiuc.edu">LCS &amp; GBML Central</a> may have been compromised. We are looking into it. As a precaution the automatic measures has been fired, that means, that the box is currently unroutable. Hope it can be fixed soon. I&#8217;ll keep you posted about the progress.</p>
<p>Related posts:<ol>
<li><a href='http://www.xavierllora.net/2009/03/27/lcsweb-gbml-blog-lcs-gbml-central/' rel='bookmark' title='LCSweb + GBML blog = LCS &amp; GBML Central'>LCSweb + GBML blog = LCS &amp; GBML Central</a></li>
<li><a href='http://www.xavierllora.net/2010/06/03/lcs-gbml-central-get-a-new-home/' rel='bookmark' title='LCS &amp; GBML Central Gets a New Home'>LCS &#038; GBML Central Gets a New Home</a></li>
<li><a href='http://www.xavierllora.net/2009/05/13/lcs-gbml-central-back-to-production/' rel='bookmark' title='LCS &amp; GBML Central back to production'>LCS &#038; GBML Central back to production</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xavierllora.net/2009/05/13/lcs-gbml-central-under-inspection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Squeezing for cycles</title>
		<link>http://www.xavierllora.net/2009/04/01/squeezing-for-cycles/</link>
		<comments>http://www.xavierllora.net/2009/04/01/squeezing-for-cycles/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 01:55:24 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[genetic algorithms]]></category>
		<category><![CDATA[multithreading]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[profiling]]></category>

		<guid isPermaLink="false">http://www.xavierllora.net/?p=491</guid>
		<description><![CDATA[Sometimes thinking a bit helps to rush decisions that may lead to weird places. Today I was going over a simple genetic algorithm for numeric optimization written in C. The code is nothing special, tournament selection without replacement, SBX crossover operator, and polynomial mutation. To the point, I was running a simple OneMax-like problem (in [...]
Related posts:<ol>
<li><a href='http://www.xavierllora.net/2005/11/27/evaluation-consistency-in-igas-user-contradictions-as-cycles-in-partial-ordering-graphs/' rel='bookmark' title='Evaluation consistency in iGAs: User contradictions as cycles in partial-ordering graphs'>Evaluation consistency in iGAs: User contradictions as cycles in partial-ordering graphs</a></li>
<li><a href='http://www.xavierllora.net/2008/11/13/fast-mutation-implementation-for-genetic-algorithms-in-python/' rel='bookmark' title='Fast mutation implementation for genetic algorithms in Python'>Fast mutation implementation for genetic algorithms in Python</a></li>
<li><a href='http://www.xavierllora.net/2006/07/07/analyzing-active-interactive-genetic-algorithms-using-visual-analytics/' rel='bookmark' title='Analyzing active interactive genetic algorithms using visual analytics'>Analyzing active interactive genetic algorithms using visual analytics</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Sometimes thinking a bit helps to rush decisions that may lead to weird places. Today I was going over a simple genetic algorithm for numeric optimization written in C. The code is nothing special, tournament selection without replacement, SBX crossover operator, and polynomial mutation. To the point, I was running a simple OneMax-like problem (in this case, minimize the value of the sum of all the genes), and I was quite surprised the guy was taking so long for. </p>
<pre>
$time ./GATest
----------------------- GA parameters ------------------------------------
Seed: 69
Lower/upper bounds: [1.000000,0.000000]
Genes: 18
Population size: 2000
Iterations: 30
Tournament size: 6
Crossover: pc=0.900000, gwp=0.500000, etaC=10.000000
Mutation: pm=0.100000, etaM=20.000000
----------------------- Evolution Statistics -----------------------------
4.663210	8.974190	13.158102
3.351912	7.405489	11.619360
2.285005	5.375426	9.531691
1.326318	3.711156	7.178203
0.767981	2.432192	4.790854
0.392001	1.543097	3.223604
0.279961	0.977706	2.308249
0.173406	0.600002	1.335702
0.092746	0.359343	0.877080
0.044705	0.216218	0.533978
0.029053	0.130256	0.315306
0.022827	0.078331	0.172908
0.013641	0.047317	0.105886
0.007370	0.028098	0.066994
0.004320	0.016787	0.038499
0.002807	0.010254	0.025155
0.001604	0.006238	0.014528
0.001007	0.003799	0.008883
0.000708	0.002212	0.005627
0.000343	0.001305	0.003263
0.000211	0.000781	0.002025
0.000131	0.000468	0.001155
0.000085	0.000280	0.000774
0.000054	0.000168	0.000392
0.000031	0.000100	0.000243
0.000017	0.000061	0.000144
0.000010	0.000037	0.000083
0.000006	0.000022	0.000054
0.000003	0.000013	0.000035
0.000002	0.000008	0.000020
0.000002	0.000005	0.000011
----------------------- Final outcome ------------------------------------
Min:	(0.000002)	0.000000	0.000000	0.000000	0.000000.000000	0.000000	0.000000	0.000000	0.000000	0.000000.000000	0.000000	0.000000	0.000000	0.000000	0.000000.000000	0.000000
Max:	(0.000011)	0.000000	0.000001	0.000000	0.000000.000001	0.000000	0.000000	0.000001	0.000000	0.000000.000000	0.000003	0.000000	0.000000	0.000000	0.000000.000002	0.000001	

real	0m6.748s
user	0m6.228s
sys	0m0.088s
</pre>
<p>Yup, after turning on all the possible compiler optimizations I could think of, 6.7 seconds was the best I could do on a first generation MacBook Pro. I was wondering if I should spend the time writing a simple multithreaded evaluation. As I said, before making something simple complicated, I decided to put grab <a href="http://developer.apple.com/tools/performance/optimizingwithsystemtrace.html">Shark</a> (Mac&#8217;s free profiler) and get a better picture of what was going. Oh boy! Intuition looking at the wrong place! The outcome: 45% of time spend on tournament selection and 31% generating random number. Mmh, digging a bit further almost all time of tournament selection was spent shuffling an array to guarantee tournaments without replacements.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/** Runs tournament selection without replacement to create a new population
 * 
 * popDest: The destination population
 * popInit: The original population
 * fita: The fitness of the initial populaiton
 * iSize: Tournament size
 * iIndividuals: The population size
 * iGenes: The number of genes of an individual
 */</span>
<span style="color: #993333;">void</span> ga_tournament_selection <span style="color: #009900;">&#40;</span> Population popDest<span style="color: #339933;">,</span> Population popInit<span style="color: #339933;">,</span> Fitness <span style="color: #339933;">*</span> fita<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> iSize<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> iIndividuals <span style="color: #339933;">,</span> <span style="color: #993333;">int</span> iGenes <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #993333;">int</span> piaShuffle<span style="color: #009900;">&#91;</span>iSize<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #993333;">int</span> i <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
	<span style="color: #993333;">int</span> j <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #993333;">int</span> iIndTmp <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
	<span style="color: #993333;">int</span> iIndWin <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
&nbsp;
	Fitness fitWin <span style="color: #339933;">=</span> DBL_MAX<span style="color: #339933;">;</span>
	Fitness fitTmp <span style="color: #339933;">=</span> DBL_MAX<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span> i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span> <span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>iIndividuals <span style="color: #339933;">;</span> i<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #808080; font-style: italic;">/* Initialization for the current tournament */</span>
		fitWin  <span style="color: #339933;">=</span> DBL_MAX<span style="color: #339933;">;</span>
		iIndWin <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
		genrand_shuffle <span style="color: #009900;">&#40;</span>piaShuffle<span style="color: #339933;">,</span>iIndividuals<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span> j<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span> <span style="color: #339933;">;</span> j<span style="color: #339933;">&lt;</span>iSize <span style="color: #339933;">;</span> j<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">// A new randomly drawn individual</span>
			iIndTmp <span style="color: #339933;">=</span> piaShuffle<span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			fitTmp  <span style="color: #339933;">=</span> fita<span style="color: #009900;">&#91;</span>piaShuffle<span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #666666; font-style: italic;">// If it is the first is the winner</span>
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> iIndWin<span style="color: #339933;">==-</span><span style="color: #0000dd;">1</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				iIndWin  <span style="color: #339933;">=</span> iIndTmp<span style="color: #339933;">;</span>
				fitWin <span style="color: #339933;">=</span> fitTmp<span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #666666; font-style: italic;">// If not, chack the fitness (Minimize)</span>
			<span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> fitWin<span style="color: #339933;">&gt;</span>fitTmp <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				iIndWin  <span style="color: #339933;">=</span> iIndTmp<span style="color: #339933;">;</span>
				fitWin <span style="color: #339933;">=</span> fitTmp<span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
		population_copy_individual<span style="color: #009900;">&#40;</span>popDest<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>popInit<span style="color: #009900;">&#91;</span>iIndWin<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>iGenes<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>It was <code>genrand_shuffle</code> (see below) the one that took most of the time. Also if you take a close inspection you will see that it is also the one to blame for calling calling too many times <code>genrand_int31</code>.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">void</span> genrand_shuffle <span style="color: #009900;">&#40;</span> <span style="color: #993333;">int</span> <span style="color: #339933;">*</span> pia<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> iSize <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #993333;">int</span> i<span style="color: #339933;">,</span> iOther<span style="color: #339933;">;</span>
	<span style="color: #993333;">register</span> <span style="color: #993333;">int</span> iTmp<span style="color: #339933;">;</span>
	<span style="color: #993333;">int</span> iRndMax <span style="color: #339933;">=</span> iSize<span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Initialize</span>
	<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span> i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>iSize<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span> pia<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> i<span style="color: #339933;">;</span>
	<span style="color: #666666; font-style: italic;">// shuffle</span>
	<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span> i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>iRndMax<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	    iOther <span style="color: #339933;">=</span> genrand_int31<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">%</span>iSize<span style="color: #339933;">;</span>
	    iTmp <span style="color: #339933;">=</span> pia<span style="color: #009900;">&#91;</span>iOther<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	    pia<span style="color: #009900;">&#91;</span>iOther<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> pia<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	    pia<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> iTmp<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>This inherited implementation of tournament selection works well for small populations, but as you increase the population size, each tournament requires shuffling a number proportional to the population size. If you make the numbers, that leads to a quadratic implementation of tournament selection without replacement. Mmh, really needed? Definitely not. The only thing you need to guarantee to provide a tournament selection without replacement is that you provide different individuals for the tournaments (avoiding repetition). If that selection can be done quickly, you can take the complexity of the implementation down to linear. So there I went, and modified the shuffling function as follows.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">void</span> genrand_shuffle_fast <span style="color: #009900;">&#40;</span> <span style="color: #993333;">int</span> <span style="color: #339933;">*</span> pia<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> iSize<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> iSlots <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #993333;">int</span> i <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
	<span style="color: #993333;">int</span> j <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
&nbsp;
	pia<span style="color: #009900;">&#91;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> genrand_int31<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">%</span>iSize<span style="color: #339933;">;</span>
	<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span> i<span style="color: #339933;">&lt;</span>iSlots <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		pia<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> genrand_int31<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">%</span>iSize<span style="color: #339933;">;</span>
		<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span> j<span style="color: #339933;">=</span>i<span style="color: #339933;">-</span><span style="color: #0000dd;">1</span> <span style="color: #339933;">;</span> j<span style="color: #339933;">&gt;=</span><span style="color: #0000dd;">0</span> <span style="color: #339933;">&amp;&amp;</span> j<span style="color: #339933;">&lt;</span>i <span style="color: #339933;">;</span> j<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> pia<span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span><span style="color: #339933;">==</span>pia<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> 
				<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> j<span style="color: #339933;">==</span>i <span style="color: #009900;">&#41;</span> i<span style="color: #339933;">++</span> <span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Tournaments sizes are usually much much smaller than population sizes (e.g. s=6 for the pop_size=2,000 individuals population used above). Thus, if random numbers are generated, the chances of repeating it are quite small. Also if you also make sure it is not there (and if it is, you generate a new out), basically your are set. (This implementation will only work efficiently if s&lt;&lt;pop_size, otherwise the cost of checking and generated new numbers will be even worst than the original version).</p>
<p>So there I went. I modified the original inherited version of the tournament selection without replacement, and rerun the simple time measures. </p>
<pre>
$ time ./GATest
----------------------- GA parameters ------------------------------------
Seed: 69
Lower/upper bounds: [1.000000,0.000000]
Genes: 18
Population size: 2000
Iterations: 30
Tournament size: 6
Crossover: pc=0.900000, gwp=0.500000, etaC=10.000000
Mutation: pm=0.100000, etaM=20.000000
----------------------- Evolution Statistics -----------------------------
4.663210	8.974190	13.158102
3.350933	7.401935	11.503243
1.964580	5.461794	9.246779
1.297656	3.819533	7.364562
0.810695	2.512797	5.142622
0.478789	1.603199	3.652348
0.305106	0.999304	2.138109
0.191904	0.602315	1.336870
0.108593	0.361237	0.869652
0.060862	0.219145	0.502403
0.040076	0.136125	0.307478
0.028629	0.084893	0.191327
0.016301	0.052274	0.115169
0.009433	0.032699	0.071849
0.003934	0.020275	0.047970
0.002762	0.012328	0.031204
0.001405	0.007259	0.019575
0.001043	0.004280	0.010909
0.000790	0.002550	0.005799
0.000404	0.001530	0.003566
0.000287	0.000950	0.002406
0.000198	0.000600	0.001390
0.000127	0.000386	0.000818
0.000068	0.000245	0.000599
0.000045	0.000153	0.000377
0.000026	0.000093	0.000206
0.000020	0.000058	0.000125
0.000011	0.000035	0.000095
0.000007	0.000022	0.000049
0.000004	0.000014	0.000029
0.000002	0.000009	0.000018
----------------------- Final outcome ------------------------------------
Min:	(0.000002)	0.000000	0.000000	0.000000	0.000000.000000	0.000000	0.000000	0.000000	0.000000	0.000000.000000	0.000000	0.000000	0.000000	0.000000	0.000000.000000	0.000000
Max:	(0.000018)	0.000001	0.000000	0.000000	0.000000.000000	0.000000	0.000001	0.000001	0.000000	0.000000.000004	0.000000	0.000001	0.000001	0.000002	0.000000.000001	0.000001	

real	0m0.258s
user	0m0.246s
sys	0m0.006s
</pre>
<p>Yup. That simple change yielded a speedup of 26.15. Mmh, as I said, a little bit of thinking helped to avoid going down some crazy path in a rushing code fever for the wrong reasons. Yup, the threading will be very useful if the cost of the evaluation is expensive (as most of the real world optimization are), but for this silly OneMax, no need to make it more complicated than it need <img src='http://www.xavierllora.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Related posts:<ol>
<li><a href='http://www.xavierllora.net/2005/11/27/evaluation-consistency-in-igas-user-contradictions-as-cycles-in-partial-ordering-graphs/' rel='bookmark' title='Evaluation consistency in iGAs: User contradictions as cycles in partial-ordering graphs'>Evaluation consistency in iGAs: User contradictions as cycles in partial-ordering graphs</a></li>
<li><a href='http://www.xavierllora.net/2008/11/13/fast-mutation-implementation-for-genetic-algorithms-in-python/' rel='bookmark' title='Fast mutation implementation for genetic algorithms in Python'>Fast mutation implementation for genetic algorithms in Python</a></li>
<li><a href='http://www.xavierllora.net/2006/07/07/analyzing-active-interactive-genetic-algorithms-using-visual-analytics/' rel='bookmark' title='Analyzing active interactive genetic algorithms using visual analytics'>Analyzing active interactive genetic algorithms using visual analytics</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xavierllora.net/2009/04/01/squeezing-for-cycles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LCSweb + GBML blog = LCS &amp; GBML Central</title>
		<link>http://www.xavierllora.net/2009/03/27/lcsweb-gbml-blog-lcs-gbml-central/</link>
		<comments>http://www.xavierllora.net/2009/03/27/lcsweb-gbml-blog-lcs-gbml-central/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 16:27:02 +0000</pubDate>
		<dc:creator>Xavier</dc:creator>
				<category><![CDATA[Learning Classifier Systems]]></category>
		<category><![CDATA[Notes]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[community building]]></category>
		<category><![CDATA[genetics-based machine learning]]></category>

		<guid isPermaLink="false">http://www.xavierllora.net/?p=487</guid>
		<description><![CDATA[LCSweb was designed to allow researchers and those seeking to use Learning Classifier Systems within applications access to material on LCS and discussion between members of the LCS community. The site served this community since its was started by Alwyn Barry in 1997. Enhanced and maintained later by Jan Drugowitsch, LCSweb became a valuable community [...]
Related posts:<ol>
<li><a href='http://www.xavierllora.net/2006/02/20/lcsweb-creates-and-lcs-and-gbml-paper-database/' rel='bookmark' title='LCSWeb creates a LCS and GBML paper database'>LCSWeb creates a LCS and GBML paper database</a></li>
<li><a href='http://www.xavierllora.net/2010/06/03/lcs-gbml-central-get-a-new-home/' rel='bookmark' title='LCS &amp; GBML Central Gets a New Home'>LCS &#038; GBML Central Gets a New Home</a></li>
<li><a href='http://www.xavierllora.net/2005/11/30/new-blog-for-lcs-and-other-gbml/' rel='bookmark' title='New blog for LCS and other GBML'>New blog for LCS and other GBML</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>LCSweb was designed to allow researchers and those seeking to use Learning Classifier Systems within applications access to material on LCS and discussion between members of the LCS community. The site served this community since its was started by Alwyn Barry in 1997. Enhanced and maintained later by Jan Drugowitsch, LCSweb became a valuable community resource. The site was completely community-driven and allowed members to contribute to the content of the site and keeping it up to date.  Later on in 2005, I started &#8220;LCS and other GBML&#8221; Blog to cover a gap providing information information regarding the International Workshop on Learning Classifier Systems (IWLCS), the collection of LCS Books available, and GBML related news.</p>
<p>Some of you may have realized that after Jan&#8217;s move to Rochester and Alwyn&#8217;s retirement from research activities, LCSweb has vanished. Will Browne took on himself to take LCSweb to Reading, but technical circumstances have made that move rocky despite his best efforts. Jan and Will however still have a local copy of LCSweb contents. After talking to Jan and Will, I proposed to merge LCSweb with the LCS and other GBML blog, and host the new site at NCSA where dedicated resources has been made available. Jan and Will agreed with the idea.</p>
<p>We are happy to announce that the merged site (still under the update cycle) can be reached at <a href=" http://lcs-gbml.ncsa.uiuc.edu">http://lcs-gbml.ncsa.uiuc.edu</a>. More information about the process can be found <a href="http://www.illigal.uiuc.edu/web/lcs-n-gbml/2009/03/27/lcs-gbml-central-community-resource-is-now-online/">here</a> or at there  <a href=" http://lcs-gbml.ncsa.uiuc.edu">LCS &amp; GBML Central</a> site.</p>
<p>Related posts:<ol>
<li><a href='http://www.xavierllora.net/2006/02/20/lcsweb-creates-and-lcs-and-gbml-paper-database/' rel='bookmark' title='LCSWeb creates a LCS and GBML paper database'>LCSWeb creates a LCS and GBML paper database</a></li>
<li><a href='http://www.xavierllora.net/2010/06/03/lcs-gbml-central-get-a-new-home/' rel='bookmark' title='LCS &amp; GBML Central Gets a New Home'>LCS &#038; GBML Central Gets a New Home</a></li>
<li><a href='http://www.xavierllora.net/2005/11/30/new-blog-for-lcs-and-other-gbml/' rel='bookmark' title='New blog for LCS and other GBML'>New blog for LCS and other GBML</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.xavierllora.net/2009/03/27/lcsweb-gbml-blog-lcs-gbml-central/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

