2

节点必须具有哪些属性,以便它的名称显示在 graphml 中。图形?

我根据我的包创建了一些节点

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

并尝试创建一个graphml图

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

该图的创建很好,除了节点名称。我只得到标签CompositeObject, id = 123456,这使图表无用。

谁能给我一个提示,怎么了?

4

1 回答 1

2

对于 jQAssistant 扫描器定义的类型,有一些特定于类型的规则,它们将被呈现为标签,例如,“fqn”代表“:Artifact”标签节点。

您正在创建一个无法确定类型的虚拟关系,因此无法显示任何属性。jQAssistant 1.3.0 将支持属性“标签”来控制它,例如

  ....
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
于 2017-02-22T17:35:15.987 回答