Allright, so you'd like to add _in and _out IInformacionEmpotrado to the given subGraph? That seems to map well with creating outgoing and incoming relationships from/to a node. Does subGrafo represent a Neo4j node or name of a node, if that's so then the ReglasdeReescrituraImpl is very similar in concept to the Node interface.
Have you looked anything at Spring Data Graph with Neo4j? There you can have your POJOs and just annotate them with graph stuff and it will translate that into Neo4j operations on the fly. https://github.com/SpringSource/spring-data-graph is a nice start for document and https://github.com/SpringSource/spring-data-graph-examples has "HelloWorld" like example of this. 2011/2/15 Jose Angel Inda Herrera <[email protected]> > this is my class > public class ReglasdeReescrituraImpl implements IReglassdeReescritura{ > > > String subGrafo; > ConjuntoImpl<IInformacionEmpotrado> _in; > ConjuntoImpl<IInformacionEmpotrado> _out; > > /** > * Crea una regla de reescritura con la parte izquierda a > <code>gl</code>: {@link NodoPersistente} > * como parte derecha el campo <code>nodoComplejo</code>: {@link String} > y las lista de entrada y de salida > * <code>_in</code>, <code>_out</code> : {@link > ConjuntoImpl<InfoEmpotrado>}. > * > * @param _in lista de las relaciones que entran > * @param _out lista de las relaciones que salen > * @param subGrafo > */ > public ReglasdeReescrituraImpl(ConjuntoImpl<IInformacionEmpotrado> _in, > ConjuntoImpl<IInformacionEmpotrado> _out, String subGrafo) > { > this.subGrafo=subGrafo; > this._in=_in; > this._out=_out; > } > } > > public class InfoEmpotradoImpl implements IInformacionEmpotrado { > > /*** > * u representa el resto del grafo > */ > protected INodoPersistente u;//nodo > /** > * v representa un vertice del grafo gr > */ > protected INodoPersistente v;//nodo > /** > * vp es el valor de la propiedad > */ > protected float vp;//Costo 2 real > /** > * c es el costo > */ > protected float c; > > public InfoEmpotradoImpl(float vp, INodoPersistente v,float c > ,INodoPersistente u ) { > this.u = u; > this.v = v; > this.vp = vp; > this.c = c; > } > } > > thank you > ----- Mensaje original ----- > De: "Mattias Persson" <[email protected]> > Para: "Neo4j user discussions" <[email protected]> > Enviados: Martes, 15 de Febrero 2011 16:11:58 (GMT-0500) Auto-Detected > Asunto: Re: [Neo4j] about relationship > > 2011/2/15 Jose Angel Inda Herrera <[email protected]> > > > thank mattias, > > and oder question, > > I have a class attribute is a collection of objects, then neo4j not allow > > me to take a collection property, as I can store the database in this > > collection, > > > > What kind of objects? Do the object represent other entities? in that case > those should be modelled as Nodes and the connection between you object and > those objects as Relationships. > > > > Thanks and sorry for the trouble... > > > > Not at all. It would be nice though if you could elaborate on your > questions > with as much information as you can and perhaps code/pseudo code. It keeps > other people, like me, from guessing your intents and will consequently > generate better answers for you. > > ----- Mensaje original ----- > > De: "Mattias Persson" <[email protected]> > > Para: "Neo4j user discussions" <[email protected]> > > Enviados: Martes, 15 de Febrero 2011 15:51:54 (GMT-0500) Auto-Detected > > Asunto: Re: [Neo4j] about relationship > > > > Does this help: > > > > http://wiki.neo4j.org/content/Index_Framework#Relationship_indexes > > > > ? > > > > 2011/2/15 Jose Angel Inda Herrera <[email protected]> > > > > > hello Mattias > > > the RelationshipIndex class which would. I have that to implement this > > > class. > > > thank befoorhand > > > ----- Mensaje original ----- > > > De: "Mattias Persson" <[email protected]> > > > Para: "Neo4j user discussions" <[email protected]> > > > Enviados: Lunes, 14 de Febrero 2011 4:18:33 (GMT-0500) Auto-Detected > > > Asunto: Re: [Neo4j] about relationship > > > > > > You mean in the most efficient way? Currently you'll have to go with a > > > relationship index if you have many edges and would like to do a fast > > > lookup > > > for a relationship between two nodes. You can index relationships just > as > > > you do nodes: > > > > > > RelationshipIndex index = graphDb.index().forRelationships( > > > "my-relationships" ); > > > index.add( myRelationship, "myKey", "myValue" ); > > > ... > > > // Either if you query for a specific property: > > > index.get( "myKey", "myValue", startNode, endNode ); > > > // Or if you just query using the nodes > > > index.get( null, null, startNode, endNode ); > > > > > > The other way is to loop relationships from one node and see if the > > > otherNode of those relationships matches. Might be slower though > > > > > > Best, > > > Mattias > > > > > > 2011/2/10 Jose Angel Inda Herrera <[email protected]> > > > > > > > > > > > hello list, > > > > How to get an edge in the graph (in this case a relationship) having > > the > > > > two nodes of this relationship, > > > > > > > > thank beforhand > > > > _______________________________________________ > > > > Neo4j mailing list > > > > [email protected] > > > > https://lists.neo4j.org/mailman/listinfo/user > > > > > > > > > > > > > > > > -- > > > Mattias Persson, [[email protected]] > > > Hacker, Neo Technology > > > www.neotechnology.com > > > _______________________________________________ > > > Neo4j mailing list > > > [email protected] > > > https://lists.neo4j.org/mailman/listinfo/user > > > _______________________________________________ > > > Neo4j mailing list > > > [email protected] > > > https://lists.neo4j.org/mailman/listinfo/user > > > > > > > > > > > -- > > Mattias Persson, [[email protected]] > > Hacker, Neo Technology > > www.neotechnology.com > > _______________________________________________ > > Neo4j mailing list > > [email protected] > > https://lists.neo4j.org/mailman/listinfo/user > > _______________________________________________ > > Neo4j mailing list > > [email protected] > > https://lists.neo4j.org/mailman/listinfo/user > > > > > > -- > Mattias Persson, [[email protected]] > Hacker, Neo Technology > www.neotechnology.com > _______________________________________________ > Neo4j mailing list > [email protected] > https://lists.neo4j.org/mailman/listinfo/user > _______________________________________________ > Neo4j mailing list > [email protected] > https://lists.neo4j.org/mailman/listinfo/user > -- Mattias Persson, [[email protected]] Hacker, Neo Technology www.neotechnology.com _______________________________________________ Neo4j mailing list [email protected] https://lists.neo4j.org/mailman/listinfo/user

