<?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>ripple: &#187; Uncategorized</title>
	<atom:link href="http://ripple.fortytwo.net/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://ripple.fortytwo.net</link>
	<description>Semantic Web Scripting Language</description>
	<lastBuildDate>Thu, 16 Jun 2011 00:09:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Arrows and regex</title>
		<link>http://ripple.fortytwo.net/2009/04/29/arrows-and-regex/</link>
		<comments>http://ripple.fortytwo.net/2009/04/29/arrows-and-regex/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 15:58:48 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ripple.fortytwo.net/2009/04/29/arrows-and-regex/</guid>
		<description><![CDATA[This post will introduce Ripple&#8217;s application and regular expression syntax.  The very first releases of Ripple (as in the screencast) included a single, infix symbol, &#8220;/&#8221; for the application of mappings.  For example, to map the numbers 2 and 3 to their sum, you would have used (2 3 /add).  While the [...]]]></description>
			<content:encoded><![CDATA[<p>This post will introduce Ripple&#8217;s application and regular expression syntax.  The very first releases of Ripple (as in the <a href="http://ripple.fortytwo.net/screencast/">screencast</a>) included a single, infix symbol, &#8220;/&#8221; for the application of mappings.  For example, to map the numbers 2 and 3 to their sum, you would have used <code>(2 3 /add)</code>.  While the slash is still supported for the sake of backwards compatibility, Ripple&#8217;s preferred syntax is now entirely postfix-based, and includes various constructions for &#8220;forward&#8221; and &#8220;backward&#8221; application of mappings, as well as for regular expressions.  These are:</p>
<ul>
<li>&#8220;&gt;&gt;&#8221; &#8212; <strong>forward application</strong>. Simply applies a mapping, exactly once.  For instance, the example above should be written: <code>(2 3 add &gt;&gt;)</code> using the preferred syntax.</li>
<li>&#8220;&lt;&lt;&#8221; &#8212; <strong>backward application</strong>. Applies the inverse of a mapping, insofar as this is defined. For instance, the expression <code>(2 3 add &lt;&lt;)</code> yields (-1), as the inverse mapping of <code>add</code> is defined to be <code>sub</code>, the subtraction primitive. In RDF applications, backward application is useful for traversing links from head to tail rather than from tail to head. For example, if <code>(:timbl foaf:knows &gt;&gt;)</code> yields all individuals known by Tim Berners-Lee, then <code>(:timbl foaf:knows &lt;&lt;)</code> yields all individuals who know Tim Berners-Lee, according to Ripple&#8217;s knowledge base.  In the current application, you can even traverse backwards from literal values.  For example, <code>(&quot;Timothy Berners-Lee&quot; foaf:name &lt;&lt;)</code> yields <code>(:timbl)</code> himself.
<li>&#8220;?&#8221; &#8212; <strong>optional quantifier</strong>.  This and the following constructions provide POSIX-style regular expressions in Ripple.  When it stands before an application operator, &#8220;?&#8221; applies the operator both once and not at all.  For instance, the expression <code>(:timbl foaf:knows? &gt;&gt;)</code> yields both Tim Berners-Lee and the individuals he knows.  The expression <code>(42 neg? &gt;&gt;)</code> yields both <code>(42)</code> and <code>(-42)</code>.
<li>&#8220;*&#8221; &#8212; <strong>star quantifier</strong>.  When it stands before an application operator, &#8220;*&#8221; applies the operator zero or more times.  This is particularly useful when working with recursive data structures such as lists.  For example, the expression <code>((10 20 30) rdf:rest* &gt;&gt; rdf:first &gt;&gt;)</code> yields <code>(10)</code>, <code>(20)</code>, and <code>(30)</code>.
<li>&#8220;+&#8221; &#8212; <strong>plus quantifier</strong>.  Like &#8220;*&#8221;, but applies its operator at least once.  Thus, the expression <code>((10 20 30) rdf:rest+ &gt;&gt; rdf:first &gt;&gt;)</code> yields only <code>(20)</code> and <code>(30)</code>, as the <code>rdf:rest</code> mapping is applied once, then twice before the end of the list is reached.
<li>&#8220;{n}&#8221; &#8212; <strong>numeric quantifier</strong>.  Applies its operator a single, specified number <code>n</code> of times.  For instance, <code>((10 20 30) rdf:rest{2} &gt;&gt; rdf:first &gt;&gt;)</code> yields <code>(30)</code>.  The expression <code>(:timbl foaf:knows{2} &gt;&gt;)</code> yields all individuals known by Tim Berners-Lee, in transitive fashion for two degrees.  This is the same as <code>(:timbl foaf:knows &gt;&gt; foaf:knows &gt;&gt;)</code>.
<li>&#8220;{n,m}&#8221; &#8212; <strong>range quantifier</strong>.  Applies its operator at least <code>n</code> times and at most <code>m</code> times.  For instance, <code>((10 20 30) rdf:rest{0,1} &gt;&gt; rdf:first &gt;&gt;)</code> yields <code>(10)</code> and <code>(20)</code>. <code>(:timbl foaf:knows{2,3} &lt;&lt;)</code> yields all individuals from whom Tim Berners-Lee is two or three degrees removed, according to the <code>foaf:knows</code> mapping.
</ul>
<p>Note that despite this diversity of syntax, there is and always has been only one true application operator in Ripple, still called <code>op</code>. Apart from the forward application symbol &#8220;&gt;&gt;&#8221; which is simply an alias for <code>op</code>, all of the above constructions are merely syntactic sugar for expressions involving <code>op</code> together with one primitive mapping or another.  For example, the expression <code>(:timbl foaf:knows{2} &gt;&gt;)</code> parses to the same Ripple program as <code>(:timbl foaf:knows 2 timesApply op)</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ripple.fortytwo.net/2009/04/29/arrows-and-regex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prettifying the command line</title>
		<link>http://ripple.fortytwo.net/2009/04/08/prettifying-the-command-line/</link>
		<comments>http://ripple.fortytwo.net/2009/04/08/prettifying-the-command-line/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 02:26:49 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ripple.fortytwo.net/2009/04/08/prettifying-the-command-line/</guid>
		<description><![CDATA[Right.  Blog.  Keyboard.  Fingers.  Just start typing.  So, I needed to take a screen capture of the Ripple command line for a presentation yesterday, and was a little embarrassed by this old and awkward formatting:

1 &#62;&#62;&#160;&#160;:timbl &#62;&#62; foaf:knows &#62;&#62; foaf:name &#62;&#62; .

rdf:_1&#160;&#160;(&#34;Dan Brickley&#34;@en)
rdf:_2&#160;&#160;(&#34;Libby Miller&#34;)
rdf:_3&#160;&#160;(&#34;Jim Hendler&#34;)
rdf:_4&#160;&#160;(&#34;Henry J. Story&#34;)

2 &#62;&#62;

Old, because this [...]]]></description>
			<content:encoded><![CDATA[<p>Right.  Blog.  Keyboard.  Fingers.  Just start typing.  So, I needed to take a screen capture of the Ripple command line for a presentation yesterday, and was a little embarrassed by this old and awkward formatting:
<ol><pre><code>
1 &gt;&gt;&nbsp;&nbsp;:timbl &gt;&gt; foaf:knows &gt;&gt; foaf:name &gt;&gt; .

rdf:_1&nbsp;&nbsp;(&quot;Dan Brickley&quot;@en)
rdf:_2&nbsp;&nbsp;(&quot;Libby Miller&quot;)
rdf:_3&nbsp;&nbsp;(&quot;Jim Hendler&quot;)
rdf:_4&nbsp;&nbsp;(&quot;Henry J. Story&quot;)

2 &gt;&gt;
</code></pre></ol>
<p>Old, because this is how it has been since the dawn of Ripple time.  Awkward, because:
<ol>
<li>The <code>&gt;&gt;</code> input prompt clashes with the <code>&gt;&gt;</code> application operator (which in earlier versions of Ripple was a slash, apart from being an infix operator.  More to come on the new syntax).</li>
<li>The RDF Bag -styled index for query results (<code>rdf:_1</code> and so on) has always been a little misleading.  It&#8217;s particularly wrong now that Ripple is much more loosely coupled with the RDF data model.
<li>Without the spurious RDF Bag syntax, the parentheses around individual query results (indicating that they are lists) are as unnecessary as they are unsightly.  Just as the top-level parentheses of a line of input are omitted &#8212; so you can type <code>2 3 add &gt;&gt;</code> instead of the more obviously list-like <code>(2 3 add &gt;&gt;)</code> &#8212; so it can be with output: just pretend the parentheses are there, and remember that query results really are lists.
</ol>
<p>It took all of five minutes to put a much improved format in place:
<ol><pre><code>
1) :timbl &gt;&gt; foaf:knows &gt;&gt; foaf:name &gt;&gt; .

&nbsp;&nbsp;[1]&nbsp;&nbsp;&quot;Dan Brickley&quot;@en
&nbsp;&nbsp;[2]&nbsp;&nbsp;&quot;Libby Miller&quot;
&nbsp;&nbsp;[3]&nbsp;&nbsp;&quot;Jim Hendler&quot;
&nbsp;&nbsp;[4]&nbsp;&nbsp;&quot;Henry J. Story&quot;

2)
</code></pre></ol>
<p>This does look better, doesn&#8217;t it?</p>
]]></content:encoded>
			<wfw:commentRss>http://ripple.fortytwo.net/2009/04/08/prettifying-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ripple&#8217;s not dead</title>
		<link>http://ripple.fortytwo.net/2008/04/17/ripples-not-dead/</link>
		<comments>http://ripple.fortytwo.net/2008/04/17/ripples-not-dead/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 06:02:07 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ripple.fortytwo.net/2008/04/17/ripples-not-dead/</guid>
		<description><![CDATA[Alright, so I&#8217;m not much of a blogger. I guess that&#8217;s obvious by now. Nonetheless, the subject of this very neglected blog, the Ripple language, has come a long way in the last seven-and-a-half months. Ripple is now used commercially, which has driven its development in new and interesting directions. The language and query environment, [...]]]></description>
			<content:encoded><![CDATA[<p>Alright, so I&#8217;m not much of a blogger. I guess that&#8217;s obvious by now. Nonetheless, the subject of this very neglected blog, the Ripple language, has come a long way in the last seven-and-a-half months. Ripple is now used commercially, which has driven its development in new and interesting directions. The language and query environment, now compatible with any Sesame 2.0 Sail implementation, are clearly separated from the linked data client, which in turn is compatible with Sesame-based applications distinct from Ripple. The API has been extended to allow for more specialized network algorithms.  A developer may now embed Ripple query strings in Java source code, making it much easier to use Ripple as a software component, as opposed to a stand-alone tool. The syntax of the language has grown and matured, with support for regular expressions, backward and forward traversal of networks, and user-friendly, pattern-matching program definitions. In short, Ripple is becoming a <em>real</em> programming language. As it&#8217;s an open-source language, I&#8217;ve decided that the source code really ought to be accessible somewhere (other than in months-old release packages), so I&#8217;ve put it on <a href="http://ripple.googlecode.com" title="Google Code" target="_blank" onclick="urchinTracker('/outgoing/ripple.googlecode.com?referer=');">Google Code</a>. Maybe I should pipe the SVN commit messages into my blog.</p>
<p><em>Note: you can check out an up-to-the-minute working copy of Ripple like so (requires a Subversion client)</em></p>
<blockquote><p><tt>svn checkout <em>http</em>://ripple.googlecode.com/svn/trunk/ ripple</tt></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://ripple.fortytwo.net/2008/04/17/ripples-not-dead/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

