Story #12071

As Roger I want to serialize RDF graphs in different formats (Trutle, RDF/XML)

Added by Jochen Rau over 2 years ago. Updated over 2 years ago.

Status:Accepted Start date:2011-01-10
Priority:Should have Due date:
Assignee:- % Done:

0%

Category:-
Target version:-
Sprint: Tags:
Branch:
Story points-
Velocity based estimate-
Remaining hours
Votes: 0

History

Updated by Thomas Maroschik over 2 years ago

Yesterday I talked to Nico about some Common Serializer Interface and an Abstract Class like the Zend Framework has --> http://framework.zend.com/code/listing.php?repname=Zend+Framework&path=%2Ftrunk%2Flibrary%2FZend%2FSerializer%2FAdapter%2F&#ae14ee7b2740c98278c4c321f2c73934b

Updated by Thomas Maroschik over 2 years ago

I think we have to split this story into two individual stories.

You have on the one side the serialization of domain model instances on the other side raw triples.

My suggestion is to handle triples as arrays/collections regarding performance instead of real triple statement objects. So in the first step to get out a serialized domain model instance, it should be first converted into a triple collection and then into a graph format like N3, Turtle, whatever. This way you first serialized the structure and then the representation.

We should make some performance benchmarking of arrays vs objects.

Updated by Thomas Maroschik over 2 years ago

The performance measurements between arrays and objects has been done in #12064.

I just slept some days over some common serializer pattern.

You will have 2 usecases for this serializer:

  • Serialize a Triple/RDF Graph (I'm thinking of some sort of ObjectStorge for Triples with extended filtering/traversing methods)
  • Serialize an object

I talked already with Sebastian about a commont resolver pattern like with requests/response. This is meant in the way of further inversion of control. The matter in question should just call something like a serializer resolver, that finds a serializer which matches the given triple/graph/object and the desired (configured, not hard coded) output.

Updated by Jochen Rau over 2 years ago

I agree that we have to add an additional story like "I want to be able to convert an Object Graph into an RDF Graph", where a graph is the set of resulting triples. This story is not covered by this issue.

The RDF Graph is an Aggregate Root and represents a collection of Statements (Triples). I think we have to handle these triples in an array for performance reasons and convert them into Objects only if needed.

I suggest to use either the Adapter Patter or the Strategy Pattern for the different Serializer implementations. A Serializer takes a Graph object and handles serializes the contained triples (without converting them into objects). It would be nice, if the serialization format could be defined using Fluid.

Also available in: Atom PDF