def valid_object(self, obj):
    """Should a slot with this object be turned into a triple."""
    if obj is None and FLAGS.skip_empty_objects:
      return False
    elif not self.is_wikidata_entity(obj) and FLAGS.skip_nonentity_objects:
      return False
    elif FLAGS.skip_categories and isinstance(obj, sling.Frame):
      if obj.id not in self.ancestor_type_ids_cache:
        self.ancestor_type_ids_cache[obj.id] = [
            x.id for x in self.ancestor_types(obj)]
      anc_ids = self.ancestor_type_ids_cache[obj.id]
      if WIKIMEDIA_CATEGORY_TYPE_ID in anc_ids:
        return False
    return True
Should a slot with this object be turned into a triple.
language/templama/sling2facts.py