使用属性创建neo4j图形

使用属性创建neo4j图形,neo4j,cypher,graph-databases,nosql,Neo4j,Cypher,Graph Databases,Nosql,我正在设计一个web应用程序,它可以直观地显示来自Neo4J的数据。以下是我当前的注释: CREATE (diseasedataset:Dataset { title: 'Disease Dataset', description: 'Dataset about diseases and mapping to cytogenetic location', creator: 'Zach'}) CREATE (diseasedata:Table { title: 'Disease', represe

我正在设计一个web应用程序,它可以直观地显示来自Neo4J的数据。以下是我当前的注释:

CREATE (diseasedataset:Dataset { title: 'Disease Dataset', description: 'Dataset about diseases and mapping to cytogenetic location', creator: 'Zach'})
CREATE (diseasedata:Table { title: 'Disease', represents: 'mesh:Disease'})
CREATE (diseasedata)-[:BELONGS_TO]->(diseasedataset)
    CREATE (diseaseid:Column { title: 'ID', columntype: 'Property', semanticrelation: 'dct:identifier'})
    CREATE (diseaseid)-[:BELONGS_TO]->(diseasedata)
    CREATE (diseasename:Column { title: 'Name', columntype: 'Property', semanticrelation: 'skos:preferredLabel'})
    CREATE (diseasename)-[:BELONGS_TO]->(diseasedata)
    CREATE (diseasedesc:Column { title: 'Descriptions', columntype: 'Property', semanticrelation: 'dct:description'})
    CREATE (diseasedesc)-[:BELONGS_TO]->(diseasedata)
    CREATE (diseasesymp:Column { title: 'Symptoms', columntype: 'Class', represents: 'mesh:Symptom', semanticrelation: 'syo:Symptom'})
    CREATE (diseasedesc)-[:BELONGS_TO]->(diseasedata)
如何创建一个表(使用cypher查询),其中每行有一个[Column]和每列的属性集合。这尤其棘手,因为并非每一列都有相同的属性。例如:

行|列|属性

1 | dieseaseId |标题、列类型、语义关联

2 |疾病症状|标题、列类型、表示、语义

3(等)


这是一种直观的方法吗?我对Neo4j和Cypher比较陌生,在网上或文档中都找不到类似的内容。谢谢你的时间和建议

我不确定您是否可以用一个密码查询来实现这一点。您可能需要首先返回密钥,然后生成一个查询来获取这些密钥。要获取密钥,您可以返回所有数据,或者在Neo4j 2.2.0中(仍然是一个候选版本,但希望很快发布),您可以执行以下操作:

MATCH n UNWIND keys(n) AS key RETURN DISTINCT key
这将返回您指定的节点上的唯一键列表(这里我正在执行匹配所有节点的
MATCH n

MATCH n RETURN n.key1, n.key2, n.key3, ....

我想你打算创建的最后一行是'create(diseasesymp)-[:belishing_to]->(diseasedata)`@DaveBennett,你是对的。谢谢你提醒我这一点!我看到最后一列是一个可变长度的集合。“列”上可能的属性数是多少即使节点是可变的,但它们至少有一定的有限性?@DaveBenett是的,这是正确的。属性的大小范围为2-5。(2表示一个节点至少有2个属性,5表示最大值)