Re: [Neo4j] Relationships = strongly typed. nodes = just nodes. Why?

2011-07-26 Thread Jim Webber
Yeah, I agree with Niels. It's unfortunate naming in the API. You should really 
think of it as a relationship name.

Jim
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Relationships = strongly typed. nodes = just nodes. Why?

2011-07-25 Thread Niels Hoogeveen

RelationshipType is not really a type in the conventional sense of the word. 
RelationshipType is for all practical purposes a label assigned to a 
Relationship for the purpose of navigation. 
You could also say that nodes are typed through the relationships attached to 
them. So from the perspective of node1, node2 is a node that has type "KNOWS".
Niels
> Date: Mon, 25 Jul 2011 13:43:45 -0700
> From: lold...@gmail.com
> To: user@lists.neo4j.org
> Subject: [Neo4j] Relationships = strongly typed. nodes = just nodes. Why?
> 
> How come relationships are strongly typed while every node is just a generic
> node? Example:
> 
> 
> import org.neo4j.graphdb.RelationshipType;
> public enum TaxonomyRelationshipTypes implements RelationshipType {
>   KNOWS
> }
> ...
> Node node1 = graphDb.createNode();  //just a generic node, apparently
> Node node2 = graphDb.createNode();
> Relationship rel = node1.createRelationshipTo(node2,
> TaxonomyRelationshipTypes.KNOWS); //strong stuff..
> 
> (taken from http://sujitpal.blogspot.com/2011/07/second-look-at-neo4j.html )
> 
> Wouldn't it be smart to have strongly typed nodes, so I could have nodes for
> 'users', nodes for 'products', nodes for 'teams' etc.?  I know I can apply
> attributes to nodes, but that doesn't ensure any kind of consistency among
> nodes denoting the same semantic idea (eg. 'users', 'products' or 'teams).
> How do I model strongly typed nodes? Or, is there something that I have
> missed? I'm quite new in graph databases...
> 
> --
> View this message in context: 
> http://neo4j-community-discussions.438527.n3.nabble.com/Relationships-strongly-typed-nodes-just-nodes-Why-tp3198672p3198672.html
> Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
  
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Relationships = strongly typed. nodes = just nodes. Why?

2011-07-25 Thread loldrup
How come relationships are strongly typed while every node is just a generic
node? Example:


import org.neo4j.graphdb.RelationshipType;
public enum TaxonomyRelationshipTypes implements RelationshipType {
  KNOWS
}
...
Node node1 = graphDb.createNode();  //just a generic node, apparently
Node node2 = graphDb.createNode();
Relationship rel = node1.createRelationshipTo(node2,
TaxonomyRelationshipTypes.KNOWS); //strong stuff..

(taken from http://sujitpal.blogspot.com/2011/07/second-look-at-neo4j.html )

Wouldn't it be smart to have strongly typed nodes, so I could have nodes for
'users', nodes for 'products', nodes for 'teams' etc.?  I know I can apply
attributes to nodes, but that doesn't ensure any kind of consistency among
nodes denoting the same semantic idea (eg. 'users', 'products' or 'teams).
How do I model strongly typed nodes? Or, is there something that I have
missed? I'm quite new in graph databases...

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Relationships-strongly-typed-nodes-just-nodes-Why-tp3198672p3198672.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user