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 check_triplet(self, subj: str, rel: str, obj: str) -> bool:
      if self.file_format == "hdt":
          subj = f"{self.prefixes['entity']}/{subj}"
          rel = f"{self.prefixes['rels']['direct']}/{rel}"
          obj = f"{self.prefixes['entity']}/{obj}"
          triplets, cnt = self.document.search_triples(subj, rel, obj)
          if cnt > 0:
              return True
          else:
              return False
      else:
          subj = subj.split("/")[-1]
          rel = rel.split("/")[-1]
          obj = obj.split("/")[-1]
          triplets = self.document.get(subj, {}).get("forw", [])
          triplets = self.uncompress(triplets)
          for found_rel, *objects in triplets:
              if found_rel == rel:
                  for found_obj in objects:
                      if found_obj == obj:
                          return True
          return False
  
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 14 for calling the WikiParser obj's underlying member method code with example usage: obj.check_triplet(subj, rel, obj) and returns: False, True, False, True