Yes Amir,
Neo4j is not constraining you in any way in creating your
relationships, so you can have any number of relationships, even of
the same type, between the same nodes. You will have to check that, or
force some structure on the nodespace via a meta, see
http://components.neo4j.org/neo4j-meta-model/ Another technique is to
use some of the frameworks like Rail, JRuby, Grails that use wrappers
around raw nodes in order to keep structure.

But for now, I think a simple check would do the trick :)

Let us know if you need more help!

Cheers,

/peter neubauer

COO and Sales, Neo Technology

GTalk:      neubauer.peter
Skype       peter.neubauer
Phone       +46 704 106975
LinkedIn   http://www.linkedin.com/in/neubauer
Twitter      http://twitter.com/peterneubauer

http://www.neo4j.org             - Your high performance graph database.
http://www.tinkerpop.com      - Processing for Internet-scale graphs.
http://www.thoughtmade.com - Scandinavias coolest Bring-a-Thing party.



On Mon, Mar 29, 2010 at 8:54 AM, Amir Hossein Jadidinejad
<[email protected]> wrote:
> Hi,
> I'm going to load a huge graph. After playing with some test cases, I found 
> that when a new relationship add to the graph, it does not overwrite the 
> previous relation and when printing the relationships, redundant items are in 
> the output. I don't want such a redundant items! f.ex. suppose the following 
> code:
>             Node alex = index.getSingleNode("name", "alex");
>             for(Relationship r: alex.getRelationships())
>                 System.out.println(r.getEndNode().getId());
> Here is the output:
> 1
> 1
> 1
> 1
> 2
>
> It seems that I have to check the current relationships before any update, 
> Isn't it?
> Amir
>
>
>
>
> _______________________________________________
> Neo mailing list
> [email protected]
> https://lists.neo4j.org/mailman/listinfo/user
>
_______________________________________________
Neo mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to