Service - Locations: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 159: | Line 159: | ||
= Translations = | = Translations = | ||
== locationNode = | == locationNode == | ||
* given name of the location, eg: Bangkok | * given name of the location, eg: Bangkok | ||
== locationType = | == locationType == | ||
* description of the type of label, eg: Country | * description of the type of label, eg: Country |
Revision as of 02:08, 18 October 2021
Overview
Manages Location Graph
Repository
https://bitbucket.org/izara-core-locations/izara-core-locations-locations/src/master/
DynamoDB tables
Standard Config Table Per Service
Configuration tags
{
configKey: "LocationsGraphServiceName"
configTag: "LocationsGraphServiceName"
configValue: xxx // eg: "Locations"
}
{
configKey: "TranslationGraphServiceName"
configTag: "TranslationGraphServiceName"
configValue: xxx // eg: "TranslationGraph"
}
Graph database
Service - Locations Graph
Nodes
{
nodeLabel: "{LocationSharedLib.LOCATIONNODE_GRAPH_NODE_LABEL}", // "locationNode"
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
locationNodeId: {
identifier: true, // create unique id from translation and uniqueMessageId (because multiple locationNode can have same translation)
},
},
}
}
{
nodeLabel: "{LocationSharedLib.LOCATIONTYPE_GRAPH_NODE_LABEL}", // "locationType"
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
locationTypeId: {
identifier: true, // create unique id from translation
},
},
}
}
- Want to split eg postcodes for different countries into their own locationTypes, this will mean each has to have a different translation (two cannot be named "Post Code" or they will be considered the same label/use the same locationType node), for now use unique translations for each, but could add another translation as the presentation text, which is not used to identify the type, but when presenting the value
{
nodeLabel: "{LocationSharedLib.LOCATIONLINK_GRAPH_NODE_LABEL}", // "locationLink"
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
locationLinkId: {
identifier: true, // create unique id from parent and child locationNode identifiers, because we only want one link to exist between two specific nodes
},
},
}
}
Relationships
{
relationshipType: "{LocationSharedLib.HAS_LOCATIONLINK_GRAPH_REL_TYPE}", // "has_locationLink
schema: {
elementCanBeRemoved: false,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
},
}
}
{
relationshipType: "{LocationSharedLib.IS_LOCATIONNODE_GRAPH_REL_TYPE}", // "is_locationNode
schema: {
elementCanBeRemoved: false,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
},
}
}
{
relationshipType: "{LocationSharedLib.IS_LOCATIONTYPE_GRAPH_REL_TYPE}", // "is_locationType
schema: {
elementCanBeRemoved: false,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
},
}
}
Basic node schemas
{
nodeLabel: "{LocationSharedLib.LOCATIONNODE_GRAPH_NODE_LABEL}",
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
locationNodeId: {
identifier: true,
},
},
}
}
{
nodeLabel: "{LocationSharedLib.LOCATIONTYPE_GRAPH_NODE_LABEL}",
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
locationTypeId: {
identifier: true,
},
},
}
}
Translations
locationNode
- given name of the location, eg: Bangkok
locationType
- description of the type of label, eg: Country
- see note about about adding a second translation textTag for presentation text, because locationType translation is used to create locationTypeId, so if want to split Post Codes for different countries into their own locationTypes will need to have unique text (eg: "Post Code (USA)", but might want to present with same text (eg: "Post Code")