Author Archive

Compiling 4store on a Fedora 12 box

Monday, December 14th, 2009

I was attempting to install 4store on my fedora 12 box, and I found that I couldn’t run the tests which are shipped with 4store. I got the following output when attempting to run “make test” :


[root@blanket 4store]# make test
(cd tests && make -w test)
make[1]: Entering directory `/usr/local/src/4store/tests'
(cd query && pwd && ./setup.sh --autorun)
/usr/local/src/4store/tests/query
4store[9702]: backend-setup.c:176 erased files for KB query_test_mmt04r
4store[9702]: backend-setup.c:301 created RDF metadata for KB query_test_mmt04r
../../src/frontend/4s-import: error while loading shared libraries: librasqal.so.1: cannot open shared object file: No such file or directory
Preparing for tests...
../../src/frontend/4s-delete-model: error while loading shared libraries: librasqal.so.1: cannot open shared object file: No such file or directory
[FAIL] add-and-delete
[FAIL] distinct-predicate
[FAIL] foaf-all-limit
[FAIL] foaf-bnode-vs-variable
[FAIL] foaf-construct
[FAIL] foaf-disjunctive-filter
[FAIL] foaf-distinct
[FAIL] foaf-graph-all
[FAIL] foaf-graph-pred
[FAIL] foaf-knows-name
[FAIL] foaf-knows-name-sha1
[FAIL] foaf-knows-sha1
[FAIL] foaf-knows-sha1-xml
[FAIL] foaf-multi-disjunctive-filter
[FAIL] foaf-nested-optional
[FAIL] foaf-nothing
[FAIL] foaf-optional-order
[FAIL] foaf-optional-pair
[FAIL] foaf-optional-regex
[FAIL] foaf-repeat-var
[FAIL] graphs
[PASS] integrity
[FAIL] null-optional
[FAIL] null-optional-double
[FAIL] optimiser-disjunction
[FAIL] select-bnodes
[FAIL] select-order
[FAIL] select-unused
[FAIL] size
[FAIL] tiger-broadway
[FAIL] tiger-explosion
[FAIL] tiger-fail-optional
[FAIL] tiger-harold-ave
[FAIL] tiger-landmarks
[FAIL] tiger-mixed-optional
[FAIL] tiger-reverse
[FAIL] tiger-sugar-hill
[FAIL] tiger-sugar-hill-filter
[FAIL] tiger-typical
[FAIL] tiger-water-names
Tests completed: passed 1/40 (39 fails)
make[1]: Leaving directory `/usr/local/src/4store/tests'

This struck me as odd given that when I ran the “configure” script I got the following output :

[root@blanket 4store]# ./configure
[OK ] pkg-config installed
[OK ] raptor installed
[OK ] rasqal installed
[OK ] glib2 installed
[OK ] libxml2 installed
[OK ] pcre installed
[OK ] ncurses installed
[OK ] readline installed
[OK ] z installed
[OK ] avahi installed

So these are the setup step which I had to perform in order to get 4store working and running the tests:

1. After compiling the code, used ldd to see which libs were missing

ldd src/frontend/4s-query
[root@blanket 4store]# ldd !$2
ldd src/frontend/4s-query
linux-gate.so.1 => (0x00d9a000)
librasqal.so.1 => not found
libraptor.so.1 => /usr/lib/libraptor.so.1 (0x00678000)
libxml2.so.2 => /usr/lib/libxml2.so.2 (0x04f2f000)
libavahi-common.so.3 => /usr/lib/libavahi-common.so.3 (0x051d0000)
libavahi-client.so.3 => /usr/lib/libavahi-client.so.3 (0x051bd000)
libavahi-glib.so.1 => /usr/lib/libavahi-glib.so.1 (0x004b8000)
libglib-2.0.so.0 => /lib/libglib-2.0.so.0 (0x00da9000)
libpcre.so.0 => /lib/libpcre.so.0 (0x00110000)
....


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
/etc/ld.so.conf.d/local.conf :


/usr/local/lib

A big yay to working 4store :

