Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
copy nodes to compose subgraph
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  16 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Daniel Aschauer  
View profile  
 More options May 7 2012, 4:06 am
From: Daniel Aschauer <daniel.ascha...@gmail.com>
Date: Mon, 7 May 2012 01:06:17 -0700 (PDT)
Local: Mon, May 7 2012 4:06 am
Subject: copy nodes to compose subgraph

I have a graph where I want to copy a part of it starting from a root node.
All subnode with a boolean value show=true should be included.

Is there a simple way to do that or do I have to iterate throug the nodes
and copy "by hand"?

Daniel


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Neubauer  
View profile  
 More options May 7 2012, 4:21 am
From: Peter Neubauer <peter.neuba...@neotechnology.com>
Date: Mon, 7 May 2012 10:21:38 +0200
Local: Mon, May 7 2012 4:21 am
Subject: Re: [Neo4j] copy nodes to compose subgraph
Are these nodes connected to the root node in any way? Also, how big
is your graph? If you have a big graph and disconnected nodes, then an
"show" index might be more efficient to maintain and iterate when you
need it than traversing the graph. Depends a big on your layout.

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

If you can write, you can code - @coderdojomalmo
If you can sketch, you can use a graph database - @neo4j

On Mon, May 7, 2012 at 10:06 AM, Daniel Aschauer


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Aschauer  
View profile  
 More options May 7 2012, 4:38 am
From: Daniel Aschauer <daniel.ascha...@gmail.com>
Date: Mon, 7 May 2012 01:38:03 -0700 (PDT)
Local: Mon, May 7 2012 4:38 am
Subject: Re: [Neo4j] copy nodes to compose subgraph

Thanks for your reply!

Yes, there are connection between root and the other (sub)nodes, but there
are nodes inbetween that as well have to be copied (and don't (need to)
have a show=true property)
How big the graph will become, let's say a few thousand nodes..

Daniel

Am Montag, 7. Mai 2012 10:21:38 UTC+2 schrieb Peter Neubauer:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Neubauer  
View profile  
 More options May 7 2012, 4:49 am
From: Peter Neubauer <peter.neuba...@neotechnology.com>
Date: Mon, 7 May 2012 10:49:42 +0200
Local: Mon, May 7 2012 4:49 am
Subject: Re: [Neo4j] copy nodes to compose subgraph
In that case, I would just try to fish these paths out with a Cypher
query, something like

start root=node(0)
match path = root-[*1..]-node
where node.show = true
return path

which even gives you the paths and the nodes in between?

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

If you can write, you can code - @coderdojomalmo
If you can sketch, you can use a graph database - @neo4j

On Mon, May 7, 2012 at 10:38 AM, Daniel Aschauer


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Aschauer  
View profile  
 More options May 7 2012, 7:01 am
From: Daniel Aschauer <daniel.ascha...@gmail.com>
Date: Mon, 7 May 2012 04:01:36 -0700 (PDT)
Local: Mon, May 7 2012 7:01 am
Subject: Re: [Neo4j] copy nodes to compose subgraph

That is a solution I thought about as well. But wouldn't that produce a lot
of overhead.
The case is that a lot of these leaves (show=true) will be connected to a
subnode -> so this gives me a lot of path that would contain the same
(sub)nodes in between?
Something cool would be the possibility to define a view on the graph to
work with.

Thanks, Daniel

Am Montag, 7. Mai 2012 10:49:42 UTC+2 schrieb Peter Neubauer:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Neubauer  
View profile  
 More options May 7 2012, 10:32 am
From: Peter Neubauer <peter.neuba...@neotechnology.com>
Date: Mon, 7 May 2012 16:32:22 +0200
Local: Mon, May 7 2012 10:32 am
Subject: Re: [Neo4j] copy nodes to compose subgraph
Mmh,
with that amount of data that shouldn't be a problem, just pipe that
cypher into some export format (graphML or GEOFF) and use that do have
your derived graph read in?

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

If you can write, you can code - @coderdojomalmo
If you can sketch, you can use a graph database - @neo4j

On Mon, May 7, 2012 at 1:01 PM, Daniel Aschauer


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Aschauer  
View profile  
 More options May 7 2012, 11:00 am
From: Daniel Aschauer <daniel.ascha...@gmail.com>
Date: Mon, 7 May 2012 08:00:26 -0700 (PDT)
Local: Mon, May 7 2012 11:00 am
Subject: Re: [Neo4j] copy nodes to compose subgraph

Good point, although I do copying now by collection nodes and relationships
from all paths and copying their properties.
However could be interesting to be able to directly export some cypher
query results. How can this be done?
I used the (com.tinkerpop.blueprints*)GraphMLWriter already, but there I
have to provide a Graph?
Thanks,
Daniel

Am Montag, 7. Mai 2012 16:32:22 UTC+2 schrieb Peter Neubauer:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Neubauer  
View profile  
 More options May 10 2012, 9:30 am
From: Peter Neubauer <peter.neuba...@neotechnology.com>
Date: Thu, 10 May 2012 15:30:41 +0200
Local: Thurs, May 10 2012 9:30 am
Subject: Re: [Neo4j] copy nodes to compose subgraph
Mmh,
I think simply iterating over all nodes/relationships and then
deduping them should work. We do something similar when providing
D3.js with data, see
https://github.com/mbostock/d3/blob/master/examples/force/miserables....
for the data, and

http://mbostock.github.com/d3/ex/force.html for the resulting graph.

WDYT?

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

