# Copyright (C) 2005-2024 Splunk Inc. All Rights Reserved. from itsi_py3 import _ import ITOA.itoa_common as utils from ITOA.setup_logging import logger from ITOA.itoa_object import ItoaObject, CRUDMethodTypes from ITOA.itoa_exceptions import ItoaValidationError from ITOA.controller_utils import ITOAError from .itsi_entity import ItsiEntity from ITOA.setup_logging import InstrumentCall class ItsiEntityRelationship(ItoaObject): """ Implements ITSI entity relationship """ collection_name = 'itsi_entity_relationships' itoa_object_type = 'entity_relationship' triple_fields = ['subject_identifier', 'object_identifier', 'predicate'] def __init__(self, session_key, current_user_name): super(ItsiEntityRelationship, self).__init__( session_key, current_user_name, self.itoa_object_type, collection_name=self.collection_name, title_validation_required=False ) def ensure_required_fields(self, objects): """ Modify the objects passed in by reference to ensure they have the system generated required fields Update the specific fields for create, update and batch_save @type objects: list[dict] @param objects: list of dict @return: None """ # By default, itoa object has mod_source and mod_timestamp fields. # But for entity relationship data type, we want to have them as a dict nested inside a list named as "mod", # for example: # { # "mod": [{ # "mod_source": , # "mod_timestamp":