Re: Transforming RDF into (non-binary!) trees

On Jul 6, 2014 4:08 PM, "Victor Porton" <> wrote:

> I am planning to use librdf (for which I am going to create Ada bindings)
and it provides me data in plain triples (or quadruples).
> I need to construct a tree from triples.
> Ada probably does not provide a ready tree structure. I am just going to
link together some records (as in a linked list but with a more complex

Ada does indeed provide a multiway tree structure - see [1] - however it is
probably not the right data structure for rdf unless you have a specific
application and a specific schema that is representing entities whose
relationships to each other are tree like.

If that is the case,  then you need to construct the entities by gathering
triples,  and insert them in a tree in the proper order. If you are only
concerned about this specific application then you can optimize based on
the order of triples presented by the data source.

For general rdf graphs,  you need to use a more graph like structure.  See
e.g. [2].

You could  index rdf triples in 3 trees (one each for s, p, o); you could
also use maps.


Received on Sunday, 6 July 2014 20:36:47 UTC