Rhizi / rhizi

Connective intelligence
GNU Affero General Public License v3.0
13 stars 3 forks source link

Data schema: edge labels? #718

Closed jibe-b closed 8 years ago

jibe-b commented 8 years ago

In the UI, edges have a visible label.

Neo4j accepts only one property per edge, in Rhizi it's id.

I would like to have them as a result of a Cypher query. How are they stored?

alon commented 8 years ago

Hi jibe-b,

Why don't you use the neo4j web ui (defaults to port 7474) to look? I don't recall off the top of my head, but it isn't that convoluted.

Alon

jibe-b commented 8 years ago

@alon Indeed I looked up and as edges have only one property, their must have been a choice on how to store edge labels.

What is the naming convention (at least in comments): are edges labels called name? label?

I look up in the code right now.

jibe-b commented 8 years ago

I see in /test_util__rz_doc.py how edge id may be generated. Is there maybe a test python script producing a mock graph with labels?

jibe-b commented 8 years ago

I think I got it: label is stored as category of the edge.

'create (s)-[:%s {l_attr_0:toInt(%d * rand())}]->(d)' % (self.r_label, lim_r)]

source: neo4j_test_util.py

Right? -> at first sight not

jibe-b commented 8 years ago

I got it, I was wrong about the Cypher function to use.

Answer:

nodes have a name property (and a label) and relationships have a type.

So in Cypher:

MATCH ()-[r]->() RETURN distinct type(r)

jibe-b commented 8 years ago

Thanks @alon.

I am trying to make Rhizi and my RDF workflow interoperable. I'll pull if I have something valuable for Rhizi at the end (possibly export to RDF/turtle).