Posts Tagged ‘business’

Aperture Nepomuk queries

February 22, 2011 1 comment

Having crawled an Imap store (ie google mail), I now need to query the results to see whats what, whos who, and how they are connected, if at all.

These are the namespace prefixes used in the queries

Prefix URI

And these are the queries. Note that each message is in its own graph, and references the folder in which it rests – eg <imap://;TYPE=LIST>. This in turn nie:isPartOf another folder, which isnt nie:isPartOf a parent folder.

An Imap store has a username and password etc, but doesnt have an associated email address. A folder may contain messages to the owner with an email address the server accepts, but may also contain messages to other addresses if the cc list contains the owner address.

id Folder Relationship Purpose Query
inbox direct Basic find list of emails, with
sender email address
select distinct ?subject
?from ?address{

?s nmo:from ?o  .
?o nco:fullname ?from .
?o nco:hasEmailAddress ?e .
?e nco:emailAddress
?address .

?s nmo:messageSubject
?subject .

?s a nmo:Email} 

note : with a Jena TDB dataset, use

select distinct ?subject ?from ?address{
graph ?g{
?s nmo:from ?o  .
?o nco:fullname ?from .
?o nco:hasEmailAddress ?e .
?e nco:emailAddress
?address .
?s nmo:messageSubject
?subject .
?s a nmo:Email

inbox direct Find emails, distinguish
replies(and what replied to), and CC addresses
select distinct ?s ?subject
?r ?to ?refid ?from ?address{

?s nmo:from ?o  .
?s nmo:messageId ?sid .
?o nco:fullname ?from .
?o nco:hasEmailAddress ?e .
?e nco:emailAddress
?address .

?s nmo:messageSubject
?subject .

?s a nmo:Email
optional {
?s nmo:inReplyTo ?r .
?r nmo:messageId ?mid .
optional {
?s nmo:to ?toid .
?toid nco:fullname ?to .
optional {
?s nmo:cc ?ccid .
?ccid nco:fullname ?ccto .
optional {
?s nmo:references ?refid .}} 

order by ?subject

Note : nco:fullname optional as you may not know the email addressee’s name
Note : As with the basic query about, where using a Jean Dataset, you need a graph selector in the where clause eg

select * { graph ?g {?s ?p ?o}}
inbox direct most messages direct to you
select (count(?from) as ?count) ?from ?address{
graph ?g{
?s nmo:from ?o  .
?o nco:fullname ?from .
?o nco:hasEmailAddress ?e .
?e nco:emailAddress ?address .
?s a nmo:Email

group by ?from ?address
order by desc(?count)
inbox direct most messages CC to you Not so easy : where you are a CC recipient, its not possible to match on the to: field, or with any metadata on the imap server.
inbox direct fastest replies
inbox direct most replies
inbox contacts and counts by mail
inbox indirect messages to others on CC list
(may not be known to you, but sender knows)
outbox direct recipents (to,cc,bcc)
outbox direct replies
outbox direct most replied to
outbox direct most sent to
outbox direct fastest replied to (by message,
by recipient)
output direct fastest sent to (by message, by

Things get more interesting when more that one mailbox is available for
analyis…but Im going to need Sesame3 or revert to Jena because Sesame2 doesnt do aggregate functions like count. 2 steps forward, 1 step back. So, Jena support in Aperture is minimal and old. It cannot make use of graphs, TDB or SDB, (but the libraries are up to date). It also doesnt support Datasets or Named Graphs in Jena. So, I add ModelSet (the RDF2Go adapter type needed), Dataset and Named graph support, in TDB to begin with. This involves updating the Aperture Jena adapter. Doesn’t seem to be any activity on the Aperture mailing list tho, as I get zero response to a question about updating the Jena support. Is Aperture another nice-but-dead Semantic Web technology ?


Pancakes with a touch of Umbel

October 28, 2010 Comments off


Flour, eggs , milk and a good low lipped frying pan.

Do it the night before, put in the fridge, then cook first thing as a hot alternative to meat based builder’s hangover cure.

Drupal 7 on Ubuntu 10.10 or 10.04 for SPARQL federation

October 28, 2010 3 comments

Quick steps to install Drupal 7

This, so you can use the SPARQL federating plugin

First install ubuntu ! 10.10 isnt much over 10.04, perhaps less even, so go with what you have v10-wise.


Now you need apache,mysql,php and drupal, database setup (ie LAMP + drupal). Then and a variety sparql modules and support.

In short

  1. Install LAMP
  2. Setup MySQL (or create a database for it)
  3. Download and Setup Drupal (or update/upgrade)
  4. Configure Drupal
  5. Add modules

In some more detail

  1. Install Lamp
  2. Install PHP gd – you’ll get errors about it during Drupal install otherwise
  3. Setup mysql with database called d7 and admin user drupal
    1. create database d7
    2. grant all privileges on d7 to drupal@localhost identified by ‘password’ -if you get into trouble install phpmyadmin
  4. download drupal7, expand and move the expanded dir into the docroot/cms (you may need sudo for all of this)
    1. gzip -dc drupal.*.*.tar.gz | tar -xvf -
    2. mkdir /var/www/cms
    3. cd drupal.*.*
    4. mv * /var/www/cms
    5. read the README about creating default site and perms
  5. take a breath
  6. restart apache for the hell of it - sudo /etc/init.d/apache2 restart
  7. go to and create the first site by following the steps
  8. reset perms as per readme on settings.php

now find the SPARQL plugin [1,2] that Lin at DERI created and get to work on content-types[3]……

I’ve left messages but haven’t had a response yet – Sparql Views as it is on GitHub Jan 2011 won’t install on the official Drupal7 release (drush doesnt like it either, it seems). But theres also VARQL[4], built on top of what Lin did, that might be good for you.

There are dependencies you should be prepared to install – Views (not unsurprisingly), Dialog [5], Chaos Tools Suite [6] (maybe  RDFx [7] – Sparql Views has it, needs it, but Drupal7 has some conflict either at install or runtime – needs more investigation).

And you’ll need to download and manually install, as ftp to localhost, using the UI installer won’t work (at least not for me on Ubuntu 10.04/10).  Relying on ftp is just a bad way of installing things IMO.

Update rather than Upgrade

FYI : I easily updated (not upgraded [9]) my Drupal7 Beta to official release byfollowing Yodi Aditya’s instructions [8]













Starting with Sesame

October 18, 2010 Comments off

Have started using Sesame2 in place of Jena for the moment, to see if I can get around some performance issues that arise when using SDB (its slow, but thats the way it is). Sesame can to some degree proxy a database (and also has persistable in memory stores ) behind a http connection. Now Im not sure that using http and sesame libraries to talk to mysql is going to be any faster than Jena and SDB but if its not theres the in-memory-behind-http fallback position that you dont have with Jena’s TDB. And Sesame has BigData as well, so if theres a need to replicate and/or cluster theres an avenue to follow. Thats not to say there arent differences, pros and cons between them – so heres a quick summary

jena sesame
ontology handling ontology views federated sail ? Otherwise limited RDFS inference
inference forward and back chained forward and back chained
sparql ARQ extensions no extensions – eg no count”
database SDB mysql/oracle/postgres in httpd repo – no ontology capabiity ?
endpoint joseki http repo / workbench – changing in Sesame3
console joseki query/construct form – output xml,json select, prefixes, load, choose repo
data load TDB and SDB have bulkloader scripts SWB has load pages. Cant load a dir of files
API, libs full sparql, and Model, assemblies | JenaBean and others sparql, serql, model and SAIL | Empire, Elmo, AliBaba
Federation SERVICE keyword in query federated sail ?
Scale No replication support in TDB. Use SDB with database replication. BigData
concurrency MRSW for TDB (Concurrent updates not possible), MRSW for inMem, native
ACID based when SDB used with connection pooling ACID based when SDB used
support forums forum
licensing HP with Apache components but in flux – Moving to BSD Style with Apache components
Apache Incubator ? (Nov 2010)
Categories: semantic Tags: , ,

Mobile Device Apps Ranking Sep ’10

September 14, 2010 Comments off

Number of apps in mobile app stores in selected categories, as of Sep 2010

Category iTunes Ovi Android
History 2015 242 1102
Heritage 123 2 18
Tourism 158 14 20
Ireland 51 64 73
Genealogy 43 0 9
Veterans 17 0 20
Archive 81 3 199

Semantic Publish

March 11, 2010 Comments off

Lewis Topographical Dictionary of Ireland goes live at Archive Link :

No Ads !

Map output for Lewist Topographical Dictionary

Map display of freetext Query results

  • Quick reports on location, population, peers, natural resources, and road links, regex name matching
  • Full text per entry
  • Entry metadata properties and facets
  • Entry cross references
  • Entry type, parent and children
  • Full text search, straight and fuzzy
  • SPARQL endpoint
  • Application level links to dbPedia, Sindice, Uberblic, geonames
  • Data level owl:sameAs to dbPedia and geonames
  • Owl reasoning
  • Mapping with google maps
  • Charts with Google charts
  • Explore by jOWL

Still to come

  • Historic Maps
  • Arts and Architecture
  • Data cleansing
  • Hansard links
  • UK, Scotland, Wales
  • Parliamentary Gazeteer 1847
  • More data level and external links

Built with