
As some of you might know, we ( me and some colleagues ) have been regularly building Semantic Web applications for the last 4 years. Some of them have user interfaces in Flex.
This means that we have been experimenting with RDF in the Flash platform for quite a while.
Now, for strategic reasons we have remained ( almost ) totally silent on this issue. However, now that the Semantic Web is entering mainstream and I have closed some chapters in my life, I believe that it is time to share what we have learned with the Flex community and help create a social initiative that will hopefully be the home to one of the most powerful user interface platforms yet.
Initially, this community effort will consist of three tasks:
- Setup and manage the necessary infrastructure to sustain a community
- Contribute seed code, roadmaps and other material
- Attract talent from other areas
1. InfrastructureI am going for free Google services here to keep things simple.
This is so basic that it is almost a non-task. But I still list it here so I can announce the following:
Most of them are being setup but empty at this point.
Next step?: Join the discussions2. ContentWe have a complete AS3 RDF stack ( parsers, model classes, utilities, query engines, communication services, reasoners, UI components, etc ). We considered opening a part right away, but after much debate we decided the best choice would be to hold on and try to resolve some fundamental issues first. There are also potential legal issues ( leftover code, app-specific comments, etc ) that might make things slower than we would like to. But those are not really relevant compared to the design issues.
One of the
fundamental design issues we would like to resolve in this stage is figuring out just how deeply we want to integrate RDF into Flash. This is an extremely important topic, so let me develop it for a while.
2.1 RDF / AS3 integration ( how deep? )RDF Abstract Syntax and Concepts defines a set of RDF concepts, the building blocks over which the rest of the Semantic Web Stack is built. Within these "concepts" you can find IRIs, Literals, BNodes and Triples.
Over the years we have experimented with several ways to implement the RDF Abstract Model in different languages. You can find a whole family of proposals if you take a look at the major established java APIs (
sesame,
jena,
rdf2go, etc ). They usually have a hierarchy of "model" classes representing each term.
However tempting it might seem to just copy the Java models ( rdf2go or sesame for example. Both widely used and with a second generation design ), we need to keep in mind that
Flash is not Java and has some particularities ( both good and bad ).
First, we believe that values in the RDF value space ( and, by extension, the XSD value space ) should
ideally translate directly to the AS3 value space. This means that we should be able to use native comparison operators to determine equality and operate with a native Strings, Numbers and other values directly instead of operating with a instances of x.rdf.RDFTypedLiteral classes, for example. If this is not possible, then a simple way to move back and forth should be provided.
We have already tried different approaches, and currently most of our model classes use
Value-Singleton factories in order to allow identity based comparison and we have utilities to move from one value space to another ( codecs ). This works fine but has some GC issues and imposes some overhead.
Second, in Flash we need to design with limited resources in mind, both computationally and memory-wise ( if we look forward to
OpenScreen and devices ). Therefore, we need to have special consideration when designing the abstract model implementation. For memory considerations, we must handle large lexical values for typed literals in a special way. One typed literal that represents the complete text of a book chapter cannot be managed in-memory in the same way that literal that represents the string "foo", for example. Therefore, we need an indirection layer ( a reference to the literal, but a way to keep its lexical value somewhere else if necessary... perhaps persisted in a database, accessible on demand from a remote service, or stored locally in a LSO ). This will probably jump into the "async" world. Not trivial because it might impact the simplicity of the API in a negative way.
Third, AS3 has the notion of QNames and Namespaces built-in. This obviously rings a bell, since RDF is based on similar web concepts. However, we haven't figured out a non-ambiguous way to use this capability, specifically using QName as a replacement for IRI, much less a way to retro-fit QName into an inheritance scheme ( derived from a shared abstract RDFTerm or implementing an interface which it should share with other model classes ).
Fourth, I believe that there is an extraordinary opportunity to build a
subject oriented programming framework using native AS3 capabilities. Object accessors accept QNames and we have Flash Proxy available. We need more brilliant minds working on this to come up with a smart design. We have some prototypes but there is definitely room for improvement.
Subject orientation
is the way to go when scripting over RDF ( to cope with multiple inheritance ).
Fifth, bindings, collections and MXML are Flex specific elements that we have used to some extent, but our use case universe is small so generalization of best practices is still hard. We welcome fresh ideas.
There are more issues... but as you can see, several of them go down to the very core of the framework and thus impact the whole stack. Putting these issues up for discussion in early stages with developers, Flash player engineers ( and hopefully people with insight into the AS roadmap ) is definitely a smart choice.
Personally, I would love to modify the player and extend AS3 to natively support RDF semantics. This is not possible in my current position, of course... but there have to be some tricks and workarounds.
I have already tried custom metadata ( to create
Elmo-style annotations ) and it goes a long way. I have also experimented with some RDF path DSLs and created pre-compilers that generated MXML or runtime parsers to evaluate expressions.
But, again... these are just toys. We need more use cases to separate what's useful from what's getting in the way.
2.2 Historical Design DecisionsThe second general reason for not opening the codebase right now is that we
might be carrying outdated historical design decisions that were made years ago based on older versions of the SW specs or targeting old versions of the Flash/Flex APIs. This goes beyond the model and might extend into the parsers and query engines. It would be silly to rush in and waste the chance to review the design.
2.3 Collaboration from Day 1Finally, I want this to be a collaborative project and get talented people involved in it from the beginning. This is not a fully developed area like Relational Databases, Compilers or even 3D Modeling. This is a paradigm breaking technological shift and I don't see it settling in he short term.
We need to get the technology out there and test it against real-world problems. Hopefully a lot of them.
Our way of doing things is not necessarily the best. AS3 is a special beast and has a much closer relation to Web technologies than, say, Java or Python. I can foresee that we will find a tight fit between RDF and AS3, but it's going to take a lot of experimentation and deep insight into the AVM.
In this context, I think that crowdsourcing the early steps will be beneficial to us all.
( depends on the crowd, I know... but we're working on it ;) )
3. TalentThe Semantic Web community is still small, and the Semantic Web UI community is even smaller. Therefore, right after we have defined a basic roadmap, finished the initial technical discussions and layed out some code ( model and io ) we will evangelize this project to other communities related to Semweb and, specifically, Semweb UI.
Flash is a
very attractive platform so it will eventually be able to compete with Java and AJAX as a semweb UI platform. Time will tell...
Needless to say, I am very excited about this project. It has been a long, lonely road and I am eager to engage in some collaborative process to solve what I consider to be the most challenging problems I have ever faced. If you are reading this and you don't know what the Semantic Web is... then get ready to be blown away pretty soon! ( not by me... but by
all of us working together ).
For now everyone's invited to join the
semanticflash Google Group, but
be warned that conversations will be sparse and won't be noob friendly for a couple of months ( until we get to a higher level API ).
I know there are a few out there with Flex and SW experience (
TopQuadrant ). I would be grateful if they could join the discussions ( to comment on the
design issues ).
Finally, I would
really like to hear Adobe's take on this subject ( RDF and AS3 integration ).
Best,
A
DISCLAIMER: I am an independent consultant and work on my OSS projects as time permits. I will obviously do my best, but until I find more collaborators/funding, don't panic if this goes silent every now and then.