allow jsr311 code to return normal Java Objects
-----------------------------------------------
Key: CLEREZZA-483
URL: https://issues.apache.org/jira/browse/CLEREZZA-483
Project: Clerezza
Issue Type: New Feature
Reporter: Henry Story
Sometimes one has java objects and it is tedious to transform them into some
graph notation. In the case I am dealing with I have an X509Certificate object
and a subject, and I need to produce some test html pages. The SSP code should
be able to just manipulate the java object, though the object should somehow be
disallowed from transforming the databases (ie it should be read only).
Of course for this to work with the Clerezza philosophy, the resource that
object represents should have an rdf/xml and other representations. So what is
needed is a way to automatically transform objects into rdf.
It turns out that this is quite easy, and I showed how to do it a few years ago
in a blog post
http://blogs.sun.com/bblfish/entry/serialising_java_objects_to_rdf
That shows how one does it with objects that have @rdf annotations on methods,
fields and classes. For objects on which that access is not possible, one will
need to use blank nodes and create made up uris of the form perhaps
java:{version}:package or something for class names and methods. Or one would
want an java->rdf mapping file, which of course would be easy to write with the
above java urls.
In any case having a quick mapper is what the sommer project I worked on a
while ago was about, and should certainly be useful in many ways.
It is true that with Scala working with RDF is not that problematic: writing
res/FOAF.knows is pretty easy to the eye and to write. Doing the same in java
was realy really really really tedious. So it would be useful to work out when
using scala object notation held an advantage. My guess is that there are
situations where one just receives a java object, and it's going to be a lot
faster to use it, then to go through a graph. That's the case here where I get
a build X509 certifiate from the OS. Perhaps that is just really a rare case.
Perhaps it's worth listing those cases where we think it might be useful
anyway. It may be that we are mostly mistaken there....
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira