2

What properties must a node have, so that it's name is displayed in the graphml. grafic?

I create some node based on my packages with

MATCH (artifact:Artifact)
WHERE
   artifact.type <> "test-jar"
MATCH
  (artifact:Artifact)-[:CONTAINS]->(root:Package{fqn:"net.sf.sze.dao.api"})-[:CONTAINS]->(slice:Package)
WITH COLLECT(slice) AS rows1
MATCH
  (artifact:Artifact)-[:CONTAINS]->(root:Package{fqn:"net.sf.sze.frontend"})-[:CONTAINS]->(slice:Package)
WITH rows1 + COLLECT(slice) AS rows2
MATCH
  (artifact:Artifact)-[:CONTAINS]->(root:Package{fqn:"net.sf.sze.service"})-[:CONTAINS *2..2]->(slice:Package)
WITH rows2 + COLLECT(slice) AS rows3
UNWIND rows3 AS slice
MERGE (sn:Slice{name:slice.name})
MERGE (sn)-[:SLICE_CONTAINS]-> (slice)
RETURN
  sn

and try to create a graphml diagram with

MATCH
  (slice1:Slice)-[:SLICE_CONTAINS]->()-[:CONTAINS*]->(t1:Type),
  (slice2:Slice)-[:SLICE_CONTAINS]->()-[:CONTAINS*]->(t2:Type),
  (t1)-[d:DEPENDS_ON]->(t2)
WHERE
   slice1 <> slice2
WITH
  slice1, slice2, count(d) as weight
RETURN
  slice1 as Slice1, slice2 as Slice2, {
    role :     "relationship",
    type :     "DEPENDS_ON",
    startNode: slice1,
    endNode:   slice2,
    properties: {
      weight: weight
    }
  } as Dependency

The graph is created well expect the node names. I only get as Label CompositeObject, id = 123456 which makes the diagram useless.

Can anyone give me a hint, whats wrong?

niels
  • 7,321
  • 2
  • 38
  • 58

1 Answers1

2

For types defined by the jQAssistant scanner there are type specific rules what will be rendered as a label, e.g. "fqn" for ":Artifact" labeled nodes.

You're creating a virtual relationship where the type cannot be determined thus no property can be shown. jQAssistant 1.3.0 will support a property "label" to control this, e.g.

  ....
RETURN
  slice1 as Slice1, slice2 as Slice2, {
    role :     "relationship",
    type :     "DEPENDS_ON",
    startNode: slice1,
    endNode:   slice2,
    label: weight, // set an explicit label
    properties: {
      weight: weight
    }
 } as Dependency
Dirk Mahler
  • 1,186
  • 1
  • 6
  • 7
  • 1
    For which node is the label used? When will be 1.3.0 published? The :Artifact and `fqn` property solved it. – niels Feb 22 '17 at 18:42
  • The label refers to the virtual element you're creating, in this case it's a relationship (role:"relationship"). jQAssistant 1.3.0 is already in the pipeline scheduled for mid/end of March 2017. – Dirk Mahler Feb 27 '17 at 06:15
  • In my case I need a label for the nodes too. – niels Feb 28 '17 at 09:16
  • The "label" property is also supported for virtual nodes and graphs. – Dirk Mahler Mar 01 '17 at 15:09