We’re in the process of building a PHP library for managing data based on VIE/CreateJS to facilitate the integration of the CreateJS interface and the necessary RDF rendering into the plethora of PHP-based frameworks and applications. While development is done based on the CMS we use in-house (MidCOM), the aim is to make it as generic and as simple to integrate into other systems as possible.
You can read our original proposal here
The gist of it is that we want to automate the (tedious, error-prone) process of rendering the annotations CreateJS needs to function, while giving developers full control over RDF – ORM mappings. The self-same mappings should also be available in the REST implementation so that the data VIE sends can be persisted on the server. Right now, we’re in the design phase, so we’re experimenting with different ways to make an API that is both concise and flexible enough for most use cases.
To give you a rough idea of where we’re going with this, here’s some early API ideas:
/* SETUP */ // The config defines property configuration and mappings. Missing settings // can be autodetected later on by the RdfMapper implementation $config = get_config_array_from_somewhere(); // This class has to implement the RdfMapper interface for the ORM you use $rdfMapper = new Doctrine2RdfConverter($config); // $blogEntry is an ORM object from your framework of choice $entryController = new CreateJsController($blogEntry, $rdfMapper);
/* OUTPUT */ // Renders the blog entry's title, wrapped in a h1 tag, with all // relevant annotations $entryController->title->render('h1'); // Add or replace an attribute value, both regular HTML and RDFa-specific $entryController->content->setAttribute('class', 'ui-corner-all'); // Customize rendered HTML, with placeholders $entryController->content->setTemplate('<div class=“content-outer“> <div __ATTRIBUTES__>__CONTENT__</div></div>');
/* BACKEND */ // see above for $rdfMapper instantiation $backend = new CreateJsRestService($rdfMapper); // This will send the appropriate response or error $backend->processRequest();
But again, this is far from being set in stone, updates will be posted as they become available. What will happen over the next few weeks is that we implement and test those ideas on two CreateJS-based web sites we currently have in development. This should provide use with some real-life use cases that will help us to determine the actual usefulness and completeness of the new library, and a sample implementation on which other integrations might be based, so stay tuned to see how it goes!