If you can write, you can code - @coderdojomalmo
If you can sketch, you can use a graph database - @neo4j

On Mon, May 7, 2012 at 5:00 PM, Daniel Aschauer


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Aschauer  
View profile  
 More options May 10 2012, 9:54 am
From: Daniel Aschauer <daniel.ascha...@gmail.com>
Date: Thu, 10 May 2012 15:54:13 +0200
Local: Thurs, May 10 2012 9:54 am
Subject: Re: [Neo4j] copy nodes to compose subgraph
It works fine already put all nodes/relationships from the pathes in
one Collection, and then copying their properties.
The only problem I'm still facing is that the index is not updated for
the copies - will have to use some lookup table which properties to
index.
Cheers, Daniel

2012/5/10 Peter Neubauer <peter.neuba...@neotechnology.com>:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Aschauer  
View profile  
 More options May 11 2012, 5:53 am
From: Daniel Aschauer <daniel.ascha...@gmail.com>
Date: Fri, 11 May 2012 02:53:51 -0700 (PDT)
Local: Fri, May 11 2012 5:53 am
Subject: Re: [Neo4j] copy nodes to compose subgraph

The problem a have is that I copy the Node objects with their properties,
but I have to convert them somehow back to the according object (SDN
annotated @NodeEntity) otherwise the repository methods and the index won't
work?
How can this be done?

Thanks, Daniel

Am Donnerstag, 10. Mai 2012 15:30:41 UTC+2 schrieb Peter Neubauer:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Neubauer  
View profile  
 More options May 11 2012, 8:24 am
From: Peter Neubauer <peter.neuba...@neotechnology.com>
Date: Fri, 11 May 2012 14:24:49 +0200
Local: Fri, May 11 2012 8:24 am
Subject: Re: [Neo4j] copy nodes to compose subgraph
Right,
I suspect that you need to update the indexes that are attached to an
entity (maybe you can infer that from the annotations of the objects,
since the indexes have names reflecting those, MH knows more) and of
course create the corresponding graph data. Maybe you could examine
what exactly the raw node looks like that is backing an object, and
create it that way?

I think inferring the used indexes might be the tricky part, but not impossible.

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

If you can write, you can code - @coderdojomalmo
If you can sketch, you can use a graph database - @neo4j

On Fri, May 11, 2012 at 11:53 AM, Daniel Aschauer


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Hunger  
View profile  
 More options May 11 2012, 2:34 pm
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Fri, 11 May 2012 20:34:06 +0200
Local: Fri, May 11 2012 2:34 pm
Subject: Re: [Neo4j] copy nodes to compose subgraph
You can call template.postEntityCreation(node,clazz) to add the necessary indices for the type information.

template.setPersistentState(object,node) // existing node
template.postEntityCreation(node,clazz) // store type information in graph
template.save(object) saves the properties of the object onto the node

HTH

Michael

Am 11.05.2012 um 14:24 schrieb Peter Neubauer:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Aschauer  
View profile  
 More options May 14 2012, 11:07 am
From: Daniel Aschauer <daniel.ascha...@gmail.com>
Date: Mon, 14 May 2012 08:07:54 -0700 (PDT)
Local: Mon, May 14 2012 11:07 am
Subject: Re: [Neo4j] copy nodes to compose subgraph

template.postEntityCreation(node,clazz) is deprecated.

As convert a Node to a @NodeEntity by this:
Class<?> targettype = Class.forName((String)
nRootNode.getProperty("__type__"));
template.save(template.convert(nRootNode, targettype));

This works fine for some part, the node and the indices are created, but by
using the repository method findAll these nodes are not included, why or
what can be done to inlcude them?

I am using Sring data neo4j 2.0.1

Am Freitag, 11. Mai 2012 20:34:06 UTC+2 schrieb Michael Hunger:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Hunger  
View profile   Translate to Translated (View Original)
 More options May 14 2012, 11:52 am
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Mon, 14 May 2012 17:52:05 +0200
Local: Mon, May 14 2012 11:52 am
Subject: Re: [Neo4j] copy nodes to compose subgraph

That's what template.postEntityCreation(node,clazz) is for, it is deprecated b/c I want to replace it in the long term.

But for now it is is the external API way to go.

Michael

Am 14.05.2012 um 17:07 schrieb Daniel Aschauer:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dmitry Serebrennikov  
View profile  
 More options Feb 2, 7:47 am
From: Dmitry Serebrennikov <dsereb...@gmail.com>
Date: Sat, 2 Feb 2013 04:47:22 -0800 (PST)
Local: Sat, Feb 2 2013 7:47 am
Subject: Re: [Neo4j] copy nodes to compose subgraph

Michael,

Do you think it would be possible to remove the @deprecation flag from that
method or perhaps add a comment stating the alternative to use or that it
is the one to be used now and deprecation is only for long term
considerations?

I ran into this same method earlier today but kept on looking since I
didn't want to write new code using a deprecated method. It would have
helped me to know that this was the approved method to use at this time.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Hunger  
View profile  
 More options Feb 2, 10:06 am
From: Michael Hunger <michael.hun...@neopersistence.com>
Date: Sat, 2 Feb 2013 16:06:52 +0100
Local: Sat, Feb 2 2013 10:06 am
Subject: Re: [Neo4j] copy nodes to compose subgraph

You can use it for now

Will go away with label support in neo an sdn

Sent from mobile device

Am 02.02.2013 um 13:47 schrieb Dmitry Serebrennikov <dsereb...@gmail.com>:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »