Hi,
Apologies for the late response!
Every link/edge is reified and HGDB stores the links themselves associated with a node. So in terms of performance you can quickly compute all links of a given type associated with a node, but not the node’s “neighbors”.
However, often what happens is that the type of a link determines the type of the neighbor node. In that case, you can just count the links. So say you are interested in neighbors of type T and those neighbors are only linked through a link of type RelatedToT. You can get the count like this then:
graph.count(hg.and(hg.incident(node), hg.type(RelatedToT)))
Otherwise, you do have to iterate and check the type yes. If that becomes a problem, you have the option of create a TargetToTargetIndexer which allows you to index nodes by their neighbors. You can the join/intersect that index with the by type index. The API is clumsy unfortunately, so let me know if you are going that route and have trouble figuring how to do it.
Cheers,
Boris
> --
> You received this message because you are subscribed to the Google Groups "HyperGraphDB" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
hypergraphdb...@googlegroups.com.
> To post to this group, send email to
hyperg...@googlegroups.com.
> Visit this group at
https://groups.google.com/group/hypergraphdb.
> For more options, visit
https://groups.google.com/d/optout.