searchForTerm static method

Iterable<MeSHDataNode> searchForTerm(
  1. String value, {
  2. int limit = 0,
  3. int offset = 0,
})

Implementation

static Iterable<MeSHDataNode> searchForTerm(
  String value, {
  int limit = 0,
  int offset = 0,
}) {
  final terms = _db!.searchTermsByValue(value, limit: limit, offset: offset);
  return terms.map<MeSHDataNode>((term) {
    switch (term.item2.termType) {
      case NTripleTermType.iri:
        return MeSHDataIriNode(uuid: term.item1, iri: term.item2.value);
      case NTripleTermType.literal:
        return MeSHDataLiteralNode(
          uuid: term.item1,
          value: term.item2.value,
          dataType: term.item2.dataType,
          languageTag: term.item2.languageTag,
        );
      case NTripleTermType.blankNode:
        return MeSHDataBlankNode(uuid: term.item1, value: term.item2.value);
      case null:
        throw "termType is null for $term";
    }
  });
}