Latest Posts

Archives [+]

Categories [+]

Authors [+]

Entries filed under 'iks-project'

    Posted by Bertrand Delacretaz JUN 18, 2010

    Posted in fise and iks-project Comment 1

    Next week in Salzburg, the IKS Early Adopter's Workshop brings together a number of CMS vendors, to discuss what we've been doing at IKS for more than a year now, and what comes next.

    As my involvement in IKS mostly revolves around the FISE prototype semantic engine, I'll present it and explain how it can help CMS vendors graft value-adding semantic features to their CMSes. In a RESTful way of course - we don't want you to do open heart surgery on your CMS at this point.

    Finding image similarities with FISE

    Here's a use case that I think summarizes what FISE could do, medium-term, to help CMS vendors manage their content in more semantic ways. I won't scare you with RDF, ontologies and the like: at this level we're just looking at providing valuable features to our users, without requiring them to learn anything new. There might well be RDF, ontologies and SPARQL queries under the hood, but at our level we don't care, this is just about the user story.

    Here's a picture that I took on a trip to Iceland a few years ago. Typical Icelandic house with typical big Icelandic four-wheel drive vehicle (unlike many places you actually need those there, believe me) parked in front, with a canoo on top. Kinda makes you want to live there if you like wide open spaces.

    Icelandic House

    Now, here's a drawing by young Bertrand which has much the same content, at the semantic level: a big car in front of a house, with a boat on top of the car. Not too stylish, but the same basic information is in there. Smiling sun of course, which you might get in Iceland every ten minutes in between showers...

    Young Bertrand's House Drawing

    For our eyes and brain it is trivial to see that both images describe a similar scene. However, I doubt your CMS or digital asset management system would consider them as similar. You need a good semantic understanding of them to find out that they pretty much tell the same story - it's not just about the raw bits.

    That's where FISE comes into play. We don't have all the required semantic analysis algorithms in FISE for this use case today, but the current infrastructure would (mostly) enable it if we had them.

    FISE allows you to plug in such algorithms, using a simple Java EnhancementEngine interface. Based on OSGi, FISE makes it possible to mix and match a wide range of Java libraries without conflicts, allowing pre-existing or new analysis modules to collaborate. Analyzers written in other languages can be integrated using either native language integration or remote access, ideally over HTTP.

    Image analysis scenario

    Here's how FISE would help find out that our images are similar:

    • A JPEG engine extracts the EXIF metadata from the images if present.
    • A text-based entity extraction engine looks at that metadata, and if the images have a good title or description connects them with some well-known entities. For example Country=Iceland and Contains=House for the first one, and Contains=House and Contains=Car for the second one, if the images titles are "House in Iceland", and "The Big Car in front of Dad's House" for the second one.
    • A shape-based entity recognition engine adds metadata like Contains=Car and Contains=House for both images.
    • A graphical analysis engine adds metadata like Style=Photo for the first and Style=Drawing and Style=Childish for the second image, due to its strong primary colors and ragged lines.
    • A similarity search engine integrated in FISE can then find out that both images contain similar objects, so they can be considered similar even though the style of image is very different. You could also search for childish drawings of houses, and then get a link to the nicer photo besides young Bertrand's drawing.

    The role of FISE is to coordinate the various analyzers, combine and store their results, make them searchable and provide a RESTful interface to all this.

    FISE is the integration engine that makes such scenarios possible once analyzers of sufficiently good quality are available. As usual, the sum is greater than its parts, so being able to combine various such analyzers should lead to very valuable results, even with imperfect analyzers.

    Orchestration and intents

    What's currently missing in FISE is a way of orchestrating the enhancement engines: currently they only run in a configurable sequence, without real interactions between them.

    We'll have to discuss this on the FISE mailing list, but right now I'm thinking that something similar to the Android Intents mechanism, where an engine broadcasts information about what it has found so that other engines can build upon that information, might be well suited to that problem. The orchestator would start by broadcasting an "analyze incoming content" intent, to which a few engines would respond. The engines in turn broadcast intents like "enhance title and description", "analzye image content" etc. and the orchestator keeps going, iteratively, until there are no outsanding intents left.

    That analysis might take some time, depending on which analyzers are used, but the FISE design allows for asynchronous computing of metadata as well. In some cases, involving humans in parts of the analysis (a la mechanical Turk) might be the best way to get meaningful results, at least until Kuzweil's Singularity hits us. Asynchronous analysis would then be required, and FISE would have to be able to say "I have some metadata for your content already, and more is supposed to come at some point". This is foreseen in the current FISE design but not yet fully specified nor implemented.

    Coda

    I think this image similarity use case is a good way to explain what FISE is about, and will help validate the FISE design.

    FISE is on a very good track to making such things possible, while keeping things simple from the CMS integrator's point of view, thanks to its RESTful interface. The design needs some refinements, and we'll very certainly get some good input about that next week at the workshop - looking forward to it!

    Posted by Michael Marth MAY 28, 2010

    Posted in fise, iks-project and osgi Add comment

    At this week's IKS meeting at Paderborn the second FISE Hackathon took place. FISE is an open source semantic engine that provides semantic annotation algorithms like semantic lifting. The actual annotation algorithms are pluggable through OSGi. Existing CMSs can integrate the engine through an HTTP interface (inspired from Solr). Last week, Bertrand gave an introductory talk about FISE that is available online.

    There was no explicitly set goal for the second Hackathon. Rather, the existing code base was extended in various different directions. Some examples:

    • a language detection enhancement engine (I am particularly glad to see this - automatic language detection in CMSs is a pet passion of mine)
    • a UI for FISE users that allows humans to resolve ambiguities
    • myself, I coded a JCR-based storage engine for the content and annotations

    There was also a good amount of work done on the annotation structure used by FISE and documented on the IKS wiki.

    A complete report of the Hackathon is available on the IKS wiki (the only thing it fails to mention: the event's good spirit).

    One major non-code step was to get many participants up to speed with the FISE engine and enable them to deploy the engine as well as get accustomed with the architecture and code base.

    It was only last week that I took a deeper look into FISE. I like its architecture a lot. The HTTP interface makes it easy to play with FISE as well as integrate it. Even more important, the pluggable archirecture that is mostly inherited from the OSGi services architecture makes FISE very flexible and extensible. This is particularly important given the different natures of the enhancement engines that we want to be able to deploy (hosted services, proprietary, open source, etc). I consider FISE to be a particularly well suited use case for OSGi.

    Posted by Bertrand Delacretaz MAY 20, 2010

    Posted in fise, iks-project and screencast Add comment

    Here's a recording of my presentation of IKS FISE to my colleagues today.

    As you can imagine, convincing Day folks of the value of a RESTful interface is quite easy. None of them sent me code for that killer EnhancementEngine yet, but I'm hopeful ;-)

    IKS is organizing a FISE hackathon next week during the General Assembly, hope to see you there, and remote participation via IRC is also welcome.

    IKS FISE

    Posted by Bertrand Delacretaz APR 01, 2010

    Posted in fise, iks-project and rest Comments 3

    I'm happy to report that the first IKS FISE (pronounced like an aussie would say "phase") Hackathon, held in Furtwangen earlier this week, has been a success.

    We have implemented a very simple "content enhancement server" to which you PUT or POST content using HTTP requests. The server uses a series of "enhancement engines", plug-ins that can enhance the content with automatically generated tags, entities based on natural language recognition, etc.

    All in a very simple way for now, but the important thing is that we have demonstrated our vision of a very simple RESTful engine for semantic enhancement of content, in the form of working prototype software. The services API is extremely simple, and building the system as OSGi services makes it very easy to plug-in new enhancement engines.

    To whet your appetite, here's a quick walkthrough.

    Starting the FISE server is the hardest part for now, it's all source code that you need to build yourself, including snapshots so don't try it unless you're very familiar with building bleeding edge java software.

    Once that's done, however, using FISE is very simple. To add content to it, use an HTTP PUT request like

    $ curl -H Content-Type:text/plain -T data/text-examples/obama-signing.txt http://localhost:8181/fise/obama

    which, if all goes well, returns a status code 200 and the ID of the FISE content that was stored (/obama in this case).

    Then, make a GET request on the same URL to get the metadata of that piece of content, generated by the currently active FISE EnhancementEngines:

    $ curl http://localhost:8181/fise/obama
    **ContentItem:/obama
    **Metadata:
    </obama>
    <http://rdfs.org/sioc/ns#related_to>
    <http://dbpedia.org/resource/Texas_Health_Resources>

    </obama>
    <http://rdfs.org/sioc/ns#related_to>
    <http://dbpedia.org/resource/Richard_Gottfried>
    ....more RDF triplets

    The FISE architecture allows for each engine to suggest running its content enhancement operations in asynchronous mode, which can be very helpful for analyzing large items.

    So, from the CMS developer point of view, integrating FISE is very simple. Queries are handled in the same way, using HTTP GET requests. The current prototype runs either in standalone mode (in-memory storage, no queries) or on top of Apache Clerezza which provides persistence and SPARQL queries.

    On the other side of things, supplying new enhancement engines or wrapping existing ones to make them available in FISE is also very simple - one just needs to implement the following interface (shown in simplified form here, constant declarations removed for brevity):

    public interface EnhancementEngine {
    /** Can this engine enhance supplied content item? */
    int canEnhance(ContentItem ci);

    /** Enhance supplied item's metadata */
    void computeEnhancements(ContentItem ci);
    }

    To create a new engine, one just needs to create an OSGi service that implements this interface, and register it with the FISE runtime.

    FISE is in my opinion a very exciting development for the IKS project, fulfilling our hopes of creating an interface between CMS developers, who can use FISE easily from the HTTP side, and semantic researchers, who can provide new EnhancementEngines.

    This week's hackathon has more than met the goals set in my presentation at the last IKS workshop in Rome - looking forward to where FISE will lead us!

    More info at http://wiki.iks-project.eu/index.php/FISE


    Posted by Michael Marth DEC 28, 2009

    Posted in cq5, iks-project and tutorial Comment 1

    As part of the IKS project each CMS vendor completes a couple of benchmarks in order to establish a baseline against which future semantic improvements can be measured. For benchmark 3 "Workflow Service" Bertrand and I chose to implement the task "Create a multi-channel (email, SMS, instant messaging, Twitter,...) notification service for workflow transitions". We have created an automated workflow step that can be inserted into a custom workflow and either send an e-mail, send a direct message on Twitter or send a chat message on GTalk/Jabber. The corresponding message's payload is the path to the content node in the workflow plus an optional custom text.

    Below follows a description how this functionality was implemented in CQ5. The complete code is attached to this post as a CQ5 package. I will outline of some of the considerations and gotchas regarding this particular feature, but some issues apply to CQ5 development in general as well. The environment I used for development was CRXDE Lite (the web-based IDE available at /crxde of your CQ5 installation) and a beta version of the upcoming CQ5 release 5.3. It is probably helpful to install the package (see setup section below) and read the code alongside with this post.

    OSGi services

    A good way to hook up external services like Twitter etc. is to create a custom OSGi service that exposes only the business functionality and hides the internal classes. Moreover, it is good practice to provide a Java interface and the separate the implementation of the service (allowing the replacement of the implementation without affecting relying parties). The services will show up in the Sling configuration console at /system/console/configMgr. This allows the administrator to configure the service's private parameters at deployment time (in our case Twitter account credentials and Jabber user credentials). The config is consumed by the service like e.g.:

    /** @scr.property */
    public static final String GTALK_USER = "gtalk.service.user"; 
    /** @scr.property */
    public static final String GTALK_PASSWORD = "gtalk.service.password";   
    
    protected void activate(ComponentContext context) {
        Dictionary config = context.getProperties();
        user = (String) config.get(GTALK_USER);
        password = (String) config.get(GTALK_PASSWORD);
    }

    3rd party libraries

    In order to use Twitter and Jabber I utilized the open source libraries Twitter4J and Smack, respectively. With CRXDE (Lite) it is very simple to include such 3rd party jars in a custom OSGi bundle: just drop them in the bundle's /libs folder. When building the bundle CRXDE will embed them. Compilation and deployment is done by executing "Build Bundle" (right-click on the .bnd file in the bundle root).

    A note on 3rd party jar's dependencies

    It might well be that the bundle compiles and deploys, but does not start. Check the OSGi console at /system/console/bundles to find out if your bundle's state is "Active" (good) or just "Installed" (not good). The latter happens e.g. when the embedded jar has dependencies on other jars that are not embedded. In such a case check the bundle's details page in the Sling console to find out which dependencies are missing and either add them to /libs as well or take them out of the OSGi imports. That is achieved by editing the .bnd file's import directive, e.g.

    Import-Package: !com.sun.syndication.*, !dalvik.system, *
    

    Workflow action

    The last needed piece is a workflow step that can be added into a custom workflow. For that purpose one simply needs to create a class that implements the Interface JavaProcessExt. The method execute will receive the workflow's payload - from there is is trivial to obtain the services described above and pass them the content. CQ Workflow Actions can be customized for each particular workflow they are used in. I use this feature to customize the accounts to which a message shall be sent (the custom format is explained in the setup section below). The customization string is passed to the execute method as well: comma-separated values will arrive as a String[] array.

    Setting up the package

    To get this up and running download the attached CQ5 package and install it throught the package manager. In the Sling console configure the the services com.day.cq.mailer.impl.MailerService, com.day.iks.service.impl.TwitterServiceImpl and com.day.iks.service.impl.GtalkServiceImpl. For Twitter and Gtalk you need to supply the credentials of the (technical) user that shall send the DMs or chat messages, respectively. In the case of e-mail you need to configure your mail server.

    Next, create a custom workflow in the CQ5 workflow section and add the workflow action (name). The configuration options are:

    • for sending an e-mail: email,user@mydomain.com,some_message
    • for sending a direct message on Twitter: dm,twitter_user,some_message
    • for sending a chat message on Gtalk: gtalk,user@gmail.com,some_message

    The (optional) message will be appended with the content item's path.

    Here is an example for GTalk:

    In the cases of Twitter DM and GTalk make sure that the recipient has opted-in to receive messages from the technical user you have configured as a sender.