11#ifndef SENZING_SDK_CORE_SZCOREENGINE_HPP
12#define SENZING_SDK_CORE_SZCOREENGINE_HPP
24class SzCoreEnvironment;
40 std::string
AddRecord(
const std::string& dataSourceCode,
41 const std::string& recordID,
42 const std::string& recordDefinition,
43 SzFlags flags = SzAddRecordDefaultFlags)
override;
45 const std::string& recordDefinition,
46 SzFlags flags = SzRecordPreviewDefaultFlags)
override;
48 const std::string& recordID,
49 SzFlags flags = SzDeleteRecordDefaultFlags)
override;
51 const std::string& dataSourceCode,
const std::string& recordID,
52 SzFlags flags = SzReevaluateRecordDefaultFlags)
override;
55 SzFlags flags = SzReevaluateEntityDefaultFlags)
override;
58 const std::string& attributes,
const std::string& searchProfile,
59 SzFlags flags = SzSearchByAttributesDefaultFlags)
override;
61 const std::string& attributes,
62 SzFlags flags = SzSearchByAttributesDefaultFlags)
override;
63 std::string
WhySearch(
const std::string& attributes, int64_t entityID,
64 const std::string& searchProfile =
"",
65 SzFlags flags = SzWhySearchDefaultFlags)
override;
68 SzFlags flags = SzEntityDefaultFlags)
override;
69 std::string
GetEntity(
const std::string& dataSourceCode,
70 const std::string& recordID,
71 SzFlags flags = SzEntityDefaultFlags)
override;
72 std::string
GetRecord(
const std::string& dataSourceCode,
73 const std::string& recordID,
74 SzFlags flags = SzRecordDefaultFlags)
override;
78 SzFlags flags = SzFindInterestingEntitiesDefaultFlags)
override;
80 const std::string& dataSourceCode,
const std::string& recordID,
81 SzFlags flags = SzFindInterestingEntitiesDefaultFlags)
override;
84 int64_t startEntityID, int64_t endEntityID, int32_t maxDegrees,
85 const std::set<int64_t>& avoidEntityIDs = {},
86 const std::set<std::string>& requiredDataSources = {},
87 SzFlags flags = SzFindPathDefaultFlags)
override;
89 const std::string& startDataSourceCode,
const std::string& startRecordID,
90 const std::string& endDataSourceCode,
const std::string& endRecordID,
92 const std::set<std::pair<std::string, std::string>>& avoidRecordKeys = {},
93 const std::set<std::string>& requiredDataSources = {},
94 SzFlags flags = SzFindPathDefaultFlags)
override;
97 const std::set<int64_t>& entityIDs, int32_t maxDegrees,
98 int32_t buildOutDegrees, int32_t buildOutMaxEntities,
99 SzFlags flags = SzFindNetworkDefaultFlags)
override;
101 const std::set<std::pair<std::string, std::string>>& recordKeys,
102 int32_t maxDegrees, int32_t buildOutDegrees, int32_t buildOutMaxEntities,
103 SzFlags flags = SzFindNetworkDefaultFlags)
override;
106 const std::string& dataSourceCode,
const std::string& recordID,
107 SzFlags flags = SzWhyRecordInEntityDefaultFlags)
override;
109 const std::string& recordID1,
110 const std::string& dataSourceCode2,
111 const std::string& recordID2,
112 SzFlags flags = SzWhyRecordsDefaultFlags)
override;
114 SzFlags flags = SzWhyEntitiesDefaultFlags)
override;
116 SzFlags flags = SzHowEntityDefaultFlags)
override;
118 const std::set<std::pair<std::string, std::string>>& recordKeys,
119 SzFlags flags = SzVirtualEntityDefaultFlags)
override;
122 SzFlags flags = SzExportDefaultFlags)
override;
124 const std::string& csvColumnList,
125 SzFlags flags = SzExportDefaultFlags)
override;
130 SzFlags flags = SzRedoDefaultFlags)
override;
150 const std::set<std::pair<std::string, std::string>>& recordKeys);
154 const std::set<std::string>& dataSources);
159 bool destroyed_{
false};
The core Senzing entity-resolution engine.
Definition SzEngine.hpp:28
Core implementation of SzEngine backed by the native Sz_* module.
Definition SzCoreEngine.hpp:27
SzCoreEngine(const SzCoreEngine &)=delete
std::string HowEntity(int64_t entityID, SzFlags flags=SzHowEntityDefaultFlags) override
std::string WhySearch(const std::string &attributes, int64_t entityID, const std::string &searchProfile="", SzFlags flags=SzWhySearchDefaultFlags) override
static std::string EncodeEntityIDs(const std::set< int64_t > &entityIDs)
Encodes a set of entity IDs as {"ENTITIES":[{"ENTITY_ID":n},...]}.
SzCoreEngine(SzCoreEnvironment &env)
Constructs and initializes the native engine module using the owning environment's settings.
std::string ProcessRedoRecord(const std::string &redoRecord, SzFlags flags=SzRedoDefaultFlags) override
std::string WhyEntities(int64_t entityID1, int64_t entityID2, SzFlags flags=SzWhyEntitiesDefaultFlags) override
std::string FindInterestingEntities(const std::string &dataSourceCode, const std::string &recordID, SzFlags flags=SzFindInterestingEntitiesDefaultFlags) override
void CloseExportReport(SzExportHandle exportHandle) override
int64_t CountRedoRecords() override
std::string FindNetwork(const std::set< int64_t > &entityIDs, int32_t maxDegrees, int32_t buildOutDegrees, int32_t buildOutMaxEntities, SzFlags flags=SzFindNetworkDefaultFlags) override
std::string GetStats() override
Returns JSON workload statistics for this engine instance.
std::string ReevaluateEntity(int64_t entityID, SzFlags flags=SzReevaluateEntityDefaultFlags) override
std::string DeleteRecord(const std::string &dataSourceCode, const std::string &recordID, SzFlags flags=SzDeleteRecordDefaultFlags) override
std::string SearchByAttributes(const std::string &attributes, const std::string &searchProfile, SzFlags flags=SzSearchByAttributesDefaultFlags) override
std::string GetRecordPreview(const std::string &recordDefinition, SzFlags flags=SzRecordPreviewDefaultFlags) override
static std::string EncodeRecordKeys(const std::set< std::pair< std::string, std::string > > &recordKeys)
Encodes a set of (dataSource, recordID) keys as {"RECORDS":[{"DATA_SOURCE":..,"RECORD_ID":....
std::string FindPath(int64_t startEntityID, int64_t endEntityID, int32_t maxDegrees, const std::set< int64_t > &avoidEntityIDs={}, const std::set< std::string > &requiredDataSources={}, SzFlags flags=SzFindPathDefaultFlags) override
std::string ReevaluateRecord(const std::string &dataSourceCode, const std::string &recordID, SzFlags flags=SzReevaluateRecordDefaultFlags) override
SzExportHandle ExportJsonEntityReport(SzFlags flags=SzExportDefaultFlags) override
std::string SearchByAttributes(const std::string &attributes, SzFlags flags=SzSearchByAttributesDefaultFlags) override
bool IsDestroyed()
True once the native module has been destroyed.
void PrimeEngine() override
Pre-loads engine resources to reduce first-call latency.
std::string GetEntity(const std::string &dataSourceCode, const std::string &recordID, SzFlags flags=SzEntityDefaultFlags) override
static std::string EncodeDataSources(const std::set< std::string > &dataSources)
Encodes a set of data source codes as {"DATA_SOURCES":[..]}.
void Destroy()
Destroys the native engine module.
std::string AddRecord(const std::string &dataSourceCode, const std::string &recordID, const std::string &recordDefinition, SzFlags flags=SzAddRecordDefaultFlags) override
std::string GetVirtualEntity(const std::set< std::pair< std::string, std::string > > &recordKeys, SzFlags flags=SzVirtualEntityDefaultFlags) override
std::string FetchNext(SzExportHandle exportHandle) override
~SzCoreEngine() override=default
std::string FindInterestingEntities(int64_t entityID, SzFlags flags=SzFindInterestingEntitiesDefaultFlags) override
std::string GetRedoRecord() override
SzExportHandle ExportCsvEntityReport(const std::string &csvColumnList, SzFlags flags=SzExportDefaultFlags) override
std::string WhyRecords(const std::string &dataSourceCode1, const std::string &recordID1, const std::string &dataSourceCode2, const std::string &recordID2, SzFlags flags=SzWhyRecordsDefaultFlags) override
SzCoreEngine & operator=(const SzCoreEngine &)=delete
std::string WhyRecordInEntity(const std::string &dataSourceCode, const std::string &recordID, SzFlags flags=SzWhyRecordInEntityDefaultFlags) override
std::string GetRecord(const std::string &dataSourceCode, const std::string &recordID, SzFlags flags=SzRecordDefaultFlags) override
std::string FindPath(const std::string &startDataSourceCode, const std::string &startRecordID, const std::string &endDataSourceCode, const std::string &endRecordID, int32_t maxDegrees, const std::set< std::pair< std::string, std::string > > &avoidRecordKeys={}, const std::set< std::string > &requiredDataSources={}, SzFlags flags=SzFindPathDefaultFlags) override
std::string FindNetwork(const std::set< std::pair< std::string, std::string > > &recordKeys, int32_t maxDegrees, int32_t buildOutDegrees, int32_t buildOutMaxEntities, SzFlags flags=SzFindNetworkDefaultFlags) override
std::string GetEntity(int64_t entityID, SzFlags flags=SzEntityDefaultFlags) override
Core implementation of SzEnvironment backed by the native libSz modules.
Definition SzCoreEnvironment.hpp:29
Definition SzCoreConfig.hpp:20
std::uintptr_t SzExportHandle
Opaque export-report handle, mirroring the C# IntPtr.
Definition SzEngine.hpp:25