<?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>Wilted buttercup, grey skies, and geek &#187; 4store</title>
	<atom:link href="http://mmt.me.uk/blog/tag/4store/feed/" rel="self" type="application/rss+xml" />
	<link>http://mmt.me.uk/blog</link>
	<description>Mischa’s ramblings on the interweb</description>
	<lastBuildDate>Fri, 20 Aug 2010 14:28:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Compiling 4store on a Fedora 12 box</title>
		<link>http://mmt.me.uk/blog/2009/12/14/compiling-4store-on-a-fedora-12-box/</link>
		<comments>http://mmt.me.uk/blog/2009/12/14/compiling-4store-on-a-fedora-12-box/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 13:40:16 +0000</pubDate>
		<dc:creator>Mischa Tuffield</dc:creator>
				<category><![CDATA[4store]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[ld.so.conf]]></category>
		<category><![CDATA[ldd]]></category>
		<category><![CDATA[librasqal]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://mmt.me.uk/blog/?p=138</guid>
		<description><![CDATA[I was attempting to install 4store on my fedora 12 box, and I found that I couldn&#8217;t run the tests which are shipped with 4store. I got the following output when attempting to run &#8220;make test&#8221; : [root@blanket 4store]# make test (cd tests &#038;&#038; make -w test) make[1]: Entering directory `/usr/local/src/4store/tests' (cd query &#038;&#038; pwd [...]]]></description>
			<content:encoded><![CDATA[<p>I was attempting to install <a href="http://4store.org/">4store</a> on my fedora 12 box, and I found that I couldn&#8217;t run the tests which are shipped with 4store. I got the following output when attempting to run &#8220;make test&#8221; :</p>
<p><code><br />
[root@blanket 4store]# make test<br />
(cd tests &#038;&#038; make -w test)<br />
make[1]: Entering directory `/usr/local/src/4store/tests'<br />
(cd query &#038;&#038; pwd &#038;&#038; ./setup.sh --autorun)<br />
/usr/local/src/4store/tests/query<br />
4store[9702]: backend-setup.c:176 erased files for KB query_test_mmt04r<br />
4store[9702]: backend-setup.c:301 created RDF metadata for KB query_test_mmt04r<br />
../../src/frontend/4s-import: error while loading shared libraries: librasqal.so.1: cannot open shared object file: No such file or directory<br />
Preparing for tests...<br />
../../src/frontend/4s-delete-model: error while loading shared libraries: librasqal.so.1: cannot open shared object file: No such file or directory<br />
[FAIL] add-and-delete<br />
[FAIL] distinct-predicate<br />
[FAIL] foaf-all-limit<br />
[FAIL] foaf-bnode-vs-variable<br />
[FAIL] foaf-construct<br />
[FAIL] foaf-disjunctive-filter<br />
[FAIL] foaf-distinct<br />
[FAIL] foaf-graph-all<br />
[FAIL] foaf-graph-pred<br />
[FAIL] foaf-knows-name<br />
[FAIL] foaf-knows-name-sha1<br />
[FAIL] foaf-knows-sha1<br />
[FAIL] foaf-knows-sha1-xml<br />
[FAIL] foaf-multi-disjunctive-filter<br />
[FAIL] foaf-nested-optional<br />
[FAIL] foaf-nothing<br />
[FAIL] foaf-optional-order<br />
[FAIL] foaf-optional-pair<br />
[FAIL] foaf-optional-regex<br />
[FAIL] foaf-repeat-var<br />
[FAIL] graphs<br />
[PASS] integrity<br />
[FAIL] null-optional<br />
[FAIL] null-optional-double<br />
[FAIL] optimiser-disjunction<br />
[FAIL] select-bnodes<br />
[FAIL] select-order<br />
[FAIL] select-unused<br />
[FAIL] size<br />
[FAIL] tiger-broadway<br />
[FAIL] tiger-explosion<br />
[FAIL] tiger-fail-optional<br />
[FAIL] tiger-harold-ave<br />
[FAIL] tiger-landmarks<br />
[FAIL] tiger-mixed-optional<br />
[FAIL] tiger-reverse<br />
[FAIL] tiger-sugar-hill<br />
[FAIL] tiger-sugar-hill-filter<br />
[FAIL] tiger-typical<br />
[FAIL] tiger-water-names<br />
Tests completed: passed 1/40 (39 fails)<br />
make[1]: Leaving directory `/usr/local/src/4store/tests'<br />
</code></p>
<p>This struck me as odd given that when I ran the &#8220;configure&#8221; script I got the following output :<br />
<code><br />
[root@blanket 4store]# ./configure<br />
[OK  ] pkg-config installed<br />
[OK  ] raptor installed<br />
[OK  ] rasqal installed<br />
[OK  ] glib2 installed<br />
[OK  ] libxml2 installed<br />
[OK  ] pcre installed<br />
[OK  ] ncurses installed<br />
[OK  ] readline installed<br />
[OK  ] z installed<br />
[OK  ] avahi installed<br />
</code></p>
<p>So these are the setup step which I had to perform in order to get 4store working and running the tests: </p>
<p><strong>1. After compiling the code, used ldd to see which libs were missing</strong><br />
<code><br />
ldd src/frontend/4s-query<br />
[root@blanket 4store]# ldd !$2<br />
ldd src/frontend/4s-query<br />
	linux-gate.so.1 =>  (0x00d9a000)<br />
	librasqal.so.1 => not found<br />
	libraptor.so.1 => /usr/lib/libraptor.so.1 (0x00678000)<br />
	libxml2.so.2 => /usr/lib/libxml2.so.2 (0x04f2f000)<br />
	libavahi-common.so.3 => /usr/lib/libavahi-common.so.3 (0x051d0000)<br />
	libavahi-client.so.3 => /usr/lib/libavahi-client.so.3 (0x051bd000)<br />
	libavahi-glib.so.1 => /usr/lib/libavahi-glib.so.1 (0x004b8000)<br />
	libglib-2.0.so.0 => /lib/libglib-2.0.so.0 (0x00da9000)<br />
	libpcre.so.0 => /lib/libpcre.so.0 (0x00110000)<br />
        ....<br />
</code><br />
<strong><br />
2. Fix my ld.so configuration. The issue was that I had to add the following line, which points to my librasqal.so.1, to the following empty file<br />
/etc/ld.so.conf.d/local.conf :</strong><br />
<code><br />
/usr/local/lib<br />
</code></p>
<p>A big yay to working 4store :<br />
<code><br />
[root@blanket 4store]# make test<br />
(cd tests &#038;&#038; make -w test)<br />
make[1]: Entering directory `/usr/local/src/4store/tests'<br />
(cd query &#038;&#038; pwd &#038;&#038; ./setup.sh --autorun)<br />
/usr/local/src/4store/tests/query<br />
4store[10887]: backend-setup.c:176 erased files for KB query_test_mmt04r<br />
4store[10887]: backend-setup.c:301 created RDF metadata for KB query_test_mmt04r<br />
removing old data<br />
Reading <file:///usr/local/src/4store/tests/query/../../data/swh.xrdf><br />
   into <http://example.com/swh.xrdf><br />
Pass 1, processed 63 triples (63)<br />
Reading <file:///usr/local/src/4store/tests/query/../../data/tiger/TGR06001.nt><br />
   into <http://example.com/TGR06001.nt><br />
Pass 1, processed 764610 triples (764547)<br />
Reading <file:///usr/local/src/4store/tests/query/../../data/nasty.ttl><br />
   into <http://example.com/nasty.ttl><br />
Pass 1, processed 764658 triples (48)<br />
Pass 2, processed 764658 triples, 26769 triples/s<br />
Updating index<br />
Index update took 17.133335 seconds<br />
Imported 764658 triples, average 19375 triples/s<br />
Preparing for tests...<br />
[PASS] add-and-delete<br />
[PASS] count<br />
[PASS] distinct-predicate<br />
[PASS] foaf-all-limit<br />
[PASS] foaf-bnode-vs-variable<br />
[PASS] foaf-construct<br />
[PASS] foaf-disjunctive-filter<br />
[PASS] foaf-distinct<br />
[PASS] foaf-graph-all<br />
[PASS] foaf-graph-pred<br />
[PASS] foaf-knows-name<br />
[PASS] foaf-knows-name-sha1<br />
[PASS] foaf-knows-sha1<br />
[PASS] foaf-knows-sha1-xml<br />
[PASS] foaf-multi-disjunctive-filter<br />
[PASS] foaf-nested-optional<br />
[PASS] foaf-nothing<br />
[PASS] foaf-optional-order<br />
[PASS] foaf-optional-pair<br />
[PASS] foaf-optional-regex<br />
[PASS] foaf-repeat-var<br />
[PASS] graphs<br />
[PASS] integrity<br />
[PASS] null-optional<br />
[PASS] null-optional-double<br />
[PASS] optimiser-disjunction<br />
[PASS] select-bnodes<br />
[PASS] select-order<br />
[PASS] select-unused<br />
[PASS] size<br />
[PASS] tiger-broadway<br />
[PASS] tiger-explosion<br />
[PASS] tiger-fail-optional<br />
[PASS] tiger-harold-ave<br />
[PASS] tiger-landmarks<br />
[PASS] tiger-mixed-optional<br />
[PASS] tiger-reverse<br />
[PASS] tiger-sugar-hill<br />
[PASS] tiger-sugar-hill-filter<br />
[PASS] tiger-typical<br />
[PASS] tiger-water-names<br />
[PASS] union-nobind<br />
Tests completed: passed 42/42 (0 fails)<br />
make[1]: Leaving directory `/usr/local/src/4store/tests'<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://mmt.me.uk/blog/2009/12/14/compiling-4store-on-a-fedora-12-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4store and Dan Hanley&#8217;s client libgs</title>
		<link>http://mmt.me.uk/blog/2009/12/13/4store-java/</link>
		<comments>http://mmt.me.uk/blog/2009/12/13/4store-java/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 20:19:22 +0000</pubDate>
		<dc:creator>Mischa Tuffield</dc:creator>
				<category><![CDATA[4store]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[SPARQL]]></category>

		<guid isPermaLink="false">http://mmt.me.uk/blog/?p=130</guid>
		<description><![CDATA[Find below step by step instructions on how to talk to a 4store KB via the SPARQL-Procotol in Java, using Dan Hanley&#8217;s 4store client libs. First of all you need to have the following installed : 4store A java compiler (i have Sun&#8217;s Java SDK 1.6.x installed on my laptop) Maven (to compile Dan Hanley&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Find below step by step instructions on how to talk to a <a href="http://4store.org/">4store</a> KB via the <a href="http://www.w3.org/TR/rdf-sparql-protocol/">SPARQL-Procotol</a> in Java, using <a href="http://github.com/danhanley/4store-java-client">Dan Hanley&#8217;s 4store client libs</a>.</p>
<p>First of all you need to have the following installed :<br />
4store<br />
A java compiler (i have<a href="http://java.sun.com/javase/downloads/widget/jdk6.jsp"> Sun&#8217;s Java SDK 1.6.x</a> installed on my laptop)<br />
<a href="http://maven.apache.org/">Maven</a> (to compile Dan Hanley&#8217;s 4store client libs). </p>
<p>I have all of the code needed for this example placed on my site here : <a href="http://mmt.me.uk/examples/4store-java-query-example/">http://mmt.me.uk/examples/4store-java-query-example/</a>  feel free to grab and use it as you wish.</p>
<p>First of all, I should say that I have had to patch the 4store-client-library, as it seems to chomp all of the carriage returns at the end of the lines (&#8220;\n&#8221;).  This is fine you are using the <a href="http://www.w3.org/TR/rdf-sparql-XMLres/">SPARQL-XML-RESULT format</a>, by I am a tad lazy and much prefer working with the <a href="http://en.wikipedia.org/wiki/Delimiter-separated_values">tsv</a> format: tsv requires line breaks.</p>
<p>The git diff of my patch looks like so (and again yes it is a tad dirty) :<br />
<code><br />
diff --git a/src/main/java/uk/co/magus/fourstore/client/Store.java b/src/main/java/uk/co/magus/fourstore/clie<br />
index 6652874..097be43 100644<br />
--- a/src/main/java/uk/co/magus/fourstore/client/Store.java<br />
+++ b/src/main/java/uk/co/magus/fourstore/client/Store.java<br />
@@ -349,7 +349,7 @@ public class Store {<br />
                String response = "";<br />
                String str;<br />
                while (null != ((str = in.readLine()))) {<br />
-                       response += str;<br />
+                       response += str+"\n";<br />
                }<br />
                in.close();<br />
                return response;<br />
~<br />
~<br />
</code></p>
<p>This above <a href="http://mmt.me.uk/examples/4store-java-query-example/patch.txt">patch</a> allows me to make use of the TSV output as needed. The patch can be grabbed from here : <a href="http://mmt.me.uk/examples/4store-java-query-example/patch.txt">http://mmt.me.uk/examples/4store-java-query-example/patch.txt</a>.</p>
<p>Ok, now that I have built the <a href="http://mmt.me.uk/examples/4store-java-query-example/4store-client-1.0.jar">4store-client.jar</a> file with my patch using the instructions in the <a href="http://github.com/danhanley/4store-java-client">git repo</a>. I create an example RDF file, and some example java code which will query the 4store KB. All the files can be found on my site <a href="http://mmt.me.uk/examples/4store-java-query-example/">http://mmt.me.uk/examples/4store-java-query-example/</a>.</p>
<p>These are the steps which I have taken to get this little demo up and running :<br />
<strong>1. Create 4store KB called <em>lame</em> </strong><br />
<code><br />
4s-backend-setup --node 0 --cluster 1 --segments 2 lame<br />
</code></p>
<p><strong>2. Start <em>lame</em>&#8216;s backend (i.e. start the KB)</strong><br />
<code><br />
4s-backend lame<br />
</code></p>
<p><strong>3. Import the <a href="http://mmt.me.uk/examples/4store-java-query-example/example.rdf">example.rdf</a> file into <em>lame</em>&#8216;s backend (i.e. start the KB)</strong><br />
<code><br />
4s-import lame example.rdf<br />
</code></p>
<p><strong>4. Start HTTPD for the KB named <em>lame</em></strong><br />
<code><br />
4s-httpd -s -1 lame<br />
</code></p>
<p><strong>And then I need to compile the <a href="http://mmt.me.uk/examples/4store-java-query-example/exampleQuery.java">exampleQuery</a> code I knocked together</strong><br />
<code><br />
javac -cp 4store-client-1.0.jar exampleQuery.java<br />
</code></p>
<p><strong>Finally, I run the code like so : </strong><br />
<code><br />
java -cp 4store-client-1.0.jar:. exampleQuery<br />
</code></p>
<p><strong>Resulting in the following output: </strong><br />
<code><br />
Am about to query a sparql endpoint<br />
A user name is:"Bob"<br />
A user name is:"Alice"<br />
</code></p>
<p>I hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://mmt.me.uk/blog/2009/12/13/4store-java/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
