Service - Locations: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 31: | Line 31: | ||
= Graph database = | = Graph database = | ||
== [[Service - | == [[Service - Locations Graph]]== | ||
=== Nodes === | === Nodes === | ||
Line 37: | Line 37: | ||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
{ | { | ||
nodeLabel: "{ | nodeLabel: "{LocationSharedLib.LOCATIONNODE_GRAPH_NODE_LABEL}", // "locationNode" | ||
schema: { | schema: { | ||
identifier: true, | identifier: true, | ||
Line 43: | Line 43: | ||
restrictRelationships: true, | restrictRelationships: true, | ||
properties: { | properties: { | ||
locationNodeId: { | |||
identifier: true, // create unique id from | identifier: true, // create unique id from translation and uniqueMessageId (because multiple locationNode can have same translation) | ||
}, | }, | ||
}, | |||
} | |||
} | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
nodeLabel: "{LocationSharedLib.LOCATIONTYPE_GRAPH_NODE_LABEL}", // "locationType" | |||
schema: { | |||
identifier: true, | |||
restrictProperties: true, | |||
restrictRelationships: true, | |||
properties: { | |||
locationTypeId: { | |||
identifier: true, // create unique id from translation | |||
}, | }, | ||
}, | |||
} | |||
} | |||
</syntaxhighlight> | |||
* 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 | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
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 | |||
}, | }, | ||
}, | }, | ||
Line 59: | Line 86: | ||
=== Relationships === | === Relationships === | ||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
relationshipType: "{LocationSharedLib.HAS_LOCATIONLINK_GRAPH_REL_TYPE}", // "has_locationLink | |||
schema: { | |||
elementCanBeRemoved: false, | |||
allPropertiesImmutable: true, | |||
restrictProperties: true, | |||
properties: { | |||
}, | |||
} | |||
} | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
relationshipType: "{LocationSharedLib.IS_LOCATIONNODE_GRAPH_REL_TYPE}", // "is_locationNode | |||
schema: { | |||
elementCanBeRemoved: false, | |||
allPropertiesImmutable: true, | |||
restrictProperties: true, | |||
properties: { | |||
}, | |||
} | |||
} | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
relationshipType: "{LocationSharedLib.IS_LOCATIONTYPE_GRAPH_REL_TYPE}", // "is_locationType | |||
schema: { | |||
elementCanBeRemoved: false, | |||
allPropertiesImmutable: true, | |||
restrictProperties: true, | |||
properties: { | |||
}, | |||
} | |||
} | |||
</syntaxhighlight> | |||
== Basic node schemas == | == Basic node schemas == | ||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
nodeLabel: "{LocationSharedLib.LOCATIONNODE_GRAPH_NODE_LABEL}", | |||
schema: { | |||
identifier: true, | |||
restrictProperties: true, | |||
restrictRelationships: true, | |||
properties: { | |||
locationNodeId: { | |||
identifier: true, | |||
}, | |||
}, | |||
} | |||
} | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
nodeLabel: "{LocationSharedLib.LOCATIONTYPE_GRAPH_NODE_LABEL}", | |||
schema: { | |||
identifier: true, | |||
restrictProperties: true, | |||
restrictRelationships: true, | |||
properties: { | |||
locationTypeId: { | |||
identifier: true, | |||
}, | |||
}, | |||
} | |||
} | |||
</syntaxhighlight> | |||
= 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") | |||
= Working documents = | = Working documents = |
Revision as of 02:07, 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")