Open DiellzaElshani opened 2 years ago
ps: to add, a data tree is a graph basically, we just need to explode the information within it.
Have these threes labelled edges? Does this tree have a defined root? Are siblings ordered? As is suggested, a tree is a graph without cycles. Thus, modeling a tree with a graph is straightforward. However, some trees can be modeled in special ways.
@danielhz
Have these threes labelled edges?
Yes, with an identifier in the form of {branch; sub-branch; sub-sub-branch; ... }
:
Does this tree have a defined root?
Not sure what do you mean by defined root, but yes, the label {0}
will always have the source corresponding to the root.
Are siblings ordered?
Yes, see images above.
These trees can be represented with collections or with containers. The following are two ways to represent the two trees in the first figure.
rdf:Seq
:tree1 a bhom:Tree ;
bhom:treeValues [ a rdf:Seq ; rdf:_1 :u1 ; rdf:_2 :u2; rdf:_3 :u3 ; rdf:_4 :u4 ] .
:tree a bhom:Tree ;
bhom:treeValues [ rdf:Seq ;
rdf:_1 [ a rdf:Seq ; rdf:_1 :u1 ; rdf:_2 :u2 ] ;
rdf:_2 [ a rdf:Seq ; rdf:_1 :u3 ; rdf:_2 :u4 ] ] .
rdf:Collection
:tree1 a bhom:Tree ;
bhom:treeValues ( :u1 :u2 :u3 :u4 ) .
:tree a bhom:Tree ;
bhom:threeValues ( ( :u1 :u2 ) ( :u3 :u4 ) ) .
Description:
BHoM allows data tree as input in custom objects, however we did not provide a translation of data trees in RDF. Currently they are translated to Base64JsonSerialized. Is there any way to represent data trees in RDF @danielhz ?