[root@blanket 4store]# make test
(cd tests && make -w test)
make[1]: Entering directory `/usr/local/src/4store/tests'
(cd query && pwd && ./setup.sh --autorun)
/usr/local/src/4store/tests/query
4store[10887]: backend-setup.c:176 erased files for KB query_test_mmt04r
4store[10887]: backend-setup.c:301 created RDF metadata for KB query_test_mmt04r
removing old data
Reading
into
Pass 1, processed 63 triples (63)
Reading
into
Pass 1, processed 764610 triples (764547)
Reading
into
Pass 1, processed 764658 triples (48)
Pass 2, processed 764658 triples, 26769 triples/s
Updating index
Index update took 17.133335 seconds
Imported 764658 triples, average 19375 triples/s
Preparing for tests...
[PASS] add-and-delete
[PASS] count
[PASS] distinct-predicate
[PASS] foaf-all-limit
[PASS] foaf-bnode-vs-variable
[PASS] foaf-construct
[PASS] foaf-disjunctive-filter
[PASS] foaf-distinct
[PASS] foaf-graph-all
[PASS] foaf-graph-pred
[PASS] foaf-knows-name
[PASS] foaf-knows-name-sha1
[PASS] foaf-knows-sha1
[PASS] foaf-knows-sha1-xml
[PASS] foaf-multi-disjunctive-filter
[PASS] foaf-nested-optional
[PASS] foaf-nothing
[PASS] foaf-optional-order
[PASS] foaf-optional-pair
[PASS] foaf-optional-regex
[PASS] foaf-repeat-var
[PASS] graphs
[PASS] integrity
[PASS] null-optional
[PASS] null-optional-double
[PASS] optimiser-disjunction
[PASS] select-bnodes
[PASS] select-order
[PASS] select-unused
[PASS] size
[PASS] tiger-broadway
[PASS] tiger-explosion
[PASS] tiger-fail-optional
[PASS] tiger-harold-ave
[PASS] tiger-landmarks
[PASS] tiger-mixed-optional
[PASS] tiger-reverse
[PASS] tiger-sugar-hill
[PASS] tiger-sugar-hill-filter
[PASS] tiger-typical
[PASS] tiger-water-names
[PASS] union-nobind
Tests completed: passed 42/42 (0 fails)
make[1]: Leaving directory `/usr/local/src/4store/tests'

4store and Dan Hanley’s client libgs

Sunday, December 13th, 2009

Find below step by step instructions on how to talk to a 4store KB via the SPARQL-Procotol in Java, using Dan Hanley’s 4store client libs.

First of all you need to have the following installed :
4store
A java compiler (i have Sun’s Java SDK 1.6.x installed on my laptop)
Maven (to compile Dan Hanley’s 4store client libs).

I have all of the code needed for this example placed on my site here : http://mmt.me.uk/examples/4store-java-query-example/ feel free to grab and use it as you wish.

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 (”\n”). This is fine you are using the SPARQL-XML-RESULT format, by I am a tad lazy and much prefer working with the tsv format: tsv requires line breaks.

The git diff of my patch looks like so (and again yes it is a tad dirty) :

