Skip to content
Snippets Groups Projects

feat(schema-attribute-info)

Closed Vink, S.A. (Sjoerd) requested to merge feat/schema-attribute-info into main
3 unresolved threads

Depends on schema-retrieval MR: listens to statistics for schema attributes

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
68 attributeStats: Array<AttributeStats>;
69 };
70
71 export type AttributeStats =
72 | BooleanAttributeStats
73 | StringAttributeStats
74 | NumberAttributeStats
75 | DateTimeAttributeStats
76 | LocationAttributeStats;
77
78 export type CommonAttributeStats = {
79 name: string;
80 type: string;
81 };
82
83 export type BooleanAttributeStats = CommonAttributeStats & {
  • 81 81 handleData: {
    82 82 ...defaultHandleData,
    83 83 attributeName: optAttribute.name,
    84 attributeType: optAttribute.type,
    84 // attributeType: optAttribute.type,
  • 72 80
    73 81 return graph;
    74 82 }
    83
    84 public static addAttributeInfoToGraph(graph: SchemaGraph, graphStats: GraphAttributeStats): SchemaGraph {
    85 const { nodeStats, edgeStats } = graphStats;
    86
    87 graph.nodes.forEach((node) => {
    88 const nodeStat = nodeStats.find((stat) => stat.key === node.key);
    • It is pretty expensive to loop through all nodes to look up every node, is it possible to store the node stats in a dictionary instead? The same holds for edge stats below

    • Please register or sign in to reply
  • In principle it looks good to me, I have a few comments but nothing major.

    I can however not currently test out the PR myself, as I can't easily switch my microservices to the schema-retrieval MR (because docker). @milho001 If you can run it locally as a final check, then its good to go. Syntactically everything is fine :smile:

    @s.a.vink It took me a while to figure out what you meant with 'schema-retrieval MR' as it was in a different repo, I would be helpful to put the link (graphpolaris/microservices/schema-retrieval!4) there instead. GitLab does nice formatting and everything :)

  • I took a quick look. Overall it is good, but there is a problem in case I switch between saveStates quickly. I may receive the stats of the wrong savestate (wrong schema), causing the schema data within redux to be badly populated (offsync). I'd recommend that instead of adding the data to the existing schema, you just add it to a new part of redux, which can be consumed by the components separatelly. This could be a Map of node->stats, so that its as fast as having the data within the schema structure.

    An alternative is to only return the schema with the stats (so, make the call synchronous), but this would need more work and I think is less ideal than the first idea.

  • I tested it out and reached the conclusion that the low performance (due to calling several times neo4j) makes this quite cumbersome. Let's reengage this next week.

  • I merged partially this PR. Further development will be made to have a better performance of the attribute stat collection.

  • Please register or sign in to reply
    Loading