- From: Simon Spero <sesuncedu@gmail.com>
- Date: Sun, 6 Jul 2014 16:36:20 -0400
- To: Victor Porton <porton@narod.ru>
- Cc: semantic-web@w3.org, Tim Berners-Lee <timbl@w3.org>, Paul Tyson <phtyson@sbcglobal.net>
Received on Sunday, 6 July 2014 20:36:47 UTC
On Jul 6, 2014 4:08 PM, "Victor Porton" <porton@narod.ru> 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 structure). 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. [1] http://www.ada-auth.org/standards/12rm/html/RM-A-18-10.html [2] http://www.adaic.org/resources/add_content/standards/12rm/html/RM-A-18-32.html
Received on Sunday, 6 July 2014 20:36:47 UTC