Wednesday, 19 January 2011

Semantic Access to ChEMBL

ChEMBL is a database of bioactive drug-like small molecules curated by the The European Bioinformatics Institute (EBI). EBI makes relational database versions (MySQL and Oracle) available for download. As part of a recent project I wrapped ChEMBL MySQL into OWL using TopBraid Composer's D2RQ support. The steps I took were as follows:
  1. created an Ubuntu Server (10.04 x64) LAMP Virtual Machine using VMWare Fusion on an iMac
  2. installed phpmyadmin on the VM to allow access to MySQL from my Web browser, and tested this to be sure I could access MySQL in the VM guest from Firefox on the VM host
  3. uncompressed and unarchived the chembl_08_mysql.tar.gz download file in the VM
  4. the resulting folder contains an INSTALL file which tells you to create a database and execute the chembl_08.mysqldump.sql file which loads the database using CREATE TABLE and INSERT statements
  5. logged into phpmyadmin from the VM host Firefox and checked that I could browse the ChEBML MySQL data ... it looked fine, there's a screenshot below showing there are 7 million records in the tables as well as a screenshot of the MySQL data model






  6. for licensing reasones, TopBraid cannot distribute the MySQL JDBC driver so I downloaded the mysql-connector.jar and place it in the TBC workspace root folder (TBC help explained this and included links to the MySQL Web site)
  7. started TopBraid Composer and created a new project called ChEMBL
  8. Selected the project and Import, Create Mapping Files for D2RQ Relational Database Interface
  9. filled in the filename of chembl_08, , base URIs of http://www.ebi.ac.uk/chembl_08-xxx.owl, database URL/database user/password and MySQL JDBC driver class



  10. Selected Finish and held my breath ... and after a couple of minutes .. Success!




I won't pretend it's fast to do general instance data browsing - I set my TBC to bring back 30,000 triples at a time to get lots of data, however doing SPARQL queries works pretty quickly. I'm now off to modify the D2RQ mapping to fit with another ontology, but the D2RQ approach to data integration is clearly a powerful and useful capability.



The default mapping creates usable URIs that enable SPARQL queries across classes, so I'm off to a good start. I'll update this post if the D2RQ mapping changes turn out to be interesting.

Friday, 6 August 2010

Modeling with Range-less OWL Properties

For those with a more traditional data modeling background, the idea of a property (aka attribute) with no range or specified data value space seems counter-intuitive. Attributes must be integers or real numbers or pointers to other instances/individuals. However, the OWL language allows range-less properties ... and that can be quite powerful when used in combination with the OWL allValuesFrom restriction.

Take the concept of identification or identifiers as an example. In simple cases, a string is all that's required for an identifier. In other cases, the organization owning the identifier and the specification of its format are very important. So, in some cases a property with a string data type suffices while in others a reference to an instance/individual with properties of its own (e.g. owningOrganization) is required. Here's a diagram of this example:



The key is to use rdf:Property for the rangeless identification property and then to use subClassOf restrictions when to associate the property with an OWL class.

Tuesday, 2 March 2010

SPARQL for SysML/AP233 Transformations

I've had a little play with SPARQL to see how powerful a transformation engine it can be given the CONSTRUCT capability. It's actually pretty powerful! In a past life I was involved in the OMG/INCOSE/ISO mapping creating a SysML-to-AP233 mapping spec. I thought I'd try a little of that as a test case - here's a SysML Block with name mapped to AP233. Pretty clear, computer interpretable and requires no fancy MOF metamodel like the TGG tools (e.g. MOFLON) require. Worth considering ...

CONSTRUCT { _:s rdf:type ap233:System .
_:s ap233:name ?name .
_:sv rdf:type ap233:SystemVersion .
_:sv ap233:ofProduct _:s .
_:sv ap233:id "1" .
_:svd rdf:type ap233:SystemViewDefinition .
_:svd ap233:ofVersion _:sv .
_:ca rdf:type ap233:ClassificationAssignment .
_:ca ap233:items _:s .
_:ca ap233:externalClass <ap233:rd_block> .
}
WHERE {
?subject rdf:type sysml:Block .
?subject sysml:name ?name .
}
}

Saturday, 27 February 2010

Working In The Semantic Web Now

I've moved to TopQuadrant to work in the field of Semantic Web technology. A particular interest of mine is applying that technology to engineering data. More to come as projects emerge...

Wednesday, 18 November 2009

Trying Nokogiri XML Parser for Ruby

Bumped into a few blogs talking about how Nokogiri was faster than REXML for Ruby XML parsing. My OMG SysML XMI to ISO STEP AP233 XML converter demonstrations are taking so long that I can't run them live during the demo - up to 8 minutes for a large example SysML diagram. So, I'm modifying the converter to use Nokogiri in the hopes that I'll be able to do the demos live in the future. My first small test showed an 80 percent improvement ... fingers crossed that holds for the real converter.

Update - having problem with XML namespaces. Only xpath method seems to understand them, so after converting from REXML to Nokogiri my converter actually takes longer to run.

Saturday, 14 November 2009

IDIOM - An ontology-centric IT Framework

I've been working in an ISO committee for many years and have been trying to convince it to adopt the same IT that the rest of industry uses. It appears that's finally coming to pass (small hurrah heard here).

