ExCEP. Model. Consistency
(ex_cep v0.1.1)
Copy Markdown
ICD ↔ Simplified JSON Model consistency verifier per CSG CEP TS2.1 Section 9.3:
"设备的ICD模型和简化模型如果同时提供,二者的数据项应具备对应关系一致性。 数据对象的数量、数据对象名、中文语义和数据对象类型应完全一致。"
Summary
Functions
Verifies consistency between an ICD %ExCEP.Model{} and a simplified JSON %ExCEP.Model{}.
Types
@type mismatch() :: {:count_mismatch, non_neg_integer(), non_neg_integer()} | {:missing_in_json, String.t()} | {:missing_in_icd, String.t()} | {:description_mismatch, String.t(), String.t(), String.t()} | {:do_type_mismatch, String.t(), String.t(), String.t()}
Functions
@spec verify(ExCEP.Model.t(), ExCEP.Model.t()) :: :ok | {:error, [mismatch()]}
Verifies consistency between an ICD %ExCEP.Model{} and a simplified JSON %ExCEP.Model{}.
Checks:
- Total number of Data Objects (
DO) matches. - Every DO matches on
DOname(scoped byLDname.LNinst.DOnameorDOname), Chinese semanticdescription, andDOtype(CDC).
Returns :ok or {:error, [mismatch()]}.