How to Architect ?
Well – what before how – this is firstly about requirements, and then about treatment
Linked Open Data app
Create a semantic repository for a read only dataset with a sparql endpoint for the linked open data web. Create a web application with Ajax and html (no server side code) that makes use of this data and demonstrates linkage to other datasets. Integrate free text search and query capability. Generate a data driven UI from ontology if possible.
So – a fairly tall order : in summary
- define ontology
- extract entites from digital text and transform to rdf defined by ontology
- create an RDF dataset and host in a repository.
- provide a sparql endpoint
- create a URI namespace and resolution capability. ensure persistence and decoupling of possible
- provide content negotiation for human and machine addressing
- create a UI with client side code only
- create a text index for keyword search and possibly faceted search, and integrate into the UI alongside query driven interfaces
- link to other datasets – geonames, dbpedia, any others meaningful – demonstrate promise and capability of linkage
- build an ontology driven UI so that a human can navigate data, with appropriate display based on type, and appropriate form to drive exploration
Here’s what we end up
- UserAgent – a browser navigates to Lewis TDI homepage – http://uoccou.endofinternet.net:8080/resources/sparql – and
- purl.org redirects to dynamic dns which resolves to hosted application – on EC2, or during development to some other server. This means we have permanent URIs with flexible hosting locations, at the expense of some network round trips – YMMV.
- dyndns calls EC2 where a 303 filter intersects to resolve to either a sparql (6) call for html, json or rdf. pluggable logic for different URIs and/or accept headers means this can be a select, describe, or construct.
- Joseki as a sparql endpoint provides RDF query processing with extensions for freetext search, aggregates, federation, inferencing
- TDB provides single semantic repository instance (java, persistent, memory mapped) addressable by joseki. For failover or horizontal scaling with multiple sparql endpoints SDB should probably be used. For vertical scaling at TDB – get a bigger machine ! Consider other repository options where physical partitioning, failover/resilience or concurrent webapp instance access required (ie if youre building a webapp connected to a repository by code rather than a web page that makes use of a sparql endpoint).
Next article will provide similar description or architecture used for the Java web application with code that is directly connected to a repository rather than one that talks to a sparql endpoint.
Since you have decided that you also want to make sure it can fulfill all the usual use-cases – performance, concurrent updating, ease of maintenance, basic functional capability (for a business app perhaps), and importantly, whats the benefit – how do you sell this to your manager. For you it’s cool, its being talked about in all the hard to reach places that only you know, and it has more and more promise the more you look into it. You want to do it, but if it doesn’t cut-the-mustard, whats the point – wait a while, let someone else solve the problems, then come back to it. You can still work in the web app world, doing what youve done for the last while, make some money, pay the bills. So, before you even start, the Semantic Web is up against it – it has a lot to prove against a long embedded technology where experience has already paid and dividends been reaped. It better be good……
First question – where to start ? Its a hard question to answer if you’re not familiar with the Semantic Web, and even if you are – if you can grasp the basic and simple ideas behind it – then you’re still going to have difficulty. And whats the Linked Open Data web ? How do I use it, why should I bother ? Why would my boss be interested ? How can I make them interested ? How can they make money from it ? Doesn’t his mean my companies data is going to be available to the public, and my competitors ?
So, over the next while, Im going to try and relate how and why I did what I did to build two different kinds of web application –
1) a read-only reference data application that makes use content loaded into a repository and fronted with a sparql end point, talks to geonames, dbpedia, sindice, uberblic and google maps.
2) a “White Label” J2EE Location Based Service that uses JPA behind its DAOs to talk to a semantic repository. It also makes use of OpenID to provide some anonymity, Spring Security to provide security and ACL controlled authorization (all stored in a semantic repository) and integrates the first app using JSONP (Facebook Authentication and OAuth authorization are also on the cards).
It has taken a while, and there have been some good and bad choices, so tune in next time for the first installment in the series, selected from this bunch :
- Target Functionality – what is my application and what parts of the semantic web do I want and/or need to deliver. Does the application want/need to be part of the Linked Open Data web ?
- Selection criteria – technologies, content, delivery
- Available tools and technologies. Can I avoid SOA pitfalls or is this just the same old story ?
- What needs writing ?
- How to architect ?
- Do I need an ontology – how to create ? Whats OWL-DL/Lite/RDFS/DAML/XYZ ?
- Text vs RDF vs XML – Reading, generating, parsing, APIs.
- Size, performance, scale
- Output – files, databse, rdf, URIs, linkage, API ?
- Do I need freetext search ? How do I do it ? Why not just use SOLR and faceted search ?
- Content Negotiation – who/what is my audience ? browser, script, machine, API ?
- Mapping – I’ve got location, lets use it – show it and link it
- Ajax, js – can I use semantic web/rdf/rdfa libs in my UI – do I have to do it all ? What help is there ?
- UI – can I build a UI to display and collect queries (forms) using my ontology ? How do I allow a human to easily navigate thru my strutured, but infinitely (hey, what about closure ?) graphable set of nodes ?.
Which do you want to hear about first ?
Like I said, I built two web applications for the Semantic and Linked Open Data web. The articles following this introduction will talk about both in parallel.
Both applications are now running on Amazon EC2 in a micro instance.
- AMI 32bit Ubuntu 10.04 (ami-480df921)
- Joseki 3.4.2
- Jena 3.6.2
- Empire 0.7
- DynDNS ddclient (see )
Dont try installing sun-java6-jdk, it wont work. You might get it installed if you try running instance as m1.small, and do it as the first task on the AMI instance. Didnt suit me, as I discovered too late, and my motivation to want to install it turned out to be no-propagation of JAVA_OPTS, not the jdk. See earlier post on setting up Ubuntu.
- Lewist Topographical Dictionary of Ireland –
- Extraction and RDF generation from unstructured text with custom software.
- Sparql endpoint on Joseki, with custom content negotiation
- Ontology for location, roads, related locations, administrative description, natural resources, populations, peerage.
- Onotology for Peerage – Nobility, Gentry, Commoner.
- Find locations where peers have more than one seat
- Did one peer know another, in what locations, degree of separation
- Linked Open Data connections to dbPedia, GeoNames (uberblic and sindice to come) – find people in dbPedia born in 1842 for your selected location. Map on google maps with geoNames sourced wgs84 lat/long.
- SkyTwenty –
- Location based service built JPA based Enterprise app on Semantic repo (sesame native).
- Spring with SpringSec ACL, OpenID Authorisation.
- Location and profile tagging with Umbel Subject Concepts.
- FOAF and SIOC based ontology
- Semantic query console – “find locations tagged like this”, “find locations posted by people like me”
- Scheduled queries, with customisable action on success or failure
- Location sharing and messaging with ACL groups – – identity hidden and location and date time cloaked to medium accuracy.
- Commercial apps possible – identity hidden and location and date time cloaked to low accuracy
- Data mining across all data for aggregate queries – very low accuracy, no app/group/person identifiable
- To come
- OpenAuth for application federation,
- split/dual JPA – to rdbms for typical app behaviour, to semantic repo for query console
- API documentation
A report on how these were developed and the things learned is planned, warts and all.
http://blog.codesta.com/codesta_weblog/2008/02/amazon-ec2—wh.html – not everything needs to be done, but you’ll get the idea. Install ddclient and follow instructions.
It seems to me having recently looked at the Elphin Census of 1749 and the ideas of Improvement, eg at Caldwell Castle and Estate, that it’s the actors in the events of history who are the most important, and one of the best sources of investigation to understand many topics. Why not create a FOAF repository for them with
- Place of Birth
- Place of Death
- Where lived, when
- Title or role
It would then be possible to link and see
- which improvers knew Jonathan Swift, were members of the RDS, and had lands in some part of the country. Or
- what Baronets knew each other who were also diametrically opposed on the question of Patriotism (in the anglo-irish 18th sense).
Why cant I upload my foaf profile to wordpress ? Or can I ?
Will wordpress go the semantic way as Drupal7 is heading ?
Any modules for RDFa -ing the HTML in Drupal, without me having to manually crank it out, if I wanted to ?