Archive

Posts Tagged ‘ontology’

Open Semantic Desktop Search – good but….

April 22, 2016 4 comments

….needs more administration documentation I think, or maybe an idiots guide for the likes of me. I installed the Desktop version VirtualBox image and it all went fairly smoothly. After setting up doc shares to an archive of about 800k docs on a NAS things started indexing. Cool ! Facets ! Keywords ! Metadata ! But all was not right – it was slowish – but hey its a VM and my host is not super-top-of-the-range (a Haswell pentium G3258 – so I made sure it was running with 2 CPUs and had 4gb RAM and about 40gb disk to play with at the start. Monitoring it is easy with the search GUI or using the XML REST response at http://localhost:8983/solr/admin/cores?action=status. But things seem to halt at times, or CPU spikes and not much appears to be happening – where do you find any info about what OSDS is doing right now ?

So – the usual places – web server, syslog, etc. Only trouble is I can get a desktop terminal to run in the VM – it seems to start then nothing. So ctrl-f2 into a console. What user id ? Turns out its “user”. What’s the password ? turns out its “live”. I found the log4j.properties for solr in /var/solr and adjusted to INFO level with console and file output, restarted SOLR and…no more info. Messages and syslog need root access – sudo of course – but have to add user “user” to sudoers. Whats the root password then ? I found it somewhere in the documentation but now (ironic) I cant re-find it there. So if you find it let me know – and when you do you can update the sudoers to include user live. Turns out the other place to look for clues is the /tmp dir – it contains the tesseract OCR and tika tmp copies of things so you can monitor the number of files in there and see progress.

But I still cant find out what exactly is going on right now (or maybe this is all there is) and importantly I cannot really guess when the detection, extraction, OCR and indexing will finish. I have a file count from my archive and can see the numbers of current docs indexed but that doesnt give me much help in terms of timing. Tesseract seems pretty sensitive and some quick blog and forum searching seems to confirm that. Still – despite this and the occasional crash or VM abort (and no real way to understand why except removing the most recently active folder share from the VM and wading thru /var/log – making only 1 cpu available to the VM seems to help the crash frequency it turns out) its still going to be better than Recoll I think which wont have facets are the possibilities or RDF enrichment, vocabularies etc. I’d also like to try out ElasticSearch with it – soon.

So –

  • zenity at 50% ? – kill the pid – its just a GUI notification that somethings running, and not really needed
    Nautilus seems to miss behave and if you leave it open on /tmp it also seems to take 50% cpu – kill it
    Give the VM plenty of RAM. I seem to have come across some SMP bug in debian on my system so Ive tuned the VM down to 1 cpu, which seems to help
  • Important dirs on your travels…
    • /opt/solr,
    • /var/solr/logs
    • /var/log/messages
    • /tmp
    • ~
    • /var/opensemanticdesktopsearch
    • /var/lib/opensemanticsearch (*.py files for UI)
    • /usr/share/solr-php-ui/templates/view.index.topbar.php (more UI files – eg header)
      /usr/share/python-django-common/django/
      /var/solr/logs
      /opt/solr
      /etc/defaults/solr.sh
    • /var/solr/data/core1/conf
    • /usr/share/solr-php-ui/config.php
    • /usr/share/solr-php-ui/config/config.facets.php (add facet to this list – even tho it says not to because the UI will overwrite it : it doesnt tho – so they appear in the UI)
      ./opensemanticsearch/enhancer-rdf (map facets to purls)
      ./opensemanticsearch-django-webapps/apache.conf
  • tika on localhost:9998
  • default logging for tika and tesseract appears to be system.out
  • sudo apt-get update !

Adding facets

Note editing and uploading facets via text file at http://localhost/search-apps/admin/thesaurus/facet/ attempts to overwrite config.facets.php but fails !

'Facet' object has no attribute 'title'

but the facet is created in Django and appears under “ontologies”, but without any named entities. Some debugging and rooting around shows that the PHP code in /var/lib/opensemanticsearch/ontologies.views is looking for facet.title from the form, when it is in fact called facet.label. Changing line 287 in this file to

""".format(     facet.facet.encode('utf-8'),    facet.label.encode('utf-8')

means that you can now upload text files with concepts for facets. These then show up under the facet name in the right hand column, but dont show up as “concepts” that you can alias for instance.

Collapsing facet menus

if the list of concepts or even the list of facets gets long then putting them in accordian might be good idea. I used Daniel Stocks jQuery plugin. (https://github.com/danielstocks/jQuery-Collapse). Download then include the plugin, eg in

/usr/share/solr-php-ui/templates/view.index.php:

add the following script include

http://js/jQuery-Collapse-master/src/jquery.collapse.js

Then : change line 229 (in function print_fact) to in

/usr/share/solr-php-ui/ndex.php
<div id="<?= $facet_field ?>" class="facet" data-collapse="accordian">


Counting docs

A quick script to show the number of processed docs on the cmdline

FILE=/tmp/numdocs.log
echo "Outputting to $FILE"
wget -o /tmp/status_msg.log -O $FILE http://localhost:8983/solr/admin/cores?action=status 
grep --color numDocs $FILE
rm $FILE

Any more tips ?


 

  • Update (May 4 2016) – about half way thru volume of 800k docs now after 25 days processing. Still crashing out but not so often now it seems. About 20gb of disk used in the VM now.
  • Update (June 1 2016) – finished, but only after I disabled pdf ocr at about 700k – have to come back to this
  • Update June 7 2016 – Ive been trying to get exif data into solr from all the jpegs that I have but without much success until now. After head scratching and debugging and trying to work it out I have had to
    • provide a tika config file :
      <?xml version="1.0" encoding="UTF-8"?>
      <properties>
       <parsers>
         <!-- Most things can use the default -->
         <parser class="org.apache.tika.parser.DefaultParser">
           <!-- Don't use DefaultParser for these mimetypes, alternate config below -->
           <mime-exclude>image/jpeg</mime-exclude>
         </parser>
      
         <!-- JPEG needs special handling - try+combine everything -->
         <parser class="org.apache.tika.parser.jpeg.JpegParser" >
            <mime>image/jpeg</mime>
         </parser>
       </parsers>
      </properties>
    • update/fix the /etc/init.d/tika script start/respawn cmd to correctly use that file (and reboot the vm as init restart doesnt seem to work and systemctl daemon-restart doesnt either – or maybe its just my dud config) :
      daemon --respawn --user=tika --name=tika --verbose -o /tmp/tika.log -O /tmp/tika.err -- 
      java -jar /usr/share/java/tika-server.jar -c /home/user/osds-config.xml
    • try and work out if the /usr/lib/python2.7/etl/enhance_extract_text_tika_server.py script was working or not -lots of extra print statements and verbose = True. The long and the short of it is that it is working, but the extracted metadata fields defined in the script dont include much in the way of exif fields, and even if they did we’d also have to update the /var/solr/data/core1/conf/schema.xml to include them as fields. Thats the next job…
    • A handy cmdline test of the tika-server is to post a jpeg to it using curl. If your init script isnt working you wont get much back, likewise of the file you think you are posting doesnt actually exist, and if you are getting a 415 unsupported media type back in verbose curl response, it probably means you tika config file is screwed, like mine was, but I kept ignoring that – fool !. I went back to unit level and defined a single test dir in the /etc/opensemanticsearch/filemonitoring/files and put one test jpeg in there. Using the curl cmd you can then test the tika-server is working (you’ll get back a json blob with exif fields), and then using ‘touch’ and /usr/bin/opensemanticsearch-index-dir you can test the pipeline in full.
      curl -vX POST -H "Accept: application/json" -F file=@exif.jpg http://localhost:9998/rmeta/form -H "Content-type: multipart/form-data"
  • (Update Sept 2016) – new version of OSDS available that seems to work better out of the box. Interface changes, django defaults to english, adding named/entities and facets doesn’t barf.

 

http://www.opensemanticsearch.org/doc/tutorial

http://www.lesbonscomptes.com/recoll/usermanual/webhelp/docs/index.html

https://www.elastic.co/products/elasticsearch

https://www.kernel.org/doc/Documentation/sysrq.txt (although this doesnt seem to be possible during the crash as the system is completely unresponsive)

https://help.ubuntu.com/community/DebuggingSystemCrash

Using w3c org ontology to describe Ireland’s entry to the EU (i)

November 22, 2014 Comments off

eGovernment EU Institutions working on interoperability (“Joinup”) have commited to the W3C their work on an ontology describing organisations. This follows work by Dave Reynolds.

There are also ontologies and vocabularies for Registered Organisations, EU institutions, job descriptions and do on. All very useful – really ! – but in trying to use them to describe the history of the Irish accession and membership of the EU I have come across a few things that have led to some customisations and extensions – a new ontology in fact. Of course, this is part of the beauty of Linked Data and I hope to have some real data to publish soon for review.

The dataset should include, starting at 1950, the history of Ireland’s interaction with the EU and the events that took place from them, in context. This will include organisations, events, ministries, ministers, locations, dates, and outcomes, and so will require some thought and analysis to avoid duplicating what is there already and to make correct use of the classes and properties already defined.

There are a few things to consider, not least the definition of a “state” for a “government” and a “ministry” or “department”. The Location ontology allows for geometric coordinates and spatial descriptions for instance, but the organisation ontology on the other hand doesn’t cater for a political or economic location to be described. So I am adding that and making use of another ontology (the Agricultural Information Management Standards geopolitical ontology/thesaurus). This will be joined by an object property.

The Joinup vocabulary for EU institutions includes historical names for the economic organisations and treaties – like the European Coal and Steel Community for instance – and is described using SKOS. This gets included as a reference source in my ontology. Treaties are not described as particular things so I’m working on adding that too. Prov-o may or may not help here. The CPSV catalog describes the Public Service but appears incomplete or still in development. It also doesn’t seem to link to the org ontology in any way, so I’ll tackle that as well. There is also a vocab for institutions names and civil service roles that will be useful, as long as I can link it back to foaf properly – still trying to see how for now !

Of course this all highlights a  issues and advantages of open world ontologies

  • your modelling perspective defines what you want to use and how you see other work – I see some gaps and connections that others may not, or that were not important or particular at the time, or that in fact need or can only be defined depending on your perspective
  • its possible to make up for that by joining and linking classes in a new ontology that reflects your vision
  • it can be hard work trying to figure out what exists already and where and how to extend it
  • tool support (in Protege at least) is lacking when it comes to creating individuals as well as new classes and properties – ideally I want to pick a class, then get some completion help to allow me to see the class hierarchy and the available properties (like a programming IDE – Eclipse or Idea for instance). I resort to sparql.
  • How to coin linkable URI and  where to publish  with a content negotiator and sparql endpoint ?

Still, it’s going to take some time, but should be interesting to come up with something that can be reviewed, corrected and evolve – without reinventing the wheel. Success will be measured in how many inbound links it gets !

DERI (LATC) launch schema.rdfs.org

June 18, 2011 Comments off

Some of the DERI people (and others) involved in LATC have launched schema.rdfs.org to counter the lack of rdfs in schema.org – the Microsoft/Google/Yahoo attempt to kickstart some RDFa publishing so their search engines can try and improve result relevancy. Some of the items in schema.org are quite simple, but thats probably a good thing : a large term set or number of properties is going to look daunting to anyone interested or someone starting out for the first time – and indeed this is the reason cited that it is not RDF (its microdata). And while I agree with Michael Bergman that it is more than likely another step towards structured/linked/common/open data, adopters urgently need a combination of

  1. Tools (or better still no tools, just an unobtrusive natural way to author microdata or rdfa) and
  2. a Reason to do it – payback
  3. Support in search UIs to specify vocabulary items

I’d like a wordpress plugin for instance, but then I’d need to host an instance myself or find a hoster that allows plugins because wordpress.com doesnt allow it. I’d also like to think that if I placed some RDFa in my blog that it would get higher a ranking in Search results (it should) but this blog is pretty specialised anyway and its not commercially oriented so Im happy enough with keyword based results anyway.

So, I’m not going to be doing it too soon, and thats the problem really. Or is it ? This post isn’t data really, but it does have links and it does talk about concepts, people, technology problems. If I could mark them up with tags and attributes that define what I am talking about then it would mean that I could tell those search engines and crawlers what I am talking about rather than hoping they can work it out from the title, the links I have chosen, then feedback comments and so on. Then people looking for these particular topics could find or stumble upon this post more easily. So, while there is some data here, arguably I don’t see it that way, and even if I think there might be a good Reason to do it, it’s too hard without the Tools

So I wonder finally, if I was to mark up one of these people mentioned in this post with name,address, affiliation,organisation and so on, would the search engine UIs allow me to use this vocabulary directly – I want to find articles about DERI say, would the search drop down prompt me with itemprop="EducationalOrganization" – so that I’d then only get results that have been marked up with this microdata property and not with things that are about the Deri vineyard in wales, punto deri, courtney deri and so on ?

Sindice kinda does this, couldn’t the Goog do it too ??? Or indicate which results are microdata’d, or allow a keyword predicate (like site: say), or allow the results to be filtered (like Search Tools in the left column). The point for me is that schema.org is only half or less than half the story – the search engines need to Support the initiative by making it available at query time, and to allow their results to manipulated in terms of microdata/rdfs too. Then I might be more tempted to markup my posts in microdata,rdfs,microformat or whatever, and I might create some extensions to the schemas and contribute a bit more, and my post might get more traffic in the long tail, that traffic would be more valuable, my ad revenue might go up (if I had ads for myself !), and the ECB might drop their interest rates. Well, maybe not, but they’re not listening to anythine else, perhaps some structured data might persuade them. It is the future after all.

Whats the point : Semantic RESTful Web Services ?

March 9, 2011 4 comments

Well, I think its dawning on me, that what Roy Fielding talks about (rather abstractly) [1] is what Henry Story neatly summarises and provides examples of [2] – REST SOA, with connected semantics. I’m one of those who can be accused of implementing REST not in the Roy Fielding manner of the word, but in the anyting thats not WS* “meaning”. I’ve done request mapping, content negotiating, resource rendering in XML, Json (and a bunch of others), GET,PUT,POST,HEAD etc etc etc, but never all together, and never in the true Spirit of Roy. But when you add the semantic web, you can really see that theres something good going on here – “easy” and ubiquitous webservices.

Roy talks about representations, resources and connectedness, about agents or service consumers that deal with well-known media types and links, and nothing else – REST implies that a user agent is “thin”, understands basic-and-well-known types and protocols, and renders a look and feel and a behaviour that reacts to what it is fed. As he says it should work with the “follow your nose” principal (no need for WADL[3,4]).

For a browser this would mean that you point it an URL, it displays content suitably, that it receives and displays links with appropriate CRUD capabilities for it and and relations it is given.  For example, given a book resource, render it using the .book CSS class, and create links to add to shopping cart, get a contents list, add to a favourites list. For a chapter in the book, there may be link to print it, to relate it to a chapter in another similar book, to annotate it and send to a colleague. For a daemon or agent it might mean that it alters the time at which it performs an action against a resource, or what action it takes. The navigation and action controls aren’t determined by business or display logic, but by the resource and its relations – the agent consuming the resource knows it has to display or follow a link, the CSS may have display capabilities based on the resource type or context, the workflow steps will appear at the right time for the right user, under the right circumstances. Client logic is solely to deal with converting representations to appropriate media-types, and driving application state – using relations and verbs to make transitions with links.

But the thing that got me spinning, as I tried to understand the abstractedness, and as I looked into JAX-RS [5], and its various implementations (well, Spring* in particular TBH,which doesnt do JAX-RS in fact [6]) was that the connectedness and follow-your-nose principal seemed absent. Its all very well and cosy (and arguably easy) to create some platform code that maps URIs to classes and methods and HTTP verbs, and then to output XML or JSON or not (think JSP), or perhaps even Atom, OData, RDF, N3 or TTL but wheres the linked connectedness – the things we talk about and take for granted in Linked Open Semantic Data world ? And how does it know what links to create, how to generate them, and how they should be presented (if there’s a human involved) ?

Well, Henry blows that lightbulb for me when he illustrates from his foaf profile all the foaf:knows relations [2]. In a RESTful world where a service returns a foaf file and reads the foaf:knows elements it can decide what to do based on that predicate – it can deduce that the resource represented is a Person and can create the links it chooses using what it knows about foaf:knows and REST verbs – create/read/update/delete. It might allow addition of another foaf:knows with a PUT to the URI identifying the owner, an update to a mailing list so that all those foaf:knows objects are added, or automatically update a trust counter against a system resource because if Henry foaf:knows TBL in this context, then TBL must be “good for it” :-). In addition, it only knows that a URI represents that Person, and the URI could be a hypermedia link in the form of an URL, a ftp or webDav link, or some other protocol. Finally, this “knows” concept is really an upfront agreement about what representations are being used for the state of the application (it knows and XML schema, or an Ontology, or perhaps even looks them up on the fly), but navigating thru state is controlled by the interactions with the service (Http verbs) and the responses (status and agreed represenation in the body content) received.

At first sight those RESTful libraries don’t really need to know that much about the connectedness – they only need to map verbs and serve resources with those links embedded (RDF anyone? ) and using those well-known vocabularies, classes,relations and constraints – ie ontologies. But what about workflow : I post an object or resource, I get a response with the ID of that resource, and I need a link that tells me where to go for the next state transition ?

So, lo-and-behold, we have semantic linked data and REST superadditively combined, in a loosely coupled web (or “cloud”, if you like that keyword) of semantic links, intelligent user agents that understand those links or their context, web resolvable URIs, and value-added interlinked services – in effect a “Web Service Bus”. [7] !!

Now

  1. Point your People tool at the RESTful people+location web service and it “just works” to give you a social-network-mashup of connected people and interests (provenance, trust), and then
  2. switch over to your Energy consumption application and it also just works (based on what it has chosen to do and the well-known ontologies and resources it understands) – see how big your carbon footprint is when you meet TBL next week at Geneva if you fly,drive or take the train – and maybe you’ll be able to see who you can meet on the way and who else will be sitting beside you.

But your not out of the woods yet, doing semantic RESTfu web apps isnt a clear open space : your application still has to deal with authentication, input validation, long lived database transaction control, multithreading, performance, perhaps object relational mapping, but jax-rs/REST takes care of the object-message-mapping (the interface-to-implementation layer), your client or agent is thin but intelligent, and your middle tier contains your business logic.

Your application will need to honour the request-response state machine, perhaps checking availability using OPTIONS, or Etags.

You’ll need to decide how to transform from your programming model of choice – OO perhaps – to Resource. Some of the object to RDF mapping within libraries like Empire[15], JenaBean[16], Sommer [22]{defunct?), object-triple [17] may help. Perhaps this wont be an issue for you if you can foist the RESTful resource and linkage proposition onto an object model and remain in the object world – why waste processor and resource when you store data in RDF, convert to an Object on retrieval, process, convert to Xml-RDF or JSON on the way out, then parse and walk in a JSP before rendering as HTML ? As an OO programmer on the web you’re familiar with marshalling objects in and out of different serialization –  RDF/XML/JSON/HTML, but you do want and need to minimise those transitions. Perhapsfor “Big Data” we should stay in the Resource world : persist to a fast native RDF triplestore or HPC based system on a cluster of MapReduce or somesuch (CouchDB[20], Heart/HBase [21] ? perhaps BigData[18] or SHARD[19], AllegroGraph[23] ?), and talk to it with ProLog or some such – forget the Object paradigm and embrace the Linked, Open World Resources, and also do it with REST.

You also have to be clear that REST suits what you want to do (other architectures haven’t just been demoted to history) what your services are  -what you are interfacing with, what are your domain objects, what service operations are exposed when, what workflow do you need to encompass[13], and how granular you need to be – a shopping cart application will need to save items to a shopping list, rather than save the items themselves (or the cart resource probably), but it will also, behind the service, need to update a stock control or inventory – which isnt exposed to your end user.  So be clear about which service level CRUD operations you need to expose to your user or “agent”, and which if any domain objects you need to directly manipulate.

But in the end, hopefully, you’ve still followed your enterprise principles and patterns, but you’ve adopted a long lasting web-scale architecture, and if youve added the semantic vocabulary, you’ve got the basis for successful evolution, a network effect, adaptable clients and agents and a successful resolution to an important business case – thats why your doing this, isn’t it, not because its cool ?

Update : April 24 – read Otavios paper on RESTfulGrounding [25] but also read Alowisheq, Millard and Tiropanis EXPRESS RESTful services paper[26]. RESTfulGrounding does for REST and WADL what OWL-S does for WSDL – it gets Semantic descriptions into the syntactic descriptions that automated services might use to interact with a web service, and facilitates discovery, composition, monitoring and execution. EXPRESS takes a different approach and based on an existing RESTful web service allows you to create an OWL description that can also be RESTfully accessed to describe the services resources, relations and “parameters” (OWL DataTypeProprty and ObjectProperty). They describe an adaptation of Amazon S3 buckets and docs with EXPRESS and compare with SA-REST and OWL-S approaches.

I like EXPRESS more than RESTfulGrounding as the simplicity appeals : the way it in turn relies on REST to underpin the service description access and interaction, adheres to RESTful principles for message exchange – using TTL rather than XML – , follow-you-nose, and the fact that this in turn means I don’t have to learn much if I want to make use of it. It does need the use of a code generator for stubs and URIs and a manual step to define which methods apply to which URIs, and doesn’t do much for discovery and composition – but they acknowledge this and intend to work on it – and a real implementation with these tools needs to be made available so that people like me can try it out. Is there one ?

I need to understand more about WADL[27,28] (why is it needed in the first place ?) and how I might go about actually building a set of services that need to be described and then discovered and composed to provide some useful value, but EXPRESS fits nicely into web scale, lo-fi approaches that quickly gain traction and that might make use of a CPoA kind of approach for discovery and composition.

* You’ve got other choices :

  • Apache CXF – perhaps best if you come from the WS* camp or have a mixture [8]
  • GlassFish Jersey – seems to have good traction, with hooks into Spring et al [9]
  • RESTeasy – JBoss jax-rs implementation [10]
  • RESTlet – not sure about this, seems to have good support, taking a different approach apparently – eg RESTlet vs SERVlet, but I need more info to do it justice [11]
  • PLAY Framework – has good REST support I understand from others. [12]
  • Clerezza – Apache incubator project with RDF, jax-rs, scala and “renderlet” support. Looks interesting from a RDF PoV, but maybe not so interesting from an OOD PoV [14]

[1] http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven
[2] http://blogs.sun.com/bblfish/entry/rest_apis_must_be_hypertext
[3] http://wadl.java.net/
[4] http://bitworking.org/news/193/Do-we-need-WADL
[5] http://jcp.org/en/jsr/detail?id=311
[6] http://grzegorzborkowski.blogspot.com/2009/03/test-drive-of-spring-30-m2-rest-support.html
[7] http://wisdomofganesh.blogspot.com/2010/06/wanted-esc-not-esb.html

[8] http://cxf.apache.org/

[9] http://jersey.java.net/

[10] http://www.jboss.org/resteasy

[11] http://www.restlet.org/

[12] http://www.playframework.org/documentation/1.1/routes

[13] http://www.infoq.com/articles/webber-rest-workflow

[14] http://incubator.apache.org/clerezza/

[15] https://github.com/clarkparsia/Empire

[16] http://code.google.com/p/jenabean/

[17] http://code.google.com/p/object-triple/

[18] http://www.systap.com/bigdata.htm

[19] http://www.dist-systems.bbn.com/people/krohloff/shard_overview.shtml

[20] http://couchdb.apache.org/

[21] http://wiki.apache.org/incubator/HeartProposal

[22] http://java.net/projects/sommer/

[23] http://www.franz.com/agraph/allegrograph/

[24] http://blog.cubrid.org/web-2-0/database-technology-for-large-scale-data/
[25] http://www.fullsemanticweb.com/blog/ontologies/restfulgrounding/
[26] http://ebookbrowse.com/express-expressing-restful-semantic-services-using-domain-ontologies-pdf-d12806537
[27] http://java.net/projects/wadl/
[28] http://bitworking.org/news/193/Do-we-need-WADL

Semantic Food & Beverages

February 25, 2011 2 comments

Google do semantic recipe search apparently [1-3] and a university in New York does a Semantic Sommelier [4]. Interesting – yes, but I want more info !

What ontology and what vocabulary is being used – tap[5], pips[9] ? w3.org food[7], hrecipe[6] – or other microformats [8] ? How about Umbel or Yago ? Any chance of a link for the explanation of the sommelier app – would love to know more about it and see it, rather than just some PR ? Do they link to other datasets, so that if I pick a wine or a recipe I can find things that go with the flavours and aromas, see photos, maybe learn the history, culture, location and science/tech of the recipe ? Hell, commercialisation here I come, perhaps I want to know what stores in my area have the ingredients, or stock the wine, with other related produce and offers ? And if a celeb chef happens to endorse it, then maybe I’ll go and but their set of cookware for christmas. (Or I’ll go/link to Amazon and get it cheaper, if they use the same vocabulary…)

If I search for Sausages and you have a recipe for “Bangers and Mash” do I get a recipe snippet or result fraction ? If I search for Mash and you have a blog post about creating a web page from lots of parts of other pages, does it show up ? How about if I search for a French Classic recipe – do I not find results for pages that describe the same thing but in English, German or Japanese ?

This semantic web thing needs to get out there, so you can taste it.

[1] http://www.google.com/landing/recipes/

[2] http://www.wired.com/epicenter/2011/02/google-recipe-semantic/

[3] http://www.cnet.com/8301-13553_1-20035977-32.html

[4] http://news.rpi.edu/update.do

[5] http://deductions.sourceforge.net/GUIgenerator.html#Another

[6] http://microformats.org/wiki/hrecipe-rdf

[7] http://www.w3.org/TR/owl-guide/food.rdf

[8] http://microformats.org/wiki/recipe-formats

[9] http://www.ketzerato.net/repositorio.html

Some NepoMuk ontology types

February 18, 2011 Comments off

I am doing some work on a Top Secret Project to demonstrate on the SkyTwenty[1] platform the use of email data (in place of location data).

I am making use of Aperture[2] to crawl an IMAP store, then allow sharing of contact and message information, so that queries can be run to discover

  • who-knows-who in what domain
  • how many degrees of freedom there are between contacts
  • do selected contacts have any connection
  • how “well” do they know each other and so on.

Aperture makes use of the Nepomuk [3] message and desktop ontologies[4], and they’re fairly extensive, so a graphic helps to understand some of the ontological relationships.

The brilliant Protege4 [5] ontology design tool has plugins for GraphViz[6] and OntoGraf[7] produce some fairly neat images to visualise ontologies, so here they are. I would like if there was a way to include object and data propertys (by annotation perhaps, will try later) but for now have compiled a table of the class properties from a crawl and sparql query I did against the repository I loaded the data into.

Contact class relationships

Note that OntoGraf needs the Sun JDK to work, so on Ubuntu, which has the OpenJDK by default, you need to install and agree to the license terms, then make sure that Protege is using the Sun java at /usr/lib/jvm/java-6-sun-1.6.0.22 (or whatever version).

Nepomuk message and contact classes

Nepomuk message and contact classes

 

These tables are incomplete, and represent the classes and properties from the crawl of my nearly empty inbox. The full set of classes and properties for the Nepomuk ontologies are available on another page on this blog.

Prefix URI
nie http://www.semanticdesktop.org/ontologies/2007/01/19/nie#
nco http://www.semanticdesktop.org/ontologies/2007/03/22/nco#
nmo http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#
rdf http://www.w3.org/1999/02/22-rdf-syntax-ns#
sesame http://www.openrdf.org/schema/sesame#
rdfs http://www.w3.org/2000/01/rdf-schema#Class
nfo http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#
type property
nie:DataObject rdf:type
nie:title
sesame:directType
nie:isPartOf
nie:characterSet
nie:mimeType
nmo:contentMimeType
nmo:messageSubject
nmo:plainTextMessageContent
nmo:messageId
nie:byteSize
nie:contentCreated
nmo:sentDate
nmo:receivedDate
nmo:from
nmo:sender
nmo:to
nmo:inReplyTo
nmo:references
nie:DataSource rdf:type
sesame:directType
nco:Contact rdf:type
sesame:directType
nco:fullname
nco:hasEmailAddress
nco:EmailAddress rdf:type
sesame:directType
nco:emailAddress
nfo:Folder rdf:type
nie:title
sesame:directType
nie:isPartOf
nmo:Email rdf:type
sesame:directType
nie:isPartOf
nie:characterSet
nie:mimeType
nmo:contentMimeType
nmo:messageSubject
nmo:plainTextMessageContent
nmo:messageId
nie:byteSize
nie:contentCreated
nmo:sentDate
nmo:receivedDate
nmo:from
nmo:sender
nmo:to
nmo:inReplyTo
nmo:references
nmo:MailboxDataObject rdf:type
sesame:directType
nie:isPartOf
nie:characterSet
nie:mimeType
nmo:contentMimeType
nmo:messageSubject
nmo:plainTextMessageContent
nmo:messageId
nie:byteSize
nie:contentCreated
nmo:sentDate
nmo:receivedDate
nmo:from
nmo:sender
nmo:to
nmo:inReplyTo
nmo:references
nmo:MimeEntity rdf:type
sesame:directType
nie:isPartOf
nie:characterSet
nie:mimeType
nmo:contentMimeType
nmo:messageSubject
nmo:plainTextMessageContent
nmo:messageId
nie:byteSize
nie:contentCreated
nmo:sentDate
nmo:receivedDate
nmo:from
nmo:sender
nmo:to
nmo:inReplyTo
nmo:references
rdf:List rdf:type
sesame:directType
rdf:Property rdf:type
rdfs:domain
rdfs:range
rdfs:subPropertyOf
sesame:directType
sesame:directSubPropertyOf
rdfs:Class rdf:type
rdfs:subClassOf
sesame:directSubClassOf
sesame:directType
rdfs:Datatype rdf:type
rdfs:subClassOf
sesame:directSubClassOf
sesame:directType
rdfs:Resource rdf:type
rdfs:domain
rdfs:range
rdfs:subPropertyOf
sesame:directType
rdfs:subClassOf
sesame:directSubClassOf
sesame:directSubPropertyOf
nie:title
nie:isPartOf
nie:characterSet
nie:mimeType
nmo:contentMimeType
nmo:messageSubject
nmo:plainTextMessageContent
nmo:messageId
nie:byteSize
nie:contentCreated
nmo:sentDate
nmo:receivedDate
nmo:from
nmo:sender
nmo:to
nmo:inReplyTo
nmo:references
nco:fullname
nco:hasEmailAddress
nco:emailAddress

[1] http://skytwenty.endofinternet.net:8080/treasure/moreInfo.usp
[2] http://aperture.sourceforge.net/
[3] http://nepomuk.semanticdesktop.org/xwiki/bin/view/Main1/
[4] http://www.semanticdesktop.org/ontologies/
[5] http://protege.stanford.edu/
[6] http://graphviz.org/
[7] http://protegewiki.stanford.edu/wiki/OntoGraf

Java Semantic & Linked Open Data webapps – Part 5.2

February 8, 2011 Comments off

Continuation from previous article in series

The overall architecture for the Semantic backed J2EE app is different from the Linked data app already discussed because we need a business logic layer and a decoupling from the persistence layer. We also want to create a Java app rather than a semantic application so that the programming paradigms and patterns are familiar to the Enterprise java developer.

 

Semantically backed J2EE webApp - System diagram

Here we see a fairly standard 3 tier MVC application. Browser requests URIs from the appserver, or makes an Ajax call and gets html from server side JSPs or JSON formatted data in response, respectively. The application server contains java code that maps URIs and API calls to controllers, which make calls to service classes and DAO code. The DAO code makes call via a persistence proxy to get data from the server that is unmarshalled from RDF to java objects (or makes writes in the other direction). The persistence layer is configured to use an implementation that takes care of the Object to RDF mapping – two implementations are available (JenaBean and EmpireJPA). These in turn use their own protocols to talk to native or location repositories, or typically JDBC talk with standard DBMS. Spring and Spring security provide infrastructure level services for dependency injection, component wiring, MVC abstractions, and role, method and data level security for beans and dynamically created object instances. These technologies are shown below in the AppServer layer cake.

 

Technology libraries and tools used in Semantically backed J2EE WebApp

Technology libraries and tools used in Semantically backed J2EE WebApp

Obviously, there are many things going on here, and they’ll need some discussion

  • Basic building blocks, tool selection
  • Security considerations and restrictions
    • authentication – OpenID, admin login, facebook connect
    • authorisation role,uri,method,data levels
    • registration process
    • ownership, group (friend) and application membership, resolution (date & location cloaking)
    • ACL – data and dynamic object level authorisation
    • Syndication –
      • json,jsonp (get/post),window.name,ajax,
      • cors
      • oauth
      • API and result formats
  • Scale, concurrency, transactions,  failures, and performance
  • URIs, ontology, linkage
  • input, output interfaces
  • ontology to object/interface mapping