The committee is called Industrial Data so I came up with the name 'Industrial Data Integrated Ontologies and Models' or IDIOM. Actually, came up with the name 3-4 years ago on one of my many cross-Atlantic flights when my laptop battery died. The core point of the whole exercise is to base a suite of inter-related IT capabilities (process models, SOA, etc) around a core of concepts that are formally specified in logic-based ontologies.

We've done the basic developing on the futurearch wiki (at wikispaces.com, which is a nice free service). Note that although 'Industrial Data' is in the name, there is absolutely nothing limiting how this IT Framework can be used.

More to come ...

Friday, 28 August 2009

VMWare Fusion - Reusing Core Ubuntu Install

When testing out new software, Monodevelop this week, I want to keep my daily Ubuntu VMWare guest clean until I decide if I'll use the new tool or not so I use a separate install. I don't want to keep so many Ubuntu installs around so cloning/disk reuse is interesting. I found a good article explaining how to build a core Ubuntu OS and then extend it. Basically, you create a core OS install guest, then share its disk with other testing guests after taking a snapshot in the other testing guest. Taking a snapshot keeps the core disk unwritable.... nice.

Thursday, 4 June 2009

Spotify, Airport and Airfoil - Free Web music on my Stereo

Spotify is free in UK now, with ads every few songs but not too bad, or you can pay a bit. It has a great collection of free music - well worth a look.

Combine it with Airfoil and I can stream Web music, or any other audio, to my stereo from my iMac/Airport Extreme.

Wednesday, 13 May 2009

Active Scaffold and Inheritance

Had a problem getting two cases of single table inheritance to work in ActiveScaffold so thought I'd document it. Package and Classifier are the ActiveRecord classes.

class ExpressSchema
has_many :express_entities, :foreign_key => 'package_id'
end

class ExpressEntity
belongs_to :express_schema, :class_name => 'ExpressSchema',
:foreign_key => 'package_id'
end

Monday, 11 May 2009

YUML Me for Putting UML on Web

Found a very nice little tool called yUML me for putting UML Use Case and Class figures into your blog or other Web pages.

Monday, 30 March 2009

Semantics For and From Information Models

I gave a presentation at the OMG Semantic Information Day on Thursday of last week. My presentation was actually called Semantics For and From Information Models and was about the use of W3C OWL to add semantics to data exchanges using XML and a follow-on project from NIST with a goal of pushing the STEP community towards semantics/ontologies as a core modeling technology.

The presentations will all be made available online and I'll update this post when they're available.

Tuesday, 17 February 2009

Demos with Rails, Hobo, ActiveScaffold

Continuing to play with doing demos of engineering applications using Ruby on Rails, and in particular the Hobo and ActiveScaffold frameworks that sit on top of Rails. Hobo is nice as long as you have a fairly simple set of concepts to handle. ActiveScaffold is more flexible, but is also a bit more work (e.g. Hobo builds in users/password where you have to add it to ActiveScaffold yourself).

Used ActiveScaffold on one "real" project at for work, which was just a prototype though, with around 30 concepts in the model and it worked out OK. Still some limitations though. It was the front end for a rules engine (jRules from iLog which was recently bought by IBM) so was an interesting architeture. We had to update the data tables from both the Rails GUI and from Hiberbate from the Java accessing jRules. Oracle Express was the database, which poses some problems of its own (e.g. date support is problematic).

Tuesday, 10 February 2009

INCOSE Activties with SysML and AP233

A bit of work news ...

At INCOSE over the weekend a workshop was held to start mapping the OMG SysML and ISO AP233 standards together. There's an OMG wiki to track progress. Here's an example SysML diagram:

Tuesday, 20 January 2009

VMWare Fusion VMs Work on Thinkpad Player

Kept reading on VMWare and found that creating VMs on the iMac using VMWare Fusion then using VMWare Player on my laptop to play them was supported. Tried it and it does work - great. Not sure if my original problem was Fusion V1 vs. V2 or an error on my part when copying from iMac to Thinkpad. Anyway, progress ...

Also found a script that lets you clone VMs. It doesn't work on Fusion (VMs are OS X packages of some sort, not a directory) but it showed me where to rename things and edit names inside files ... which is great. I now have a core Kubuntu 8.04.1 that I can clone and rename for other purpose (e.g. a netbeans VM).

Wednesday, 14 January 2009

Trying Xubuntu as VMWare Host on Laptop

Needed to reinstall VMWare Server (the free version) on my Thinkpad T61 widescreen so decided to try out Xubuntu (XFCE instead of Gnome/KDE) as the host. Should use a bit less memory and disk space so the VMs should work a bit better, if not noticeably better. The VMServer software wouldn't install properly with Xubuntu 8.10 so reverted to 8.04.1 which is supported per the VMWare Web site.

Sunday, 11 January 2009

Tracks for free!

Stumbled on an online Tracks (Get Things Done Rails app) online. Signed up at morph eXchange where you can subscribe to Tracks and use if for free. morph eXchange can also host your apps in the Cloud if you want - although I've not tried that yet.

Tuesday, 6 January 2009

Finally joined the blogsphere... we'll see how it goes.

Writing this from a Linux VM using VMWare Fusion on iMac 24 inch (great machine btw). The iMac is my desktop but I use a laptop for travel so copy my Linux and XP VMs back and forth between the iMac and Thinkpad. Have to create the VM on VM Server on the laptop to get that to work properly ... not sure why.