class_docstr: This class extract relations, objects or triplets from Wikidata HDT file.
class_docstr_tok: ["This","class","extract","relations",",","objects","or","triplets","from","Wikidata","HDT","file","."]
code: def parse_triplets(self, entity):
      triplets = self.document.get(entity, {})
      for direction in ["forw", "backw"]:
          if direction in triplets:
              dir_triplets = triplets[direction]
              dir_triplets = self.uncompress(dir_triplets)
              if entity in self.parsed_document:
                  self.parsed_document[entity][direction] = dir_triplets
              else:
                  self.parsed_document[entity] = {
                      direction: dir_triplets
                  }
  
imports: import datetime
  import re
  from collections import namedtuple
  from logging import getLogger
  from typing import List, Tuple, Dict, Any, Union
  from hdt import HDTDocument
  from deeppavlov.core.commands.utils import expand_path
  from deeppavlov.core.common.file import load_pickle, read_json
  from deeppavlov.core.common.registry import register
label_desc: Use image node_id 18 for calling the WikiParser obj's underlying member method code with example usage: obj.parse_triplets(entity) without return types