<?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; 3store</title>
	<atom:link href="http://mmt.me.uk/blog/tag/3store/feed/" rel="self" type="application/rss+xml" />
	<link>http://mmt.me.uk/blog</link>
	<description>Mischa’s ramblings on the interweb</description>
	<lastBuildDate>Mon, 16 Jan 2012 23:23:02 +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>3store Installation Guide</title>
		<link>http://mmt.me.uk/blog/2009/07/07/3store-installation-guide/</link>
		<comments>http://mmt.me.uk/blog/2009/07/07/3store-installation-guide/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 16:01:14 +0000</pubDate>
		<dc:creator>Mischa</dc:creator>
				<category><![CDATA[3store]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rdf]]></category>
		<category><![CDATA[triplestore]]></category>

		<guid isPermaLink="false">http://mmt.me.uk/blog/?p=3</guid>
		<description><![CDATA[I have put together these notes on installing 3Store on linux boxes. I should thank Dave Dupplaw for his notes on installation, this blog is also a good point of call. Pre-Install Before you install 3Store you must ensure that you have raptor and rasqal libraries installed. You should install these from source! This is [...]]]></description>
			<content:encoded><![CDATA[<p>I have put together these notes on installing <a href="http://sourceforge.net/projects/threestore/">3Store</a> on linux boxes. I should thank <a href="http://users.ecs.soton.ac.uk/dpd/">Dave Dupplaw</a> for his notes on installation, <a href="http://semant.blogspot.com/2006/06/3store3.html">this blog</a> is also a good point of call.</p>
<h2>Pre-Install</h2>
<p>Before you install <a href="http://sourceforge.net/projects/threestore/">3Store</a> you must ensure that you have raptor and rasqal libraries installed. You should install these from source! This is not a necessity but what we have found<br />
it best after a number of installations.</p>
<p><a href="http://librdf.org/rasqal/">Rasqal</a> and <a href="http://librdf.org/raptor/">Raptor</a> are both libraries produced by Redland, and can be downloaded from their site: <a href="http://librdf.org/">http://librdf.org</a>.</p>
<p>Unpack each tar ball, configure, make, and make install each one.</p>
<p>Rasqal and Raptor both install their package files into <em>/usr/local/lib/pkgconfig</em>g but 3Store does not expect the files there. To fix this set the environment variable <b>PKG_CONFIG_PATH</b> to point to that directory. If that directory does not exist, locate <em>rascal.pc </em> to find its location and place that path in your <b>PKG_CONFIG_PATH</b> environment variable. For example, on a 64 bit architecture, these files should be found in <em>/usr/local/lib64/pkgconfig</em>.</p>
<p>In <em>[t]csh</em> this is:<br/><br />
	<code>setenv PKG_CONFIG_PATH /usr/local/lib/pkgconfig/</code><br/></p>
<p>In <em>bash</em> this is:<br/><br />
	<code>export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/</code></p>
<p>It should be noted that 3store also requires <a href="http://sourceforge.net/projects/unicode-glib">glib</a>, as well as the Berkeley DB libraries. You should be able to install these via your package manager, i.e. apt-get, yum, or through emerge.</p>
<h2>3Store Installation</h2>
<p>Installation is from source, so unpack the source and enter the 3store directory.</p>
<p>Use <em>./configure</em> to configure the compilation scripts.</p>
<p>Make the scripts with the <b>make</b> command. Install 3Store with <b>make install</b> (you will have to be root to do this).</p>
<h2>Troubleshooting</h2>
<h3>Package rascal.pc does not exist</h3>
<p>If you get this error:</p>
<p><em>checking for RASQAL&#8230; Package rasqal was not found in the pkg-config<br />
search path.</em></p>
<p>Perhaps you should add the directory containing <em>rasqal.pc</em>  to the </p>
<p><b>PKG_CONFIG_PATH</b> environment variable.</p>
<p>Other issue:</p>
<p><em>No package &#8216;rasqal&#8217; found configure: error: Package requirements (rasqal >= 0.9.11) were not met:</em></p>
<p>Then check that you have correctly installed rascal and set up the <b>PKG_CONFIG_PATH</b> environment variable.</p>
<h3>Library libidn.so does not exist</h3>
<p>If you get this error:</p>
<p><em>gcc: /usr/lib/libidn.so: No such file or directory</em></p>
<p>Then locate <em>libidn</em> and make a soft link to the necessary library.<br />
For example, if <em>libidn.so.11</em> exists, link it to the filename <em>libidn.so</em>:</p>
<p><code>ln -s /usr/lib/libidn.so.11 /usr/lib/libidn.so</code></p>
<p>The make script will then be able to find the file.</p>
<h3>glibc 386 libraries missing RedHat</h3>
<p>If you are working on x86 platform, you may still require the i386 libraries to do<br />
the compilation. This error may be typified by the following error message during compilation:</p>
<p><em>/usr/bin/ld: crti.o: No such file: No such file or directory</em></p>
<p>It is easiest if you are signed up to the <a href="https://rhn.redhat.com/help/about.pxt">RedHat network</a> to do update your glibc libraries to the latest versions:</p>
<p><code>up2date --showall # (optional to find latest versions)</code></p>
<p><code>up2date --get glibc-devel-2.3.4-2.19.i386</code><br/><br />
	<code>rpm -Uvh /var/spool/up2date/glibc-devel-2.3.4-2.19.i386.rpm</code></p>
<p>Alternatively, you can check your original discs for the <b>i386 glibc-devel library</b> rpm. RedHat Enterprise Linux comes with the i386 versions of the libraries on disc 3. Install them using the last command given above.</p>
<h3>Wrong Architecture/File Format</h3>
<p>There is a bug in the <a href="http://www.redhat.com/rhel/">RedHat Enterprise</a> installer that means even if you tell if not to install <a href="http://www.mysql.com/">MySQL</a> it will do. Unfortunately, in either case it will install the 32 bit version, which causes an error similar to this:</p>
<p><em>/usr/local/lib/librasqal.so: could not read symbols: File in wrong format</em></p>
<p>If this is the case, you need to ensure that the compilation knows where your 64-bit MySQL installation is. If you do not have one you will have to download an appropriate version (or build from source).</p>
<p>The installation works by calling the mysql-config script which tells the compilation how to compile-in the MySQL libraries.  To make it work, ensure that the script in your path is the correct version:</p>
<p>In <b>[t]csh</b>:<br/><br />
	<code>setenv PATH /usr/local/mysql/bin:${PATH}</code><br/></p>
<p>Or in <b>bash</b>:<br/></p>
<p>	<code>export PATH=/usr/local/mysql/bin:$PATH</code></p>
<h3>Libraries not found</h3>
<p>When you run a 3store tool (e.g. ts-query) you get a message similar to the following:</p>
<p>ts-query: error while loading shared libraries: lib3store.so.0: cannot open shared object file: No such file or directory</p>
<p>This means the 3Store tool cannot find the 3Store libraries. You can locate lib3store to find the location of the libraries (which by default are put into <em>/usr/local/lib</em>) and add this to your <b>LD_LIBRARY_PATH</b>:</p>
<p>In <b>[t]csh</b>:<br/></p>
<p>	<code>setenv LD_LIBRARY_PATH /usr/local/lib</code><br/><br />
Or in <b>bash</b>:<br/></p>
<p>	<code>export LD_LIBRARY_PATH=/usr/local/lib</code><br/></p>
<p>Better still, you should add this path to your ld configuration so that it will always<br />
work. To do this create a new file in <em>/etc/ld.so.conf.d/</em> called <em>3store.conf</em>. Put <em>/usr/local/lib</em> on its own at the top of the file. Save it, and run <b>/sbin/ldconfig</b>, to update your configuration. The tools should now be able to find the libraries, and will be able to for anyone who uses the machine.</p>
<p>This is fixed in another manner if you are using <a href="http://www.gentoo.org">Gentoo Linux</a>. There is no <em>/etc/ld.so.conf.d/</em> directory. In gentoo you should add the path to the<br />
<b>LDPATH</b> environment variable (not <b>LD_LIBRARY_PATH</b>!), this can be done like so:</p>
<p>Edit <em>/etc/env.d/00basic</em></p>
<p>And add the LIBDIR to the line:</p>
<p><code>LDPATH="/usr/local/lib"</code></p>
<p>On a 64 bit architecture it may look like so:</p>
<p><code>LDPATH="/usr/local/lib:/usr/local/lib64"</code></p>
<p>Then make sure you run the <b>env-update</b> script in gentoo.</p>
<h3>Berkeley DB library not found</h3>
<p>So if you get the following error during the configure process.</p>
<p><strong>&#8220;configure: error: Cannot find Berkeley DB library version 4&#8243;</strong></p>
<p>You either don&#8217;t have the Berkeley DB libraries installed, or there are not where 3store expects them to be.</p>
<p>If you don&#8217;t have it installed, grab it and cd to the directory, then:</p>
<p><code>cd build_unix<br />
../dist/configure</code></p>
<p><code>make<br />
sudo make install</code></p>
<p>So now, if you are in the position where you have Berkeley DB 4 installed, but you are still getting the above error then 3Store is assuming it is somewhere which it isn&#8217;t! So now we have to make a soft link from where the <em>db.h</em> file actually resides, and where 3store thinks it should be.</p>
<p><code>su<br />
mkdir /usr/include/db4<br />
cd /usr/include/db4<br />
ln -s /usr/local/BerkeleyDB.4.5/include/db.h<br />
./configure LDFLAGS=-L/usr/local/BerkeleyDB.4.5/lib</code></p>
<p>If you are using a version 4.5 or above of Berkeley DB, you make have to edit the configure script as follows:</p>
<p>Edit line 21151, which looks like so:</p>
<p><code>for ac_lib in db-4.4 db-4.3 db-4.2 db-4.1 db; do</code></p>
<p>and add your version of db to it, like so:</p>
<p><code>for ac_lib in <b>db-4.5</b> db-4.4 db-4.3 db-4.2 db-4.1 db; do</code></p>
<p>And now you should be able to make and make install.</p>
<h3>Problems during compilation &#8220;make&#8221;</h3>
<p>If you had problems with the configure script and Berkeley DB, then you may have to edit some on the source code in the <em>src</em> directory. In order to get it to work I have had to:</p>
<p>Change the source code and which had <code>#include &lt;db.h&gt;</code> to <code>#include&lt;<b>PATHTO</b>/db.h&gt;</code></p>
<p>This had to be done in the following files:</p>
<p><b>Datatypes.h<br/><br />
Bulkimport.c</b></p>
<h2>Problems with ts-util!</h2>
<p>If you are having problems when running the command:</p>
<p><code>ts-util optimise "KBNAME"</code></p>
<p>You will have to edit line number 164 in ts-util.c in the src directory, and recompile.</p>
<p>Line 164 is missing an &#8220;AND&#8221;, and should look like so</p>
<p><code>ts_mysql_query(c->db, "DELETE FROM "T_S" WHERE NOT EXISTS (SELECT * FROM "T_T" WHERE model=hash) AND NOT EXISTS (SELECT * FROM "T_T" WHERE subject=hash) AND NOT EXISTS (SELECT * FROM "T_T" WHERE predicate=hash) AND NOT EXISTS (SELECT * FROM "T_T" WHERE object=hash)");</code></p>
]]></content:encoded>
			<wfw:commentRss>http://mmt.me.uk/blog/2009/07/07/3store-installation-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

