From 28451d9ed473b31d97a958f0783048056322d396 Mon Sep 17 00:00:00 2001 From: Leo Simons Date: Sat, 8 Apr 2023 16:54:41 +0200 Subject: [PATCH 1/2] feat: add TLMD hr data loading --- .../loader/__snapshots__/tlmd.test.ts.snap | 3734 +++++++++++++++++ packages/tlm-core-db/test/loader/tlmd.test.ts | 8 +- .../test/loader/tlmd/005-sample-hr-data.tlmd | 56 + 3 files changed, 3796 insertions(+), 2 deletions(-) create mode 100644 packages/tlm-core-db/test/loader/tlmd/005-sample-hr-data.tlmd diff --git a/packages/tlm-core-db/test/loader/__snapshots__/tlmd.test.ts.snap b/packages/tlm-core-db/test/loader/__snapshots__/tlmd.test.ts.snap index 272acf1..befaf5c 100644 --- a/packages/tlm-core-db/test/loader/__snapshots__/tlmd.test.ts.snap +++ b/packages/tlm-core-db/test/loader/__snapshots__/tlmd.test.ts.snap @@ -6732,3 +6732,3737 @@ Modeler { }, } `; + +exports[`TlmdLoader test 005-sample-hr-data 1`] = ` +Modeler { + "_initialized": true, + "_linkModel": LinkModel { + "_initialized": true, + "_linkMapCache": undefined, + "_links": [ + TlmLink { + "_description": "The type this link belongs to.", + "_fromName": "", + "_fromType": 53, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "from type", + "_oid": 54, + "_toName": "", + "_toType": 4, + "_type": 53, + }, + TlmLink { + "_description": "The type this link points to.", + "_fromName": "", + "_fromType": 53, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "to type", + "_oid": 55, + "_toName": "", + "_toType": 4, + "_type": 53, + }, + TlmLink { + "_description": "The name of the link.", + "_fromName": "", + "_fromType": 53, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": true, + "_name": "name", + "_oid": 56, + "_toName": "", + "_toType": 44, + "_type": 53, + }, + TlmLink { + "_description": "The name for the link for the "from" type.", + "_fromName": "", + "_fromType": 53, + "_isMandatory": false, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": true, + "_name": "from name", + "_oid": 57, + "_toName": "", + "_toType": 16, + "_type": 53, + }, + TlmLink { + "_description": "The name for the link for the "to" type.", + "_fromName": "", + "_fromType": 53, + "_isMandatory": false, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": true, + "_name": "to name", + "_oid": 58, + "_toName": "", + "_toType": 16, + "_type": 53, + }, + TlmLink { + "_description": "Whether there can be a single link like this for the "from" type.", + "_fromName": "", + "_fromType": 53, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": true, + "_isValue": true, + "_name": "is singular", + "_oid": 59, + "_toName": "", + "_toType": 7, + "_type": 53, + }, + TlmLink { + "_description": "Whether there has to be a value for the "from" type.", + "_fromName": "", + "_fromType": 53, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": true, + "_isValue": true, + "_name": "is mandatory", + "_oid": 60, + "_toName": "", + "_toType": 7, + "_type": 53, + }, + TlmLink { + "_description": "Whether this is a simple boolean link.", + "_fromName": "", + "_fromType": 53, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": true, + "_isValue": true, + "_name": "is toggle", + "_oid": 61, + "_toName": "", + "_toType": 7, + "_type": 53, + }, + TlmLink { + "_description": "Whether this link is to a ValueType.", + "_fromName": "", + "_fromType": 53, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": true, + "_isValue": true, + "_name": "is value", + "_oid": 62, + "_toName": "", + "_toType": 7, + "_type": 53, + }, + TlmLink { + "_description": "Whether this link is to a primary identifier.", + "_fromName": "", + "_fromType": 53, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": true, + "_isValue": true, + "_name": "is primary id", + "_oid": 63, + "_toName": "", + "_toType": 7, + "_type": 53, + }, + TlmLink { + "_description": "Shorthand identifier for the Namespace. Must be valid XML namespace prefix, i.e. match [a-z0-9]+.", + "_fromName": "", + "_fromType": 3, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": true, + "_name": "prefix", + "_oid": 64, + "_toName": "", + "_toType": 45, + "_type": 53, + }, + TlmLink { + "_description": "Friendly human-readable description of the Namespace.", + "_fromName": "", + "_fromType": 3, + "_isMandatory": false, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": true, + "_name": "description", + "_oid": 65, + "_toName": "", + "_toType": 16, + "_type": 53, + }, + TlmLink { + "_description": "The Type of the Object itself.", + "_fromName": "", + "_fromType": 4, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "type", + "_oid": 66, + "_toName": "", + "_toType": 4, + "_type": 53, + }, + TlmLink { + "_description": "The namespace this Type belongs to.", + "_fromName": "", + "_fromType": 4, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "namespace", + "_oid": 67, + "_toName": "", + "_toType": 3, + "_type": 53, + }, + TlmLink { + "_description": "The supertype of this Type. It inherits all possible Links from its supertype.", + "_fromName": "", + "_fromType": 4, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "super", + "_oid": 68, + "_toName": "", + "_toType": 4, + "_type": 53, + }, + TlmLink { + "_description": "The name of the Type. Should be unique within a namespace.", + "_fromName": "", + "_fromType": 4, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "name", + "_oid": 69, + "_toName": "", + "_toType": 44, + "_type": 53, + }, + TlmLink { + "_description": "Friendly human-readable description of the Type.", + "_fromName": "", + "_fromType": 4, + "_isMandatory": false, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": true, + "_name": "description", + "_oid": 70, + "_toName": "", + "_toType": 16, + "_type": 53, + }, + TlmLink { + "_description": "The object this fact is about.", + "_fromName": "", + "_fromType": 71, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "subject", + "_oid": 72, + "_toName": "", + "_toType": 4, + "_type": 53, + }, + TlmLink { + "_description": "The kind of fact this is, defined by the kind of Link.", + "_fromName": "", + "_fromType": 71, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "link", + "_oid": 73, + "_toName": "", + "_toType": 53, + "_type": 53, + }, + TlmLink { + "_description": "The target object of this link fact.", + "_fromName": "", + "_fromType": 74, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": false, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "target", + "_oid": 75, + "_toName": "", + "_toType": 4, + "_type": 53, + }, + TlmLink { + "_description": "Whether the specific toggle is set or not for this Object.", + "_fromName": "", + "_fromType": 76, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": true, + "_isValue": true, + "_name": "toggle", + "_oid": 77, + "_toName": "", + "_toType": 7, + "_type": 53, + }, + TlmLink { + "_description": undefined, + "_fromName": undefined, + "_fromType": 1002, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": true, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": true, + "_name": "id", + "_oid": 1003, + "_toName": undefined, + "_toType": 49, + "_type": 53, + }, + TlmLink { + "_description": undefined, + "_fromName": undefined, + "_fromType": 1002, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "name", + "_oid": 1004, + "_toName": undefined, + "_toType": 44, + "_type": 53, + }, + TlmLink { + "_description": undefined, + "_fromName": undefined, + "_fromType": 1002, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": true, + "_isValue": true, + "_name": "coaches", + "_oid": 1005, + "_toName": undefined, + "_toType": 7, + "_type": 53, + }, + TlmLink { + "_description": undefined, + "_fromName": "coachee", + "_fromType": 1002, + "_isMandatory": false, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": false, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "coach", + "_oid": 1006, + "_toName": "coach", + "_toType": 1002, + "_type": 53, + }, + TlmLink { + "_description": undefined, + "_fromName": undefined, + "_fromType": 1007, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": true, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": true, + "_name": "id", + "_oid": 1008, + "_toName": undefined, + "_toType": 49, + "_type": 53, + }, + TlmLink { + "_description": undefined, + "_fromName": undefined, + "_fromType": 1007, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "name", + "_oid": 1009, + "_toName": undefined, + "_toType": 44, + "_type": 53, + }, + TlmLink { + "_description": undefined, + "_fromName": undefined, + "_fromType": 1007, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "manager", + "_oid": 1010, + "_toName": undefined, + "_toType": 1002, + "_type": 53, + }, + TlmLink { + "_description": undefined, + "_fromName": undefined, + "_fromType": 1002, + "_isMandatory": false, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "department", + "_oid": 1011, + "_toName": undefined, + "_toType": 1007, + "_type": 53, + }, + TlmLink { + "_description": undefined, + "_fromName": undefined, + "_fromType": 1012, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": true, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": true, + "_name": "id", + "_oid": 1013, + "_toName": undefined, + "_toType": 49, + "_type": 53, + }, + TlmLink { + "_description": undefined, + "_fromName": undefined, + "_fromType": 1012, + "_isMandatory": false, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "name", + "_oid": 1014, + "_toName": undefined, + "_toType": 44, + "_type": 53, + }, + TlmLink { + "_description": undefined, + "_fromName": undefined, + "_fromType": 1012, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": false, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "lead", + "_oid": 1015, + "_toName": undefined, + "_toType": 1002, + "_type": 53, + }, + TlmLink { + "_description": undefined, + "_fromName": undefined, + "_fromType": 1002, + "_isMandatory": false, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": false, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "team", + "_oid": 1016, + "_toName": undefined, + "_toType": 1012, + "_type": 53, + }, + ], + "_namespaceModel": NamespaceModel { + "_activeNamespace": TlmNamespace { + "_description": undefined, + "_oid": 1001, + "_prefix": "hr", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm-sample-hr/", + }, + "_initialized": true, + "_namespaceMapCache": undefined, + "_namespaces": [ + TlmNamespace { + "_description": "The Core TLM namespace.", + "_oid": 1, + "_prefix": "tlm", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm/", + }, + TlmNamespace { + "_description": "Namespaces for XML Schema DataTypes.", + "_oid": 2, + "_prefix": "xs", + "_type": 3, + "_uri": "http://www.w3.org/2001/XMLSchema", + }, + TlmNamespace { + "_description": undefined, + "_oid": 1001, + "_prefix": "hr", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm-sample-hr/", + }, + ], + "_oidGenerator": OidGenerator { + "_initialized": true, + "_nextOid": 1017, + }, + "_tlmNamespace": TlmNamespace { + "_description": "The Core TLM namespace.", + "_oid": 1, + "_prefix": "tlm", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm/", + }, + "_xsNamespace": TlmNamespace { + "_description": "Namespaces for XML Schema DataTypes.", + "_oid": 2, + "_prefix": "xs", + "_type": 3, + "_uri": "http://www.w3.org/2001/XMLSchema", + }, + }, + "_oidGenerator": OidGenerator { + "_initialized": true, + "_nextOid": 1017, + }, + "_typeModel": TypeModel { + "_initialized": true, + "_namespaceModel": NamespaceModel { + "_activeNamespace": TlmNamespace { + "_description": undefined, + "_oid": 1001, + "_prefix": "hr", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm-sample-hr/", + }, + "_initialized": true, + "_namespaceMapCache": undefined, + "_namespaces": [ + TlmNamespace { + "_description": "The Core TLM namespace.", + "_oid": 1, + "_prefix": "tlm", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm/", + }, + TlmNamespace { + "_description": "Namespaces for XML Schema DataTypes.", + "_oid": 2, + "_prefix": "xs", + "_type": 3, + "_uri": "http://www.w3.org/2001/XMLSchema", + }, + TlmNamespace { + "_description": undefined, + "_oid": 1001, + "_prefix": "hr", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm-sample-hr/", + }, + ], + "_oidGenerator": OidGenerator { + "_initialized": true, + "_nextOid": 1017, + }, + "_tlmNamespace": TlmNamespace { + "_description": "The Core TLM namespace.", + "_oid": 1, + "_prefix": "tlm", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm/", + }, + "_xsNamespace": TlmNamespace { + "_description": "Namespaces for XML Schema DataTypes.", + "_oid": 2, + "_prefix": "xs", + "_type": 3, + "_uri": "http://www.w3.org/2001/XMLSchema", + }, + }, + "_oidGenerator": OidGenerator { + "_initialized": true, + "_nextOid": 1017, + }, + "_typeMapCache": undefined, + "_types": [ + TlmType { + "_description": "The special Type for Namespaces.", + "_name": "Namespace", + "_namespace": 1, + "_oid": 3, + "_plural": undefined, + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "The special Type for Types (the meta-Type).", + "_name": "Type", + "_namespace": 1, + "_oid": 4, + "_plural": undefined, + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "Simple kind of Object that is a simple primitive value.", + "_name": "ValueType", + "_namespace": 1, + "_oid": 5, + "_plural": undefined, + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible value.", + "_name": "DataType", + "_namespace": 2, + "_oid": 6, + "_plural": undefined, + "_superType": 5, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible boolean.", + "_name": "boolean", + "_namespace": 2, + "_oid": 7, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible float.", + "_name": "float", + "_namespace": 2, + "_oid": 8, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible double.", + "_name": "double", + "_namespace": 2, + "_oid": 9, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible decimal.", + "_name": "decimal", + "_namespace": 2, + "_oid": 10, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible integer.", + "_name": "integer", + "_namespace": 2, + "_oid": 11, + "_plural": undefined, + "_superType": 10, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible long.", + "_name": "long", + "_namespace": 2, + "_oid": 12, + "_plural": undefined, + "_superType": 11, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible int.", + "_name": "int", + "_namespace": 2, + "_oid": 13, + "_plural": undefined, + "_superType": 12, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible short.", + "_name": "short", + "_namespace": 2, + "_oid": 14, + "_plural": undefined, + "_superType": 13, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible byte.", + "_name": "byte", + "_namespace": 2, + "_oid": 15, + "_plural": undefined, + "_superType": 14, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible string.", + "_name": "string", + "_namespace": 2, + "_oid": 16, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible anyURI.", + "_name": "anyURI", + "_namespace": 2, + "_oid": 17, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible duration.", + "_name": "duration", + "_namespace": 2, + "_oid": 18, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible dateTime.", + "_name": "dateTime", + "_namespace": 2, + "_oid": 19, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible time.", + "_name": "time", + "_namespace": 2, + "_oid": 20, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible date.", + "_name": "date", + "_namespace": 2, + "_oid": 21, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible date.", + "_name": "gYearMonth", + "_namespace": 2, + "_oid": 22, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible gYear.", + "_name": "gYear", + "_namespace": 2, + "_oid": 23, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible gMonthDay.", + "_name": "gMonthDay", + "_namespace": 2, + "_oid": 24, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible gDay.", + "_name": "gDay", + "_namespace": 2, + "_oid": 25, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible gMonth.", + "_name": "gMonth", + "_namespace": 2, + "_oid": 26, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible dateTimeStamp.", + "_name": "dateTimeStamp", + "_namespace": 2, + "_oid": 27, + "_plural": undefined, + "_superType": 19, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible dayTimeDuration.", + "_name": "dayTimeDuration", + "_namespace": 2, + "_oid": 28, + "_plural": undefined, + "_superType": 18, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible yearMonthDuration.", + "_name": "yearMonthDuration", + "_namespace": 2, + "_oid": 29, + "_plural": undefined, + "_superType": 18, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible base64Binary.", + "_name": "base64Binary", + "_namespace": 2, + "_oid": 30, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible hexBinary.", + "_name": "hexBinary", + "_namespace": 2, + "_oid": 31, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible nonPositiveInteger.", + "_name": "nonPositiveInteger", + "_namespace": 2, + "_oid": 32, + "_plural": undefined, + "_superType": 11, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible negativeInteger.", + "_name": "negativeInteger", + "_namespace": 2, + "_oid": 33, + "_plural": undefined, + "_superType": 32, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible nonNegativeInteger.", + "_name": "nonNegativeInteger", + "_namespace": 2, + "_oid": 34, + "_plural": undefined, + "_superType": 11, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible positiveInteger.", + "_name": "positiveInteger", + "_namespace": 2, + "_oid": 35, + "_plural": undefined, + "_superType": 34, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible unsignedLong.", + "_name": "unsignedLong", + "_namespace": 2, + "_oid": 36, + "_plural": undefined, + "_superType": 34, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible unsignedInt.", + "_name": "unsignedInt", + "_namespace": 2, + "_oid": 37, + "_plural": undefined, + "_superType": 36, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible unsignedShort.", + "_name": "unsignedShort", + "_namespace": 2, + "_oid": 38, + "_plural": undefined, + "_superType": 37, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible unsignedByte.", + "_name": "unsignedByte", + "_namespace": 2, + "_oid": 39, + "_plural": undefined, + "_superType": 38, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible normalizedString.", + "_name": "normalizedString", + "_namespace": 2, + "_oid": 40, + "_plural": undefined, + "_superType": 16, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible token.", + "_name": "token", + "_namespace": 2, + "_oid": 41, + "_plural": undefined, + "_superType": 40, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible language.", + "_name": "language", + "_namespace": 2, + "_oid": 42, + "_plural": undefined, + "_superType": 41, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible NMTOKEN.", + "_name": "NMTOKEN", + "_namespace": 2, + "_oid": 43, + "_plural": undefined, + "_superType": 41, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible Name.", + "_name": "Name", + "_namespace": 2, + "_oid": 44, + "_plural": undefined, + "_superType": 41, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible NCName.", + "_name": "NCName", + "_namespace": 2, + "_oid": 45, + "_plural": undefined, + "_superType": 44, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible IDREF.", + "_name": "IDREF", + "_namespace": 2, + "_oid": 46, + "_plural": undefined, + "_superType": 45, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible ID.", + "_name": "ID", + "_namespace": 2, + "_oid": 47, + "_plural": undefined, + "_superType": 45, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible ENTITY.", + "_name": "ENTITY", + "_namespace": 2, + "_oid": 48, + "_plural": undefined, + "_superType": 45, + "_type": 4, + }, + TlmType { + "_description": "An ASCII uniform resource identifier per RFC3986.", + "_name": "URI", + "_namespace": 1, + "_oid": 49, + "_plural": undefined, + "_superType": 17, + "_type": 4, + }, + TlmType { + "_description": "An ASCII uniform resource locator per WHATWG URL Standard.", + "_name": "URL", + "_namespace": 1, + "_oid": 50, + "_plural": undefined, + "_superType": 49, + "_type": 4, + }, + TlmType { + "_description": "An ASCII uniform resource name per RFC8141.", + "_name": "URN", + "_namespace": 1, + "_oid": 51, + "_plural": undefined, + "_superType": 49, + "_type": 4, + }, + TlmType { + "_description": "An ASCII universally unique identifier per RFC4122.", + "_name": "UUID", + "_namespace": 1, + "_oid": 52, + "_plural": undefined, + "_superType": 51, + "_type": 4, + }, + TlmType { + "_description": "A relation between types.", + "_name": "Link", + "_namespace": 1, + "_oid": 53, + "_plural": undefined, + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "A statement about an identified Object in the world considered to be true.", + "_name": "Fact", + "_namespace": 1, + "_oid": 71, + "_plural": undefined, + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "A fact about an object its relation to another object.", + "_name": "LinkFact", + "_namespace": 1, + "_oid": 74, + "_plural": undefined, + "_superType": 71, + "_type": 4, + }, + TlmType { + "_description": "A fact about an object that is either true (defined) or false (absent).", + "_name": "ToggleFact", + "_namespace": 1, + "_oid": 76, + "_plural": undefined, + "_superType": 71, + "_type": 4, + }, + TlmType { + "_description": "A fact about an object that has as its target a primitive value.", + "_name": "ValueFact", + "_namespace": 1, + "_oid": 78, + "_plural": undefined, + "_superType": 74, + "_type": 4, + }, + TlmType { + "_description": "being regarded as an individual", + "_name": "Person", + "_namespace": 1001, + "_oid": 1002, + "_plural": "People", + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "division of an organization", + "_name": "Department", + "_namespace": 1001, + "_oid": 1007, + "_plural": "Departments", + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "group of several people associated together", + "_name": "Team", + "_namespace": 1001, + "_oid": 1012, + "_plural": "Teams", + "_superType": 4, + "_type": 4, + }, + ], + }, + }, + "_namespaceModel": NamespaceModel { + "_activeNamespace": TlmNamespace { + "_description": undefined, + "_oid": 1001, + "_prefix": "hr", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm-sample-hr/", + }, + "_initialized": true, + "_namespaceMapCache": undefined, + "_namespaces": [ + TlmNamespace { + "_description": "The Core TLM namespace.", + "_oid": 1, + "_prefix": "tlm", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm/", + }, + TlmNamespace { + "_description": "Namespaces for XML Schema DataTypes.", + "_oid": 2, + "_prefix": "xs", + "_type": 3, + "_uri": "http://www.w3.org/2001/XMLSchema", + }, + TlmNamespace { + "_description": undefined, + "_oid": 1001, + "_prefix": "hr", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm-sample-hr/", + }, + ], + "_oidGenerator": OidGenerator { + "_initialized": true, + "_nextOid": 1017, + }, + "_tlmNamespace": TlmNamespace { + "_description": "The Core TLM namespace.", + "_oid": 1, + "_prefix": "tlm", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm/", + }, + "_xsNamespace": TlmNamespace { + "_description": "Namespaces for XML Schema DataTypes.", + "_oid": 2, + "_prefix": "xs", + "_type": 3, + "_uri": "http://www.w3.org/2001/XMLSchema", + }, + }, + "_oidGenerator": OidGenerator { + "_initialized": true, + "_nextOid": 1017, + }, + "_statementProcessors": [ + /\\\\s\\*An\\?\\\\s\\+\\(\\?\\[a-z0-9_-\\]\\+\\)\\(\\?:\\\\s\\*,\\\\s\\*the\\\\s\\+\\(\\?\\[a-z0-9_-\\]\\+\\)\\\\s\\*,\\)\\?\\\\s\\+\\(\\?is\\\\sidentified\\\\sby\\|has\\\\s\\+exactly\\\\s\\+one\\|has\\\\s\\+at\\\\s\\+most\\\\s\\+one\\|has\\\\s\\+at\\\\s\\+least\\\\s\\+one\\|can\\\\s\\+have\\\\s\\+some\\)\\\\s\\+\\(\\?\\[a-z0-9_-\\]\\+\\)\\\\s\\+\\(\\?:each\\\\s\\+of\\\\s\\+\\)\\?which\\\\s\\+must\\\\s\\+be\\\\s\\+an\\?\\\\s\\+\\(\\?\\[a-z0-9_-\\]\\+\\)\\\\s\\*\\(\\?:,\\\\s\\*the\\\\s\\+\\(\\?\\[a-z0-9_-\\]\\+\\)\\\\s\\*\\)\\?\\\\\\.\\?\\\\s\\*/i, + [Function], + /\\\\s\\*An\\?\\\\s\\+\\(\\[a-z0-9_-\\]\\+\\)\\\\s\\+\\(is\\\\s\\+exactly\\\\s\\+one\\|must\\\\s\\+be\\\\s\\+a\\)\\\\s\\+\\(\\[a-z0-9_-\\]\\+\\)\\\\s\\+for\\\\s\\+an\\?\\\\s\\+\\(\\[a-z0-9_-\\]\\+\\)\\\\s\\*\\\\\\.\\?\\\\s\\*/i, + [Function], + /\\\\s\\*An\\?\\\\s\\+\\(\\[a-z0-9_-\\]\\+\\)\\\\s\\+has\\\\s\\+toggle\\\\s\\+\\(\\[a-z0-9_-\\]\\+\\)\\\\s\\*\\\\\\.\\?\\\\s\\*/i, + [Function], + /\\\\s\\*An\\?\\\\s\\+\\(\\[a-z0-9_-\\]\\+\\)\\\\s\\+is\\\\s\\+a\\\\s\\+kind\\\\s\\+of\\\\s\\+\\(\\[a-z0-9_-\\]\\+\\)\\\\s\\*\\\\\\.\\?\\\\s\\*/i, + [Function], + /\\\\s\\*An\\?\\\\s\\+\\(\\[a-z0-9_-\\]\\+\\)\\\\s\\+is\\\\s\\+a\\\\s\\+\\(\\?:"\\(\\[\\^"\\]\\+\\)"\\|\\(\\[\\^\\.\\]\\)\\+\\)\\\\s\\*\\\\\\.\\?\\\\s\\*/i, + [Function], + /\\\\s\\*A\\\\s\\+plural\\\\s\\+of\\\\s\\+\\(\\[a-z0-9_-\\]\\+\\)\\\\s\\+is\\\\s\\+\\(\\[a-z0-9_-\\]\\+\\)\\\\s\\*\\\\\\.\\?\\\\s\\*/i, + [Function], + ], + "_typeModel": TypeModel { + "_initialized": true, + "_namespaceModel": NamespaceModel { + "_activeNamespace": TlmNamespace { + "_description": undefined, + "_oid": 1001, + "_prefix": "hr", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm-sample-hr/", + }, + "_initialized": true, + "_namespaceMapCache": undefined, + "_namespaces": [ + TlmNamespace { + "_description": "The Core TLM namespace.", + "_oid": 1, + "_prefix": "tlm", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm/", + }, + TlmNamespace { + "_description": "Namespaces for XML Schema DataTypes.", + "_oid": 2, + "_prefix": "xs", + "_type": 3, + "_uri": "http://www.w3.org/2001/XMLSchema", + }, + TlmNamespace { + "_description": undefined, + "_oid": 1001, + "_prefix": "hr", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm-sample-hr/", + }, + ], + "_oidGenerator": OidGenerator { + "_initialized": true, + "_nextOid": 1017, + }, + "_tlmNamespace": TlmNamespace { + "_description": "The Core TLM namespace.", + "_oid": 1, + "_prefix": "tlm", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm/", + }, + "_xsNamespace": TlmNamespace { + "_description": "Namespaces for XML Schema DataTypes.", + "_oid": 2, + "_prefix": "xs", + "_type": 3, + "_uri": "http://www.w3.org/2001/XMLSchema", + }, + }, + "_oidGenerator": OidGenerator { + "_initialized": true, + "_nextOid": 1017, + }, + "_typeMapCache": undefined, + "_types": [ + TlmType { + "_description": "The special Type for Namespaces.", + "_name": "Namespace", + "_namespace": 1, + "_oid": 3, + "_plural": undefined, + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "The special Type for Types (the meta-Type).", + "_name": "Type", + "_namespace": 1, + "_oid": 4, + "_plural": undefined, + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "Simple kind of Object that is a simple primitive value.", + "_name": "ValueType", + "_namespace": 1, + "_oid": 5, + "_plural": undefined, + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible value.", + "_name": "DataType", + "_namespace": 2, + "_oid": 6, + "_plural": undefined, + "_superType": 5, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible boolean.", + "_name": "boolean", + "_namespace": 2, + "_oid": 7, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible float.", + "_name": "float", + "_namespace": 2, + "_oid": 8, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible double.", + "_name": "double", + "_namespace": 2, + "_oid": 9, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible decimal.", + "_name": "decimal", + "_namespace": 2, + "_oid": 10, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible integer.", + "_name": "integer", + "_namespace": 2, + "_oid": 11, + "_plural": undefined, + "_superType": 10, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible long.", + "_name": "long", + "_namespace": 2, + "_oid": 12, + "_plural": undefined, + "_superType": 11, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible int.", + "_name": "int", + "_namespace": 2, + "_oid": 13, + "_plural": undefined, + "_superType": 12, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible short.", + "_name": "short", + "_namespace": 2, + "_oid": 14, + "_plural": undefined, + "_superType": 13, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible byte.", + "_name": "byte", + "_namespace": 2, + "_oid": 15, + "_plural": undefined, + "_superType": 14, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible string.", + "_name": "string", + "_namespace": 2, + "_oid": 16, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible anyURI.", + "_name": "anyURI", + "_namespace": 2, + "_oid": 17, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible duration.", + "_name": "duration", + "_namespace": 2, + "_oid": 18, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible dateTime.", + "_name": "dateTime", + "_namespace": 2, + "_oid": 19, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible time.", + "_name": "time", + "_namespace": 2, + "_oid": 20, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible date.", + "_name": "date", + "_namespace": 2, + "_oid": 21, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible date.", + "_name": "gYearMonth", + "_namespace": 2, + "_oid": 22, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible gYear.", + "_name": "gYear", + "_namespace": 2, + "_oid": 23, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible gMonthDay.", + "_name": "gMonthDay", + "_namespace": 2, + "_oid": 24, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible gDay.", + "_name": "gDay", + "_namespace": 2, + "_oid": 25, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible gMonth.", + "_name": "gMonth", + "_namespace": 2, + "_oid": 26, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible dateTimeStamp.", + "_name": "dateTimeStamp", + "_namespace": 2, + "_oid": 27, + "_plural": undefined, + "_superType": 19, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible dayTimeDuration.", + "_name": "dayTimeDuration", + "_namespace": 2, + "_oid": 28, + "_plural": undefined, + "_superType": 18, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible yearMonthDuration.", + "_name": "yearMonthDuration", + "_namespace": 2, + "_oid": 29, + "_plural": undefined, + "_superType": 18, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible base64Binary.", + "_name": "base64Binary", + "_namespace": 2, + "_oid": 30, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible hexBinary.", + "_name": "hexBinary", + "_namespace": 2, + "_oid": 31, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible nonPositiveInteger.", + "_name": "nonPositiveInteger", + "_namespace": 2, + "_oid": 32, + "_plural": undefined, + "_superType": 11, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible negativeInteger.", + "_name": "negativeInteger", + "_namespace": 2, + "_oid": 33, + "_plural": undefined, + "_superType": 32, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible nonNegativeInteger.", + "_name": "nonNegativeInteger", + "_namespace": 2, + "_oid": 34, + "_plural": undefined, + "_superType": 11, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible positiveInteger.", + "_name": "positiveInteger", + "_namespace": 2, + "_oid": 35, + "_plural": undefined, + "_superType": 34, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible unsignedLong.", + "_name": "unsignedLong", + "_namespace": 2, + "_oid": 36, + "_plural": undefined, + "_superType": 34, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible unsignedInt.", + "_name": "unsignedInt", + "_namespace": 2, + "_oid": 37, + "_plural": undefined, + "_superType": 36, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible unsignedShort.", + "_name": "unsignedShort", + "_namespace": 2, + "_oid": 38, + "_plural": undefined, + "_superType": 37, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible unsignedByte.", + "_name": "unsignedByte", + "_namespace": 2, + "_oid": 39, + "_plural": undefined, + "_superType": 38, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible normalizedString.", + "_name": "normalizedString", + "_namespace": 2, + "_oid": 40, + "_plural": undefined, + "_superType": 16, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible token.", + "_name": "token", + "_namespace": 2, + "_oid": 41, + "_plural": undefined, + "_superType": 40, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible language.", + "_name": "language", + "_namespace": 2, + "_oid": 42, + "_plural": undefined, + "_superType": 41, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible NMTOKEN.", + "_name": "NMTOKEN", + "_namespace": 2, + "_oid": 43, + "_plural": undefined, + "_superType": 41, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible Name.", + "_name": "Name", + "_namespace": 2, + "_oid": 44, + "_plural": undefined, + "_superType": 41, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible NCName.", + "_name": "NCName", + "_namespace": 2, + "_oid": 45, + "_plural": undefined, + "_superType": 44, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible IDREF.", + "_name": "IDREF", + "_namespace": 2, + "_oid": 46, + "_plural": undefined, + "_superType": 45, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible ID.", + "_name": "ID", + "_namespace": 2, + "_oid": 47, + "_plural": undefined, + "_superType": 45, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible ENTITY.", + "_name": "ENTITY", + "_namespace": 2, + "_oid": 48, + "_plural": undefined, + "_superType": 45, + "_type": 4, + }, + TlmType { + "_description": "An ASCII uniform resource identifier per RFC3986.", + "_name": "URI", + "_namespace": 1, + "_oid": 49, + "_plural": undefined, + "_superType": 17, + "_type": 4, + }, + TlmType { + "_description": "An ASCII uniform resource locator per WHATWG URL Standard.", + "_name": "URL", + "_namespace": 1, + "_oid": 50, + "_plural": undefined, + "_superType": 49, + "_type": 4, + }, + TlmType { + "_description": "An ASCII uniform resource name per RFC8141.", + "_name": "URN", + "_namespace": 1, + "_oid": 51, + "_plural": undefined, + "_superType": 49, + "_type": 4, + }, + TlmType { + "_description": "An ASCII universally unique identifier per RFC4122.", + "_name": "UUID", + "_namespace": 1, + "_oid": 52, + "_plural": undefined, + "_superType": 51, + "_type": 4, + }, + TlmType { + "_description": "A relation between types.", + "_name": "Link", + "_namespace": 1, + "_oid": 53, + "_plural": undefined, + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "A statement about an identified Object in the world considered to be true.", + "_name": "Fact", + "_namespace": 1, + "_oid": 71, + "_plural": undefined, + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "A fact about an object its relation to another object.", + "_name": "LinkFact", + "_namespace": 1, + "_oid": 74, + "_plural": undefined, + "_superType": 71, + "_type": 4, + }, + TlmType { + "_description": "A fact about an object that is either true (defined) or false (absent).", + "_name": "ToggleFact", + "_namespace": 1, + "_oid": 76, + "_plural": undefined, + "_superType": 71, + "_type": 4, + }, + TlmType { + "_description": "A fact about an object that has as its target a primitive value.", + "_name": "ValueFact", + "_namespace": 1, + "_oid": 78, + "_plural": undefined, + "_superType": 74, + "_type": 4, + }, + TlmType { + "_description": "being regarded as an individual", + "_name": "Person", + "_namespace": 1001, + "_oid": 1002, + "_plural": "People", + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "division of an organization", + "_name": "Department", + "_namespace": 1001, + "_oid": 1007, + "_plural": "Departments", + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "group of several people associated together", + "_name": "Team", + "_namespace": 1001, + "_oid": 1012, + "_plural": "Teams", + "_superType": 4, + "_type": 4, + }, + ], + }, +} +`; + +exports[`TlmdLoader test 005-sample-hr-data 2`] = ` +Modeler { + "_initialized": true, + "_linkModel": LinkModel { + "_initialized": true, + "_linkMapCache": undefined, + "_links": [ + TlmLink { + "_description": "The type this link belongs to.", + "_fromName": "", + "_fromType": 53, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "from type", + "_oid": 54, + "_toName": "", + "_toType": 4, + "_type": 53, + }, + TlmLink { + "_description": "The type this link points to.", + "_fromName": "", + "_fromType": 53, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "to type", + "_oid": 55, + "_toName": "", + "_toType": 4, + "_type": 53, + }, + TlmLink { + "_description": "The name of the link.", + "_fromName": "", + "_fromType": 53, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": true, + "_name": "name", + "_oid": 56, + "_toName": "", + "_toType": 44, + "_type": 53, + }, + TlmLink { + "_description": "The name for the link for the "from" type.", + "_fromName": "", + "_fromType": 53, + "_isMandatory": false, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": true, + "_name": "from name", + "_oid": 57, + "_toName": "", + "_toType": 16, + "_type": 53, + }, + TlmLink { + "_description": "The name for the link for the "to" type.", + "_fromName": "", + "_fromType": 53, + "_isMandatory": false, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": true, + "_name": "to name", + "_oid": 58, + "_toName": "", + "_toType": 16, + "_type": 53, + }, + TlmLink { + "_description": "Whether there can be a single link like this for the "from" type.", + "_fromName": "", + "_fromType": 53, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": true, + "_isValue": true, + "_name": "is singular", + "_oid": 59, + "_toName": "", + "_toType": 7, + "_type": 53, + }, + TlmLink { + "_description": "Whether there has to be a value for the "from" type.", + "_fromName": "", + "_fromType": 53, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": true, + "_isValue": true, + "_name": "is mandatory", + "_oid": 60, + "_toName": "", + "_toType": 7, + "_type": 53, + }, + TlmLink { + "_description": "Whether this is a simple boolean link.", + "_fromName": "", + "_fromType": 53, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": true, + "_isValue": true, + "_name": "is toggle", + "_oid": 61, + "_toName": "", + "_toType": 7, + "_type": 53, + }, + TlmLink { + "_description": "Whether this link is to a ValueType.", + "_fromName": "", + "_fromType": 53, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": true, + "_isValue": true, + "_name": "is value", + "_oid": 62, + "_toName": "", + "_toType": 7, + "_type": 53, + }, + TlmLink { + "_description": "Whether this link is to a primary identifier.", + "_fromName": "", + "_fromType": 53, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": true, + "_isValue": true, + "_name": "is primary id", + "_oid": 63, + "_toName": "", + "_toType": 7, + "_type": 53, + }, + TlmLink { + "_description": "Shorthand identifier for the Namespace. Must be valid XML namespace prefix, i.e. match [a-z0-9]+.", + "_fromName": "", + "_fromType": 3, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": true, + "_name": "prefix", + "_oid": 64, + "_toName": "", + "_toType": 45, + "_type": 53, + }, + TlmLink { + "_description": "Friendly human-readable description of the Namespace.", + "_fromName": "", + "_fromType": 3, + "_isMandatory": false, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": true, + "_name": "description", + "_oid": 65, + "_toName": "", + "_toType": 16, + "_type": 53, + }, + TlmLink { + "_description": "The Type of the Object itself.", + "_fromName": "", + "_fromType": 4, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "type", + "_oid": 66, + "_toName": "", + "_toType": 4, + "_type": 53, + }, + TlmLink { + "_description": "The namespace this Type belongs to.", + "_fromName": "", + "_fromType": 4, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "namespace", + "_oid": 67, + "_toName": "", + "_toType": 3, + "_type": 53, + }, + TlmLink { + "_description": "The supertype of this Type. It inherits all possible Links from its supertype.", + "_fromName": "", + "_fromType": 4, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "super", + "_oid": 68, + "_toName": "", + "_toType": 4, + "_type": 53, + }, + TlmLink { + "_description": "The name of the Type. Should be unique within a namespace.", + "_fromName": "", + "_fromType": 4, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "name", + "_oid": 69, + "_toName": "", + "_toType": 44, + "_type": 53, + }, + TlmLink { + "_description": "Friendly human-readable description of the Type.", + "_fromName": "", + "_fromType": 4, + "_isMandatory": false, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": true, + "_name": "description", + "_oid": 70, + "_toName": "", + "_toType": 16, + "_type": 53, + }, + TlmLink { + "_description": "The object this fact is about.", + "_fromName": "", + "_fromType": 71, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "subject", + "_oid": 72, + "_toName": "", + "_toType": 4, + "_type": 53, + }, + TlmLink { + "_description": "The kind of fact this is, defined by the kind of Link.", + "_fromName": "", + "_fromType": 71, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "link", + "_oid": 73, + "_toName": "", + "_toType": 53, + "_type": 53, + }, + TlmLink { + "_description": "The target object of this link fact.", + "_fromName": "", + "_fromType": 74, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": false, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "target", + "_oid": 75, + "_toName": "", + "_toType": 4, + "_type": 53, + }, + TlmLink { + "_description": "Whether the specific toggle is set or not for this Object.", + "_fromName": "", + "_fromType": 76, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": true, + "_isValue": true, + "_name": "toggle", + "_oid": 77, + "_toName": "", + "_toType": 7, + "_type": 53, + }, + TlmLink { + "_description": undefined, + "_fromName": undefined, + "_fromType": 1002, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": true, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": true, + "_name": "id", + "_oid": 1003, + "_toName": undefined, + "_toType": 49, + "_type": 53, + }, + TlmLink { + "_description": undefined, + "_fromName": undefined, + "_fromType": 1002, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "name", + "_oid": 1004, + "_toName": undefined, + "_toType": 44, + "_type": 53, + }, + TlmLink { + "_description": undefined, + "_fromName": undefined, + "_fromType": 1002, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": true, + "_isValue": true, + "_name": "coaches", + "_oid": 1005, + "_toName": undefined, + "_toType": 7, + "_type": 53, + }, + TlmLink { + "_description": undefined, + "_fromName": "coachee", + "_fromType": 1002, + "_isMandatory": false, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": false, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "coach", + "_oid": 1006, + "_toName": "coach", + "_toType": 1002, + "_type": 53, + }, + TlmLink { + "_description": undefined, + "_fromName": undefined, + "_fromType": 1007, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": true, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": true, + "_name": "id", + "_oid": 1008, + "_toName": undefined, + "_toType": 49, + "_type": 53, + }, + TlmLink { + "_description": undefined, + "_fromName": undefined, + "_fromType": 1007, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "name", + "_oid": 1009, + "_toName": undefined, + "_toType": 44, + "_type": 53, + }, + TlmLink { + "_description": undefined, + "_fromName": undefined, + "_fromType": 1007, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "manager", + "_oid": 1010, + "_toName": undefined, + "_toType": 1002, + "_type": 53, + }, + TlmLink { + "_description": undefined, + "_fromName": undefined, + "_fromType": 1002, + "_isMandatory": false, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "department", + "_oid": 1011, + "_toName": undefined, + "_toType": 1007, + "_type": 53, + }, + TlmLink { + "_description": undefined, + "_fromName": undefined, + "_fromType": 1012, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": true, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": true, + "_name": "id", + "_oid": 1013, + "_toName": undefined, + "_toType": 49, + "_type": 53, + }, + TlmLink { + "_description": undefined, + "_fromName": undefined, + "_fromType": 1012, + "_isMandatory": false, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": true, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "name", + "_oid": 1014, + "_toName": undefined, + "_toType": 44, + "_type": 53, + }, + TlmLink { + "_description": undefined, + "_fromName": undefined, + "_fromType": 1012, + "_isMandatory": true, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": false, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "lead", + "_oid": 1015, + "_toName": undefined, + "_toType": 1002, + "_type": 53, + }, + TlmLink { + "_description": undefined, + "_fromName": undefined, + "_fromType": 1002, + "_isMandatory": false, + "_isMandatoryTo": false, + "_isPrimaryId": false, + "_isSingular": false, + "_isSingularTo": false, + "_isToggle": false, + "_isValue": false, + "_name": "team", + "_oid": 1016, + "_toName": undefined, + "_toType": 1012, + "_type": 53, + }, + ], + "_namespaceModel": NamespaceModel { + "_activeNamespace": TlmNamespace { + "_description": undefined, + "_oid": 1001, + "_prefix": "hr", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm-sample-hr/", + }, + "_initialized": true, + "_namespaceMapCache": undefined, + "_namespaces": [ + TlmNamespace { + "_description": "The Core TLM namespace.", + "_oid": 1, + "_prefix": "tlm", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm/", + }, + TlmNamespace { + "_description": "Namespaces for XML Schema DataTypes.", + "_oid": 2, + "_prefix": "xs", + "_type": 3, + "_uri": "http://www.w3.org/2001/XMLSchema", + }, + TlmNamespace { + "_description": undefined, + "_oid": 1001, + "_prefix": "hr", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm-sample-hr/", + }, + ], + "_oidGenerator": OidGenerator { + "_initialized": true, + "_nextOid": 1017, + }, + "_tlmNamespace": TlmNamespace { + "_description": "The Core TLM namespace.", + "_oid": 1, + "_prefix": "tlm", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm/", + }, + "_xsNamespace": TlmNamespace { + "_description": "Namespaces for XML Schema DataTypes.", + "_oid": 2, + "_prefix": "xs", + "_type": 3, + "_uri": "http://www.w3.org/2001/XMLSchema", + }, + }, + "_oidGenerator": OidGenerator { + "_initialized": true, + "_nextOid": 1017, + }, + "_typeModel": TypeModel { + "_initialized": true, + "_namespaceModel": NamespaceModel { + "_activeNamespace": TlmNamespace { + "_description": undefined, + "_oid": 1001, + "_prefix": "hr", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm-sample-hr/", + }, + "_initialized": true, + "_namespaceMapCache": undefined, + "_namespaces": [ + TlmNamespace { + "_description": "The Core TLM namespace.", + "_oid": 1, + "_prefix": "tlm", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm/", + }, + TlmNamespace { + "_description": "Namespaces for XML Schema DataTypes.", + "_oid": 2, + "_prefix": "xs", + "_type": 3, + "_uri": "http://www.w3.org/2001/XMLSchema", + }, + TlmNamespace { + "_description": undefined, + "_oid": 1001, + "_prefix": "hr", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm-sample-hr/", + }, + ], + "_oidGenerator": OidGenerator { + "_initialized": true, + "_nextOid": 1017, + }, + "_tlmNamespace": TlmNamespace { + "_description": "The Core TLM namespace.", + "_oid": 1, + "_prefix": "tlm", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm/", + }, + "_xsNamespace": TlmNamespace { + "_description": "Namespaces for XML Schema DataTypes.", + "_oid": 2, + "_prefix": "xs", + "_type": 3, + "_uri": "http://www.w3.org/2001/XMLSchema", + }, + }, + "_oidGenerator": OidGenerator { + "_initialized": true, + "_nextOid": 1017, + }, + "_typeMapCache": undefined, + "_types": [ + TlmType { + "_description": "The special Type for Namespaces.", + "_name": "Namespace", + "_namespace": 1, + "_oid": 3, + "_plural": undefined, + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "The special Type for Types (the meta-Type).", + "_name": "Type", + "_namespace": 1, + "_oid": 4, + "_plural": undefined, + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "Simple kind of Object that is a simple primitive value.", + "_name": "ValueType", + "_namespace": 1, + "_oid": 5, + "_plural": undefined, + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible value.", + "_name": "DataType", + "_namespace": 2, + "_oid": 6, + "_plural": undefined, + "_superType": 5, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible boolean.", + "_name": "boolean", + "_namespace": 2, + "_oid": 7, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible float.", + "_name": "float", + "_namespace": 2, + "_oid": 8, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible double.", + "_name": "double", + "_namespace": 2, + "_oid": 9, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible decimal.", + "_name": "decimal", + "_namespace": 2, + "_oid": 10, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible integer.", + "_name": "integer", + "_namespace": 2, + "_oid": 11, + "_plural": undefined, + "_superType": 10, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible long.", + "_name": "long", + "_namespace": 2, + "_oid": 12, + "_plural": undefined, + "_superType": 11, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible int.", + "_name": "int", + "_namespace": 2, + "_oid": 13, + "_plural": undefined, + "_superType": 12, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible short.", + "_name": "short", + "_namespace": 2, + "_oid": 14, + "_plural": undefined, + "_superType": 13, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible byte.", + "_name": "byte", + "_namespace": 2, + "_oid": 15, + "_plural": undefined, + "_superType": 14, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible string.", + "_name": "string", + "_namespace": 2, + "_oid": 16, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible anyURI.", + "_name": "anyURI", + "_namespace": 2, + "_oid": 17, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible duration.", + "_name": "duration", + "_namespace": 2, + "_oid": 18, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible dateTime.", + "_name": "dateTime", + "_namespace": 2, + "_oid": 19, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible time.", + "_name": "time", + "_namespace": 2, + "_oid": 20, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible date.", + "_name": "date", + "_namespace": 2, + "_oid": 21, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible date.", + "_name": "gYearMonth", + "_namespace": 2, + "_oid": 22, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible gYear.", + "_name": "gYear", + "_namespace": 2, + "_oid": 23, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible gMonthDay.", + "_name": "gMonthDay", + "_namespace": 2, + "_oid": 24, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible gDay.", + "_name": "gDay", + "_namespace": 2, + "_oid": 25, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible gMonth.", + "_name": "gMonth", + "_namespace": 2, + "_oid": 26, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible dateTimeStamp.", + "_name": "dateTimeStamp", + "_namespace": 2, + "_oid": 27, + "_plural": undefined, + "_superType": 19, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible dayTimeDuration.", + "_name": "dayTimeDuration", + "_namespace": 2, + "_oid": 28, + "_plural": undefined, + "_superType": 18, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible yearMonthDuration.", + "_name": "yearMonthDuration", + "_namespace": 2, + "_oid": 29, + "_plural": undefined, + "_superType": 18, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible base64Binary.", + "_name": "base64Binary", + "_namespace": 2, + "_oid": 30, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible hexBinary.", + "_name": "hexBinary", + "_namespace": 2, + "_oid": 31, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible nonPositiveInteger.", + "_name": "nonPositiveInteger", + "_namespace": 2, + "_oid": 32, + "_plural": undefined, + "_superType": 11, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible negativeInteger.", + "_name": "negativeInteger", + "_namespace": 2, + "_oid": 33, + "_plural": undefined, + "_superType": 32, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible nonNegativeInteger.", + "_name": "nonNegativeInteger", + "_namespace": 2, + "_oid": 34, + "_plural": undefined, + "_superType": 11, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible positiveInteger.", + "_name": "positiveInteger", + "_namespace": 2, + "_oid": 35, + "_plural": undefined, + "_superType": 34, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible unsignedLong.", + "_name": "unsignedLong", + "_namespace": 2, + "_oid": 36, + "_plural": undefined, + "_superType": 34, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible unsignedInt.", + "_name": "unsignedInt", + "_namespace": 2, + "_oid": 37, + "_plural": undefined, + "_superType": 36, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible unsignedShort.", + "_name": "unsignedShort", + "_namespace": 2, + "_oid": 38, + "_plural": undefined, + "_superType": 37, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible unsignedByte.", + "_name": "unsignedByte", + "_namespace": 2, + "_oid": 39, + "_plural": undefined, + "_superType": 38, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible normalizedString.", + "_name": "normalizedString", + "_namespace": 2, + "_oid": 40, + "_plural": undefined, + "_superType": 16, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible token.", + "_name": "token", + "_namespace": 2, + "_oid": 41, + "_plural": undefined, + "_superType": 40, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible language.", + "_name": "language", + "_namespace": 2, + "_oid": 42, + "_plural": undefined, + "_superType": 41, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible NMTOKEN.", + "_name": "NMTOKEN", + "_namespace": 2, + "_oid": 43, + "_plural": undefined, + "_superType": 41, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible Name.", + "_name": "Name", + "_namespace": 2, + "_oid": 44, + "_plural": undefined, + "_superType": 41, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible NCName.", + "_name": "NCName", + "_namespace": 2, + "_oid": 45, + "_plural": undefined, + "_superType": 44, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible IDREF.", + "_name": "IDREF", + "_namespace": 2, + "_oid": 46, + "_plural": undefined, + "_superType": 45, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible ID.", + "_name": "ID", + "_namespace": 2, + "_oid": 47, + "_plural": undefined, + "_superType": 45, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible ENTITY.", + "_name": "ENTITY", + "_namespace": 2, + "_oid": 48, + "_plural": undefined, + "_superType": 45, + "_type": 4, + }, + TlmType { + "_description": "An ASCII uniform resource identifier per RFC3986.", + "_name": "URI", + "_namespace": 1, + "_oid": 49, + "_plural": undefined, + "_superType": 17, + "_type": 4, + }, + TlmType { + "_description": "An ASCII uniform resource locator per WHATWG URL Standard.", + "_name": "URL", + "_namespace": 1, + "_oid": 50, + "_plural": undefined, + "_superType": 49, + "_type": 4, + }, + TlmType { + "_description": "An ASCII uniform resource name per RFC8141.", + "_name": "URN", + "_namespace": 1, + "_oid": 51, + "_plural": undefined, + "_superType": 49, + "_type": 4, + }, + TlmType { + "_description": "An ASCII universally unique identifier per RFC4122.", + "_name": "UUID", + "_namespace": 1, + "_oid": 52, + "_plural": undefined, + "_superType": 51, + "_type": 4, + }, + TlmType { + "_description": "A relation between types.", + "_name": "Link", + "_namespace": 1, + "_oid": 53, + "_plural": undefined, + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "A statement about an identified Object in the world considered to be true.", + "_name": "Fact", + "_namespace": 1, + "_oid": 71, + "_plural": undefined, + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "A fact about an object its relation to another object.", + "_name": "LinkFact", + "_namespace": 1, + "_oid": 74, + "_plural": undefined, + "_superType": 71, + "_type": 4, + }, + TlmType { + "_description": "A fact about an object that is either true (defined) or false (absent).", + "_name": "ToggleFact", + "_namespace": 1, + "_oid": 76, + "_plural": undefined, + "_superType": 71, + "_type": 4, + }, + TlmType { + "_description": "A fact about an object that has as its target a primitive value.", + "_name": "ValueFact", + "_namespace": 1, + "_oid": 78, + "_plural": undefined, + "_superType": 74, + "_type": 4, + }, + TlmType { + "_description": "being regarded as an individual", + "_name": "Person", + "_namespace": 1001, + "_oid": 1002, + "_plural": "People", + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "division of an organization", + "_name": "Department", + "_namespace": 1001, + "_oid": 1007, + "_plural": "Departments", + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "group of several people associated together", + "_name": "Team", + "_namespace": 1001, + "_oid": 1012, + "_plural": "Teams", + "_superType": 4, + "_type": 4, + }, + ], + }, + }, + "_namespaceModel": NamespaceModel { + "_activeNamespace": TlmNamespace { + "_description": undefined, + "_oid": 1001, + "_prefix": "hr", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm-sample-hr/", + }, + "_initialized": true, + "_namespaceMapCache": undefined, + "_namespaces": [ + TlmNamespace { + "_description": "The Core TLM namespace.", + "_oid": 1, + "_prefix": "tlm", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm/", + }, + TlmNamespace { + "_description": "Namespaces for XML Schema DataTypes.", + "_oid": 2, + "_prefix": "xs", + "_type": 3, + "_uri": "http://www.w3.org/2001/XMLSchema", + }, + TlmNamespace { + "_description": undefined, + "_oid": 1001, + "_prefix": "hr", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm-sample-hr/", + }, + ], + "_oidGenerator": OidGenerator { + "_initialized": true, + "_nextOid": 1017, + }, + "_tlmNamespace": TlmNamespace { + "_description": "The Core TLM namespace.", + "_oid": 1, + "_prefix": "tlm", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm/", + }, + "_xsNamespace": TlmNamespace { + "_description": "Namespaces for XML Schema DataTypes.", + "_oid": 2, + "_prefix": "xs", + "_type": 3, + "_uri": "http://www.w3.org/2001/XMLSchema", + }, + }, + "_oidGenerator": OidGenerator { + "_initialized": true, + "_nextOid": 1017, + }, + "_statementProcessors": [ + /\\\\s\\*An\\?\\\\s\\+\\(\\?\\[a-z0-9_-\\]\\+\\)\\(\\?:\\\\s\\*,\\\\s\\*the\\\\s\\+\\(\\?\\[a-z0-9_-\\]\\+\\)\\\\s\\*,\\)\\?\\\\s\\+\\(\\?is\\\\sidentified\\\\sby\\|has\\\\s\\+exactly\\\\s\\+one\\|has\\\\s\\+at\\\\s\\+most\\\\s\\+one\\|has\\\\s\\+at\\\\s\\+least\\\\s\\+one\\|can\\\\s\\+have\\\\s\\+some\\)\\\\s\\+\\(\\?\\[a-z0-9_-\\]\\+\\)\\\\s\\+\\(\\?:each\\\\s\\+of\\\\s\\+\\)\\?which\\\\s\\+must\\\\s\\+be\\\\s\\+an\\?\\\\s\\+\\(\\?\\[a-z0-9_-\\]\\+\\)\\\\s\\*\\(\\?:,\\\\s\\*the\\\\s\\+\\(\\?\\[a-z0-9_-\\]\\+\\)\\\\s\\*\\)\\?\\\\\\.\\?\\\\s\\*/i, + [Function], + /\\\\s\\*An\\?\\\\s\\+\\(\\[a-z0-9_-\\]\\+\\)\\\\s\\+\\(is\\\\s\\+exactly\\\\s\\+one\\|must\\\\s\\+be\\\\s\\+a\\)\\\\s\\+\\(\\[a-z0-9_-\\]\\+\\)\\\\s\\+for\\\\s\\+an\\?\\\\s\\+\\(\\[a-z0-9_-\\]\\+\\)\\\\s\\*\\\\\\.\\?\\\\s\\*/i, + [Function], + /\\\\s\\*An\\?\\\\s\\+\\(\\[a-z0-9_-\\]\\+\\)\\\\s\\+has\\\\s\\+toggle\\\\s\\+\\(\\[a-z0-9_-\\]\\+\\)\\\\s\\*\\\\\\.\\?\\\\s\\*/i, + [Function], + /\\\\s\\*An\\?\\\\s\\+\\(\\[a-z0-9_-\\]\\+\\)\\\\s\\+is\\\\s\\+a\\\\s\\+kind\\\\s\\+of\\\\s\\+\\(\\[a-z0-9_-\\]\\+\\)\\\\s\\*\\\\\\.\\?\\\\s\\*/i, + [Function], + /\\\\s\\*An\\?\\\\s\\+\\(\\[a-z0-9_-\\]\\+\\)\\\\s\\+is\\\\s\\+a\\\\s\\+\\(\\?:"\\(\\[\\^"\\]\\+\\)"\\|\\(\\[\\^\\.\\]\\)\\+\\)\\\\s\\*\\\\\\.\\?\\\\s\\*/i, + [Function], + /\\\\s\\*A\\\\s\\+plural\\\\s\\+of\\\\s\\+\\(\\[a-z0-9_-\\]\\+\\)\\\\s\\+is\\\\s\\+\\(\\[a-z0-9_-\\]\\+\\)\\\\s\\*\\\\\\.\\?\\\\s\\*/i, + [Function], + ], + "_typeModel": TypeModel { + "_initialized": true, + "_namespaceModel": NamespaceModel { + "_activeNamespace": TlmNamespace { + "_description": undefined, + "_oid": 1001, + "_prefix": "hr", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm-sample-hr/", + }, + "_initialized": true, + "_namespaceMapCache": undefined, + "_namespaces": [ + TlmNamespace { + "_description": "The Core TLM namespace.", + "_oid": 1, + "_prefix": "tlm", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm/", + }, + TlmNamespace { + "_description": "Namespaces for XML Schema DataTypes.", + "_oid": 2, + "_prefix": "xs", + "_type": 3, + "_uri": "http://www.w3.org/2001/XMLSchema", + }, + TlmNamespace { + "_description": undefined, + "_oid": 1001, + "_prefix": "hr", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm-sample-hr/", + }, + ], + "_oidGenerator": OidGenerator { + "_initialized": true, + "_nextOid": 1017, + }, + "_tlmNamespace": TlmNamespace { + "_description": "The Core TLM namespace.", + "_oid": 1, + "_prefix": "tlm", + "_type": 3, + "_uri": "https://type.link.model.tools/ns/tlm/", + }, + "_xsNamespace": TlmNamespace { + "_description": "Namespaces for XML Schema DataTypes.", + "_oid": 2, + "_prefix": "xs", + "_type": 3, + "_uri": "http://www.w3.org/2001/XMLSchema", + }, + }, + "_oidGenerator": OidGenerator { + "_initialized": true, + "_nextOid": 1017, + }, + "_typeMapCache": undefined, + "_types": [ + TlmType { + "_description": "The special Type for Namespaces.", + "_name": "Namespace", + "_namespace": 1, + "_oid": 3, + "_plural": undefined, + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "The special Type for Types (the meta-Type).", + "_name": "Type", + "_namespace": 1, + "_oid": 4, + "_plural": undefined, + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "Simple kind of Object that is a simple primitive value.", + "_name": "ValueType", + "_namespace": 1, + "_oid": 5, + "_plural": undefined, + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible value.", + "_name": "DataType", + "_namespace": 2, + "_oid": 6, + "_plural": undefined, + "_superType": 5, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible boolean.", + "_name": "boolean", + "_namespace": 2, + "_oid": 7, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible float.", + "_name": "float", + "_namespace": 2, + "_oid": 8, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible double.", + "_name": "double", + "_namespace": 2, + "_oid": 9, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible decimal.", + "_name": "decimal", + "_namespace": 2, + "_oid": 10, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible integer.", + "_name": "integer", + "_namespace": 2, + "_oid": 11, + "_plural": undefined, + "_superType": 10, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible long.", + "_name": "long", + "_namespace": 2, + "_oid": 12, + "_plural": undefined, + "_superType": 11, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible int.", + "_name": "int", + "_namespace": 2, + "_oid": 13, + "_plural": undefined, + "_superType": 12, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible short.", + "_name": "short", + "_namespace": 2, + "_oid": 14, + "_plural": undefined, + "_superType": 13, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible byte.", + "_name": "byte", + "_namespace": 2, + "_oid": 15, + "_plural": undefined, + "_superType": 14, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible string.", + "_name": "string", + "_namespace": 2, + "_oid": 16, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible anyURI.", + "_name": "anyURI", + "_namespace": 2, + "_oid": 17, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible duration.", + "_name": "duration", + "_namespace": 2, + "_oid": 18, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible dateTime.", + "_name": "dateTime", + "_namespace": 2, + "_oid": 19, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible time.", + "_name": "time", + "_namespace": 2, + "_oid": 20, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible date.", + "_name": "date", + "_namespace": 2, + "_oid": 21, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible date.", + "_name": "gYearMonth", + "_namespace": 2, + "_oid": 22, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible gYear.", + "_name": "gYear", + "_namespace": 2, + "_oid": 23, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible gMonthDay.", + "_name": "gMonthDay", + "_namespace": 2, + "_oid": 24, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible gDay.", + "_name": "gDay", + "_namespace": 2, + "_oid": 25, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible gMonth.", + "_name": "gMonth", + "_namespace": 2, + "_oid": 26, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible dateTimeStamp.", + "_name": "dateTimeStamp", + "_namespace": 2, + "_oid": 27, + "_plural": undefined, + "_superType": 19, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible dayTimeDuration.", + "_name": "dayTimeDuration", + "_namespace": 2, + "_oid": 28, + "_plural": undefined, + "_superType": 18, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible yearMonthDuration.", + "_name": "yearMonthDuration", + "_namespace": 2, + "_oid": 29, + "_plural": undefined, + "_superType": 18, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible base64Binary.", + "_name": "base64Binary", + "_namespace": 2, + "_oid": 30, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible hexBinary.", + "_name": "hexBinary", + "_namespace": 2, + "_oid": 31, + "_plural": undefined, + "_superType": 6, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible nonPositiveInteger.", + "_name": "nonPositiveInteger", + "_namespace": 2, + "_oid": 32, + "_plural": undefined, + "_superType": 11, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible negativeInteger.", + "_name": "negativeInteger", + "_namespace": 2, + "_oid": 33, + "_plural": undefined, + "_superType": 32, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible nonNegativeInteger.", + "_name": "nonNegativeInteger", + "_namespace": 2, + "_oid": 34, + "_plural": undefined, + "_superType": 11, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible positiveInteger.", + "_name": "positiveInteger", + "_namespace": 2, + "_oid": 35, + "_plural": undefined, + "_superType": 34, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible unsignedLong.", + "_name": "unsignedLong", + "_namespace": 2, + "_oid": 36, + "_plural": undefined, + "_superType": 34, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible unsignedInt.", + "_name": "unsignedInt", + "_namespace": 2, + "_oid": 37, + "_plural": undefined, + "_superType": 36, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible unsignedShort.", + "_name": "unsignedShort", + "_namespace": 2, + "_oid": 38, + "_plural": undefined, + "_superType": 37, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible unsignedByte.", + "_name": "unsignedByte", + "_namespace": 2, + "_oid": 39, + "_plural": undefined, + "_superType": 38, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible normalizedString.", + "_name": "normalizedString", + "_namespace": 2, + "_oid": 40, + "_plural": undefined, + "_superType": 16, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible token.", + "_name": "token", + "_namespace": 2, + "_oid": 41, + "_plural": undefined, + "_superType": 40, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible language.", + "_name": "language", + "_namespace": 2, + "_oid": 42, + "_plural": undefined, + "_superType": 41, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible NMTOKEN.", + "_name": "NMTOKEN", + "_namespace": 2, + "_oid": 43, + "_plural": undefined, + "_superType": 41, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible Name.", + "_name": "Name", + "_namespace": 2, + "_oid": 44, + "_plural": undefined, + "_superType": 41, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible NCName.", + "_name": "NCName", + "_namespace": 2, + "_oid": 45, + "_plural": undefined, + "_superType": 44, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible IDREF.", + "_name": "IDREF", + "_namespace": 2, + "_oid": 46, + "_plural": undefined, + "_superType": 45, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible ID.", + "_name": "ID", + "_namespace": 2, + "_oid": 47, + "_plural": undefined, + "_superType": 45, + "_type": 4, + }, + TlmType { + "_description": "XML Schema compatible ENTITY.", + "_name": "ENTITY", + "_namespace": 2, + "_oid": 48, + "_plural": undefined, + "_superType": 45, + "_type": 4, + }, + TlmType { + "_description": "An ASCII uniform resource identifier per RFC3986.", + "_name": "URI", + "_namespace": 1, + "_oid": 49, + "_plural": undefined, + "_superType": 17, + "_type": 4, + }, + TlmType { + "_description": "An ASCII uniform resource locator per WHATWG URL Standard.", + "_name": "URL", + "_namespace": 1, + "_oid": 50, + "_plural": undefined, + "_superType": 49, + "_type": 4, + }, + TlmType { + "_description": "An ASCII uniform resource name per RFC8141.", + "_name": "URN", + "_namespace": 1, + "_oid": 51, + "_plural": undefined, + "_superType": 49, + "_type": 4, + }, + TlmType { + "_description": "An ASCII universally unique identifier per RFC4122.", + "_name": "UUID", + "_namespace": 1, + "_oid": 52, + "_plural": undefined, + "_superType": 51, + "_type": 4, + }, + TlmType { + "_description": "A relation between types.", + "_name": "Link", + "_namespace": 1, + "_oid": 53, + "_plural": undefined, + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "A statement about an identified Object in the world considered to be true.", + "_name": "Fact", + "_namespace": 1, + "_oid": 71, + "_plural": undefined, + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "A fact about an object its relation to another object.", + "_name": "LinkFact", + "_namespace": 1, + "_oid": 74, + "_plural": undefined, + "_superType": 71, + "_type": 4, + }, + TlmType { + "_description": "A fact about an object that is either true (defined) or false (absent).", + "_name": "ToggleFact", + "_namespace": 1, + "_oid": 76, + "_plural": undefined, + "_superType": 71, + "_type": 4, + }, + TlmType { + "_description": "A fact about an object that has as its target a primitive value.", + "_name": "ValueFact", + "_namespace": 1, + "_oid": 78, + "_plural": undefined, + "_superType": 74, + "_type": 4, + }, + TlmType { + "_description": "being regarded as an individual", + "_name": "Person", + "_namespace": 1001, + "_oid": 1002, + "_plural": "People", + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "division of an organization", + "_name": "Department", + "_namespace": 1001, + "_oid": 1007, + "_plural": "Departments", + "_superType": 4, + "_type": 4, + }, + TlmType { + "_description": "group of several people associated together", + "_name": "Team", + "_namespace": 1001, + "_oid": 1012, + "_plural": "Teams", + "_superType": 4, + "_type": 4, + }, + ], + }, +} +`; diff --git a/packages/tlm-core-db/test/loader/tlmd.test.ts b/packages/tlm-core-db/test/loader/tlmd.test.ts index ebd21ad..43bacd8 100644 --- a/packages/tlm-core-db/test/loader/tlmd.test.ts +++ b/packages/tlm-core-db/test/loader/tlmd.test.ts @@ -50,8 +50,12 @@ test("TlmdLoader test 004-sample-hr-model", async () => { expect(coach.toType).toBe(personType.oid); }); -async function loadTest(testname: string): Promise { - const modeler = new Modeler(); +test("TlmdLoader test 005-sample-hr-data", async () => { + const modeler = await loadTest("004-sample-hr-model"); + await loadTest("005-sample-hr-data", modeler); +}); + +async function loadTest(testname: string, modeler = new Modeler()): Promise { modeler.initialize(); const loader = new TlmdLoader(modeler, new Reader(), new Searcher(), false, true); const fileName = `${testname}.tlmd`; diff --git a/packages/tlm-core-db/test/loader/tlmd/005-sample-hr-data.tlmd b/packages/tlm-core-db/test/loader/tlmd/005-sample-hr-data.tlmd new file mode 100644 index 0000000..b2a6fa4 --- /dev/null +++ b/packages/tlm-core-db/test/loader/tlmd/005-sample-hr-data.tlmd @@ -0,0 +1,56 @@ +# TLM Data: Example HR Data +Namespace hr: https://type.link.model.tools/ns/tlm-sample-hr/ + +// Typical example of a simple TLMD data file + +--- People +The hr:Person with id mailto:leo@example.com + has name: Leo Simons + has department: mailto:engineering@example.com + has team: + mailto:content-management-eng@example.com + mailto:transcoding-eng@example.com + mailto:eng-management@example.com + +The hr:Person with id mailto:simon@example.com + has name: Simon Lucy + has coach: mailto:dirk@example.com + coaches + has department: mailto:engineering@example.com + has team: + mailto:content-management-eng@example.com + mailto:eng-management@example.com + +The hr:Person with id mailto:dirk@example.com + has name: Dirk van Gulik + coaches + has department: mailto:engineering@example.com + has team: + mailto:eng-management@example.com + + +--- Department +The hr:Department with id mailto:engineering@example.com + has name: Engineering + has manager: mailto:dirk@example.com + +The hr:Department with id mailto:hr@example.com + has name: HR + + +--- Team +The hr:Team with id mailto:content-management-eng@example.com + has name: Content Management Engineering + has lead: + mailto:leo@example.com + +The hr:Team with id mailto:transcoding-eng@example.com + has name: Transcoding Engineering + has lead: + mailto:leo@example.com + +The hr:Team with id mailto:eng-management@example.com + has name: Engineering Management + has lead: + mailto:dirk@example.com + mailto:simon@example.com From 2818dc0f07f62176967bca2fe61dec7ea4a568ef Mon Sep 17 00:00:00 2001 From: Leo Simons Date: Sat, 8 Apr 2023 17:38:26 +0200 Subject: [PATCH 2/2] WIP --- packages/tlm-core-db/src/loader/tlmd.ts | 38 ++++++++++++++++++- packages/tlm-core-model/src/api/modeler.ts | 2 + .../tlm-core-model/src/modeler/modeler.ts | 4 ++ .../test/modeler/modeler.test.ts | 7 ++++ 4 files changed, 50 insertions(+), 1 deletion(-) diff --git a/packages/tlm-core-db/src/loader/tlmd.ts b/packages/tlm-core-db/src/loader/tlmd.ts index ffb4aa3..b2189d6 100644 --- a/packages/tlm-core-db/src/loader/tlmd.ts +++ b/packages/tlm-core-db/src/loader/tlmd.ts @@ -1,4 +1,4 @@ -import { IModeler, Modeler } from "@typelinkmodel/tlm-core-model"; +import { IModeler, Modeler, TlmNamespace, TlmType } from "@typelinkmodel/tlm-core-model"; import { createReadStream, ReadStream } from "fs"; import { createInterface } from "readline"; import { ILoader, IReader, ISearcher } from "../api"; @@ -59,11 +59,16 @@ export class TlmdStreamHandler { private readonly _modeler: IModeler; private readonly _continueOnError: boolean; private readonly _debug: boolean; + private _currentObjectType: TlmType | undefined; + private _currentId: string | undefined; + private _currentNamespace: TlmNamespace | undefined; constructor(modeler: IModeler, continueOnError = false, debug = false) { this._modeler = modeler; this._continueOnError = continueOnError; this._debug = debug; + this._currentObjectType = undefined; + this._currentId = undefined; } public debug(message: string): void { @@ -136,10 +141,41 @@ export class TlmdStreamHandler { public async handleObject(type: string, id: string): Promise { this.debug(`Object: type = '${type}', id = '${id}'`); + const objectType = this._modeler.getTypeByName(type); + if (objectType === undefined) { + throw new Error(`No type registered '${type}', cannot process object using it.`); + } + this._currentObjectType = objectType; + this._currentId = id; + this._currentNamespace = this._modeler.findNamespaceByOid(objectType.namespace); + const links = this._modeler.links[this._currentNamespace.prefix][type]; + let setPrimaryId = false; + for (const [linkName, link] of Object.entries(links)) { + if(link.isPrimaryId) { + // todo this._db.addFact(objectType, link, id); + setPrimaryId = true; + break; + } + } + if (!setPrimaryId) { + throw new Error(`No primary ID registered for type '${type}, so cannot set its id.`); + } } public async handleFact(link: string, value: string): Promise { this.debug(`- fact: link = '${link}', value = '${value}'`); + if (this._currentObjectType === undefined) { + throw new Error('Define object type before adding a fact for it.'); + } + const ns = this._currentNamespace; + if (ns === undefined) { + throw new Error('Define object with namespace before adding a fact for it.'); + } + const linkType = this._modeler.links[ns.prefix][link]; + if (linkType === undefined) { + throw new Error(`Define link type ${link} before adding a fact using it.`); + } + } public async handleToggle(link: string): Promise { diff --git a/packages/tlm-core-model/src/api/modeler.ts b/packages/tlm-core-model/src/api/modeler.ts index 64ff301..e849613 100644 --- a/packages/tlm-core-model/src/api/modeler.ts +++ b/packages/tlm-core-model/src/api/modeler.ts @@ -33,4 +33,6 @@ export interface IModeler { getValueTypeForLink(link: TlmLink): TlmType; getTypeByName(type: string): TlmType; + + findNamespaceByOid(oid: number): TlmNamespace; } diff --git a/packages/tlm-core-model/src/modeler/modeler.ts b/packages/tlm-core-model/src/modeler/modeler.ts index 2670b5e..02f9884 100644 --- a/packages/tlm-core-model/src/modeler/modeler.ts +++ b/packages/tlm-core-model/src/modeler/modeler.ts @@ -127,6 +127,10 @@ export class Modeler implements IModeler { return this._typeModel.typeMap[ns][name]; } + public findNamespaceByOid(oid: number): TlmNamespace { + return this._namespaceModel.findNamespaceByOid(oid); + } + private async processLinkDefinitionStatement( match: RegExpMatchArray ): Promise { diff --git a/packages/tlm-core-model/test/modeler/modeler.test.ts b/packages/tlm-core-model/test/modeler/modeler.test.ts index 47d4038..50637bf 100644 --- a/packages/tlm-core-model/test/modeler/modeler.test.ts +++ b/packages/tlm-core-model/test/modeler/modeler.test.ts @@ -401,6 +401,13 @@ test("getValueTypeForLink: basic usage", async () => { ).toBe("Namespace"); }); +test("findNamespaceByOid: basic usage", async () => { + const modeler: Modeler = new Modeler(); + modeler.initialize(); + const oid = modeler.namespaces.tlm.oid; + expect(modeler.findNamespaceByOid(oid).prefix).toBe(modeler.namespaces.tlm.prefix); +}); + test("processLinkDefinitionStatement: cover unreachable default case", async () => { const modeler: Modeler = new Modeler();