diff --git a/src/main/java/uk/co/magus/fourstore/client/Store.java b/src/main/java/uk/co/magus/fourstore/clie
index 6652874..097be43 100644
--- a/src/main/java/uk/co/magus/fourstore/client/Store.java
+++ b/src/main/java/uk/co/magus/fourstore/client/Store.java
@@ -349,7 +349,7 @@ public class Store {
String response = "";
String str;
while (null != ((str = in.readLine()))) {
- response += str;
+ response += str+"\n";
}
in.close();
return response;
~
~

This above patch allows me to make use of the TSV output as needed. The patch can be grabbed from here : http://mmt.me.uk/examples/4store-java-query-example/patch.txt.

Ok, now that I have built the 4store-client.jar file with my patch using the instructions in the git repo. 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 http://mmt.me.uk/examples/4store-java-query-example/.

These are the steps which I have taken to get this little demo up and running :
1. Create 4store KB called lame

4s-backend-setup --node 0 --cluster 1 --segments 2 lame

2. Start lame’s backend (i.e. start the KB)

4s-backend lame

3. Import the example.rdf file into lame’s backend (i.e. start the KB)

4s-import lame example.rdf

4. Start HTTPD for the KB named lame

4s-httpd -s -1 lame

And then I need to compile the exampleQuery code I knocked together

javac -cp 4store-client-1.0.jar exampleQuery.java

Finally, I run the code like so :

java -cp 4store-client-1.0.jar:. exampleQuery

Resulting in the following output:

Am about to query a sparql endpoint
A user name is:"Bob"
A user name is:"Alice"

I hope this helps!

Private Browsing with Safari

Sunday, November 15th, 2009

I use firefox as my primary browser, both at home and at work. So I have setup my Safari browser, as my private browser – that is sans cache, history, cookies or anything of a similar nature. I noticed that the “Private Browsing” option in Safari, doesn’t do that good a job of not leaving files hanging around in one’s operating system, furthermore unless your careful, Spotlight will eventually end up indexing your browser history, cache, which may be less than ideal.

In order to have a zero cache safari instance on my laptop I have taken the following steps :

  • 1: Removed spotlight’s prying eyes, by excluding the following directories :
    • /Users/<USERDIR>/Library/Caches
    • /Users/<USERDIR>/Library/Safari
    • /Library/Caches
  • 2: Setup two cronjobs to constantly delete Safari cache-dir
  • */10 * * * * find /Users/<USERDIR>/Library/Safari -type f -exec rm {} \; 2>&1 > /dev/null
    */10 * * * * find /Users/<USERDIR>/Library/Caches/Metadata/Safari/ -type f -exec rm {} \; 2>&1 > /dev/null

FOAF Inverse Functional Properties

Monday, September 7th, 2009

These are the Inverse Functional Properties of the FOAF ontology, as per 07/09/2009 :

4store>select * where { graph <http://xmlns.com/foaf/0.1/> {?a <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#InverseFunctionalProperty>}}#EOQ


?a
<http://xmlns.com/foaf/0.1/homepage>
<http://xmlns.com/foaf/0.1/mbox_sha1sum>
<http://xmlns.com/foaf/0.1/jabberID>
<http://xmlns.com/foaf/0.1/isPrimaryTopicOf>
<http://xmlns.com/foaf/0.1/icqChatID>
<http://xmlns.com/foaf/0.1/weblog>
<http://xmlns.com/foaf/0.1/mbox>
<http://xmlns.com/foaf/0.1/aimChatID>
<http://xmlns.com/foaf/0.1/msnChatID>
<http://xmlns.com/foaf/0.1/yahooChatID>

I was wondering what happen to foaf:openId ? Does anyone know ?

Personas @ MIT

Tuesday, August 25th, 2009

So, MIT has recently put out a service which via animating some pretty colours presents a user with a pictorial description of their “online persona”. The service is called Personas, and my persona can be found below. I like the thought of being aware of your digital persona, due to my interest in the topic during my PhD studies, my involvement in the Memories for Life network, and my current role work at Garlik, I give lots of thought to what it means to capture a snap shot of a someones digital persona or to even attempt to capture it in its entirety. I guess this could have implications to the way we are force fed online advertising, through to the thought of one day having a digital nomenclature, which feeds information about everyone you encounter, letting you judge for yourself…

Anyways, so I typed in my first and last name into the Personas site, and low and behold, this is result I was shown :

Mischa Tuffield's MIT Personas 24/08/09

Mischa Tuffield's MIT Personas 240809

Apparently, the three most prominent of my online characteristics are : “online, sports, illegal”. Hehe, I guess the online bit makes some sense, and after scratching my head, and re-running the service I think I have sussed it :

  • Online: yeah well …
  • Sports: I must be due to this article I was mentioned in in the Telegraph. It was a feature in a technology section, which a part of motoring technology supplement. So, I guess that makes some sense
  • Illegal: Well this one puzzled me for a while, but I think the people at MIT think I am a identity thief, hehe…

Which would definitely not be a good thing given that I am currently working trying to help people defend themselves from ID Fraud. So why, does Personas come to this conclusion? I think it is down to a blog post which a friend of mine Tom Heath wrote a while back, where you used the following words “was trying to steal my identity (presumably because he had a fragment of RDF about me in his FOAF file)”. This is a perfect example of how natural language processing can fail, and how much more sophisticated metrics must be used if we are to identify accusations, opinions, or any more complex statements from free text. Tom’s blog post was actually going on about how Google’s Social Graph API failed to understand his FOAF file, merging myself and Tom into one person, another technological fail, but I guess they follow on nicely from each other…

I should note that Google’s SocialGraph API is doing a better job than when it started, and as far as I am aware it now understands RDF natively, via libraptor.

Grabbing LOD clouds

Tuesday, August 18th, 2009

I have been looking for a set of links for all of the (Linked Open Data) LOD clouds so that I could have a pictorial description of how the LOD cloud has evolved since it was first assembled. Sadly there are no links to the old LOD clouds on from the LOD cloud’s home on the web.

So I hacked together a dirty perl script to see if I could guess the URLs for the old clouds, the code looks like so :

#!/usr/bin/perl

$rootUrl = ‘http://richard.cyganiak.de/2007/10/lod/’;

#now to brute force the URL mangling to grab all of the pictures

for ($i = 2007 ; $i < 2010; $i++) {
for ($j = 1 ; $j < 13; $j++) {
for ($k = 1; $k < 32; $k++) {
$stringToFetch = $rootUrl.”lod-datasets_$i-”.make_big($j).”-”.make_big($k).”.png”;

`wget $stringToFetch`;

}
}
}

#padding out string …
sub make_big($) {
my $string = shift;
if (length($string) == 1) {
$string = “0″.$string;
}
return $string;
}

After running the script I have found the following old instances of the LOD cloud :

Finally, I still don’t think I have the first LOD cloud, would love to know its URL if anyone out there knows it!

meh to owl:equivalentClass

Monday, August 10th, 2009

Meh,

So we now have more links from dbpedia to other RDF resources on the web. Dbpedia now links from dbpedia classes to freebase ones, this example SPARQL query gives some examples of the described linkage. None of these make any sense to me. Why have people decided to use owl:equivalentClass and not owl:sameAs (ducks behind computer screen). Neither of the two seem correct to me, am guessing there is a skos:broader relationship (or something similar) which would be more appropriate, but at least we have come to accept that owl:sameAs tends to get abused, do we really need to loose faith in the semantics of the other OWL classes. Does anyone know why dbpedia decided to go this way?

The OWL spec defines owl:equivalentClass to be :

“A class axiom may contain (multiple) owl:equivalentClass statements. owl:equivalentClass is a built-in property that links a class description to another class description. The meaning of such a class axiom is that the two class descriptions involved have the same class extension (i.e., both class extensions contain exactly the same set of individuals).”

I really don’t think these links are suitable for the knowledge at hand. Perhaps even rdfs:subClassOf would be more fitting.

Privacy, Data Mashups, and Practical Obscurity

Wednesday, August 5th, 2009

I have long been thinking about how the interweb affects the notion of practical obscurity and how one can no longer expect to be forgiven for a crime after they have served their sentence.

An example I have used for a while now is the Georgia Sex Offenders mashup

http://www.georgia-sex-offenders.com/maps/offenders.php

IMHO sites like the above one will just end up creating ghettos of sex offenders as real-estate agents start to adopt such online resources to help sell properties to future homeowners. Eventually we will see neighbourhoods of sex offenders as no family would ever choose to live next to a rehabilitated offender. The key word in the previous sentence being “rehabilitated”, as they have been released by the judicial system into the community as reformed human beings.

Now one can install an iPhone App, which tells the phone own about sex offenders in their local area, GPS/web magic, note that this only works in the US :

http://www.telegraph.co.uk/technology/apple/5918923/iPhone-app-tracks-sex-offenders.html

I believe that practical obscurity is a dying concept. At this point in the post I should stress that I DON’T classify sex offences are petty crimes, but I believe that the advent of such data on the web will set a president for other forms of crimes to be being posted to the public domain. I can easily imagine a future where all crimes committed in some US state X are posted to the web.

For example, high-school student Bob gets arrested for shop-lifting and gets a minor punishment that could be community service or something of a similar vain. Alice a classmate of Bob’s finds this so funny that she posts it to whatever cool social network she is currently a member of, pushing it into the public domain. Now after Bob has served his sentence in pre-interweb days this information would have been practically obscure, it would have been logged in a filing cabinet in some local magistrate court, and unless you had the impetus to seek out this information you would probably never have found out about it. Alice would have been able to communicate the “funny story” to her social network, but those conversation’s would not have been in the public domain. And now they would be.

Well that is all from me, would love to know if people in the US have installed this APP, and wonder how many linch mobs are going to run around US cities taking following their trusty iPhone and taking the law into their own hands. Here is a link to an article which describes some of the vigilantism which occured in the UK after the tabloid new paper “The News of the World” published a list of sex offenders in the year 2000. Do excuse the fact that I am pointing to a document on the “world socialist web site”, but it seems to report the story well :)

Furthermore, Kieron O’Hara, Nigel Shadbolt and I wrote a paper touching on this a while back, it can be downloaded from ECS eprints.

EEEbuntu on a ASUS EEEpc 701

Thursday, July 9th, 2009

I have recently been given a ASUS EEEpc 701, thanks swh, and have till now found it way too slow and jerky. The 701 I have has got 1G of RAM and 4G of disk space built in, which I added a 16G flash disk too.

Thanks to Seb (old housemate), I have now downgraded the graphics driver, and as a result it is now totally usable, yay to small computers!! I followed this howto guide when attempting to fix the EeeeeePc.

These are the steps I took :

1. Edited and added the below lines to : /etc/apt/sources.list:

deb http://ppa.launchpad.net/siretart/ppa/ubuntu jaunty main
deb-src http://ppa.launchpad.net/siretart/ppa/ubuntu jaunty main

2. Imported the needed key:

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xce90d8983e731f79

3. Installed the older driver:

$ sudo apt-get update
$ sudo apt-get install xserver-xorg-video-intel-2.4

4. Restarted X.

sudo /etc/init.d/gdm restart

And then, like magic a usable working EEEbuntu on the 701. Notes that I tend to install Fedora OSs on my machines, this is the first time I have decided to stick with an Ubuntu flavoured OS.

Determining the Level of Trust of a Digitally Signed Document

Wednesday, July 8th, 2009

In order to determine how trustworthy a digital signature of a file is, you need to grab the file, the digital signature, and you will need to import the user’s public key. This wikipedia fragment describes what is meant by a “trustworthy signature” in terms of the Web of Trust.

This is the command I run to determine the level of trust of my signed foaf file.

gpg --verify --no-tty --status-fd 2 --command-fd 0 foaf.rdf.asc foaf.rdf

Which results in the folowing output :

gpg: Signature made Wed 3 Jun 23:19:52 2009 BST using RSA key ID 51F2F7EF
[GNUPG:] SIG_ID foL1PiWCT+546VnE17UG2QvWJeE 2009-06-03 1244067592
[GNUPG:] GOODSIG 9ED0B04E51F2F7EF Mischa Tuffield (Mischa@Garlik) <mischa.tuffield@garlik.com>
gpg: Good signature from "Mischa Tuffield (Mischa@Garlik) <mischa.tuffield@garlik.com>"
gpg: aka "Mischa Tuffield (http://id.ecs.soton.ac.uk/person/6914) <mmt04r@ecs.soton.ac.uk>"
[GNUPG:] VALIDSIG 18A2AF280CA59E77AE512BB39ED0B04E51F2F7EF 2009-06-03 1244067592 0 4 0 1 2 00 18A2AF280CA59E77AE512BB39ED0B04E51F2F7EF
[GNUPG:] TRUST_ULTIMATE

This is an automatic way of evaluating how trust worthy statement at the end of a URI are.