getNodeRelatives static method

Future<Iterable<Tuple2<Relation, Node>>> getNodeRelatives(
  1. MeSHDataNode node
)

Implementation

static Future<Iterable<Tuple2<Relation, Node>>> getNodeRelatives(
  MeSHDataNode node,
) async {
  final results = <Tuple2<Relation, Node>>[];

  results.addAll(
    _db!.getSubjectsAndPredicates(node.uuid, limit: 50).map(
          (sp) => _relativesFromNSPO(
            node,
            subjectUuid: sp.item1,
            predicateUuid: sp.item2,
          ),
        ),
  );

  results.addAll(
    _db!.getPredicatesAndObjects(node.uuid, limit: 50).map(
          (po) => _relativesFromNSPO(
            node,
            predicateUuid: po.item1,
            objectUuid: po.item2,
          ),
        ),
  );

  return results;
}