Nodes a, b, c and d also have other nodes. The point is - there is only a single reference to 'some node' from REF_NODE and for each of its children. I would like to be able to delete 'some node' with all nodes that are 'under it' - that's what I mean by cutting off, for lack of a better, scientific word ;d There can, however, be references between all other nodes below 'some node' (for example, a references c, and grandchildren of d reference b and the other way round). For the delete operation, it's all the same as long as there are no references to the 'top level' 'some node'. The Node.delete() method will not allow me to delete it as there are other references. The way I can see it work is to have some complex algorithm to 'disintegrate' the graph somehow, which I think would be difficult and time consuming - the subgraph below 'some node' might be very big indeed. How can I do it best?
> REF_NODE
> |
> |
> |
> some node
> | | | |
> a b c d
> Nodes a, b, c and d also have other nodes. The point is - there is only a
> single reference to 'some node' from REF_NODE and for each of its children.
> I would like to be able to delete 'some node' with all nodes that are
> 'under it' - that's what I mean by cutting off, for lack of a better,
> scientific word ;d There can, however, be references between all other
> nodes below 'some node' (for example, a references c, and grandchildren of
> d reference b and the other way round). For the delete operation, it's all
> the same as long as there are no references to the 'top level' 'some node'.
> The Node.delete() method will not allow me to delete it as there are other
> references. The way I can see it work is to have some complex algorithm to
> 'disintegrate' the graph somehow, which I think would be difficult and time
> consuming - the subgraph below 'some node' might be very big indeed.
> How can I do it best?
Sorry for the poor wording and confusion.
By cutting off I mean: wipe out 'some node', a, b, c, d, all other nodes
below, all relationships... I would like to say:
node.wipeOut()
and have the whole subgraph deleted - after this operation, the graph looks
like the following:
REF_NODE
Of course, if the graph looks like this:
REF_NODE
| |
| |
some another
node node
and I invoke
'some node'.wipeOut()
the graph looks like this:
REF_NODE
|
|
another
node
(again, with no trace of orphaned 'some node', a, b, c, or d).
Regards,
wujek
On Tue, Oct 2, 2012 at 9:49 AM, Mattias Persson
<matt...@neotechnology.com>wrote:
>> REF_NODE
>> |
>> |
>> |
>> some node
>> | | | |
>> a b c d
>> Nodes a, b, c and d also have other nodes. The point is - there is only a
>> single reference to 'some node' from REF_NODE and for each of its children.
>> I would like to be able to delete 'some node' with all nodes that are
>> 'under it' - that's what I mean by cutting off, for lack of a better,
>> scientific word ;d There can, however, be references between all other
>> nodes below 'some node' (for example, a references c, and grandchildren of
>> d reference b and the other way round). For the delete operation, it's all
>> the same as long as there are no references to the 'top level' 'some node'.
>> The Node.delete() method will not allow me to delete it as there are
>> other references. The way I can see it work is to have some complex
>> algorithm to 'disintegrate' the graph somehow, which I think would be
>> difficult and time consuming - the subgraph below 'some node' might be very
>> big indeed.
>> How can I do it best?
I think he wants to prune the tree starting at a node, but not including
that node. I'm also interested in this ability (it would be nice not to
have to traverse and prune). Is there syntax that allows for this already?
>> REF_NODE
>> |
>> |
>> |
>> some node
>> | | | |
>> a b c d
>> Nodes a, b, c and d also have other nodes. The point is - there is only a
>> single reference to 'some node' from REF_NODE and for each of its children.
>> I would like to be able to delete 'some node' with all nodes that are
>> 'under it' - that's what I mean by cutting off, for lack of a better,
>> scientific word ;d There can, however, be references between all other
>> nodes below 'some node' (for example, a references c, and grandchildren of
>> d reference b and the other way round). For the delete operation, it's all
>> the same as long as there are no references to the 'top level' 'some node'.
>> The Node.delete() method will not allow me to delete it as there are
>> other references. The way I can see it work is to have some complex
>> algorithm to 'disintegrate' the graph somehow, which I think would be
>> difficult and time consuming - the subgraph below 'some node' might be very
>> big indeed.
>> How can I do it best?
On Tue, Oct 2, 2012 at 9:55 AM, Wes Freeman <freeman....@gmail.com> wrote:
> I think he wants to prune the tree starting at a node, but not including
> that node. I'm also interested in this ability (it would be nice not to
> have to traverse and prune). Is there syntax that allows for this already?
>>> REF_NODE
>>> |
>>> |
>>> |
>>> some node
>>> | | | |
>>> a b c d
>>> Nodes a, b, c and d also have other nodes. The point is - there is only
>>> a single reference to 'some node' from REF_NODE and for each of its
>>> children. I would like to be able to delete 'some node' with all nodes that
>>> are 'under it' - that's what I mean by cutting off, for lack of a better,
>>> scientific word ;d There can, however, be references between all other
>>> nodes below 'some node' (for example, a references c, and grandchildren of
>>> d reference b and the other way round). For the delete operation, it's all
>>> the same as long as there are no references to the 'top level' 'some node'.
>>> The Node.delete() method will not allow me to delete it as there are
>>> other references. The way I can see it work is to have some complex
>>> algorithm to 'disintegrate' the graph somehow, which I think would be
>>> difficult and time consuming - the subgraph below 'some node' might be very
>>> big indeed.
>>> How can I do it best?
I think the syntax to delete collections of relationships in cypher would
make this trivial (either deleting the starting node or not), as I
mentioned in my ticket. I don't think there's another way to do it without
doing multiple calls and traversing.
On Tue, Oct 2, 2012 at 3:57 AM, Wujek Srujek <wujek.sru...@gmail.com> wrote:
> Thank you! Yes, 'prune' would be the better word.
> With the difference that when I prune starting with a node, I also want to
> remove the node itself. But that should be a simple change?
> wujek
> On Tue, Oct 2, 2012 at 9:55 AM, Wes Freeman <freeman....@gmail.com> wrote:
>> I think he wants to prune the tree starting at a node, but not including
>> that node. I'm also interested in this ability (it would be nice not to
>> have to traverse and prune). Is there syntax that allows for this already?
>>>> REF_NODE
>>>> |
>>>> |
>>>> |
>>>> some node
>>>> | | | |
>>>> a b c d
>>>> Nodes a, b, c and d also have other nodes. The point is - there is only
>>>> a single reference to 'some node' from REF_NODE and for each of its
>>>> children. I would like to be able to delete 'some node' with all nodes that
>>>> are 'under it' - that's what I mean by cutting off, for lack of a better,
>>>> scientific word ;d There can, however, be references between all other
>>>> nodes below 'some node' (for example, a references c, and grandchildren of
>>>> d reference b and the other way round). For the delete operation, it's all
>>>> the same as long as there are no references to the 'top level' 'some node'.
>>>> The Node.delete() method will not allow me to delete it as there are
>>>> other references. The way I can see it work is to have some complex
>>>> algorithm to 'disintegrate' the graph somehow, which I think would be
>>>> difficult and time consuming - the subgraph below 'some node' might be very
>>>> big indeed.
>>>> How can I do it best?
Great, I will test it. Thank you for your help.
One question - you said no traversal is done - how does this work then?
Does cypher don't do traversal in this case?
Sorry for this potentially dumb question, I am just starting with neo4j,
and haven't looked at cypher yet!
On Tue, Oct 2, 2012 at 10:00 AM, Wes Freeman <freeman....@gmail.com> wrote:
> I think the syntax to delete collections of relationships in cypher would
> make this trivial (either deleting the starting node or not), as I
> mentioned in my ticket. I don't think there's another way to do it without
> doing multiple calls and traversing.
> Wes
> On Tue, Oct 2, 2012 at 3:57 AM, Wujek Srujek <wujek.sru...@gmail.com>wrote:
>> Thank you! Yes, 'prune' would be the better word.
>> With the difference that when I prune starting with a node, I also want
>> to remove the node itself. But that should be a simple change?
>> wujek
>> On Tue, Oct 2, 2012 at 9:55 AM, Wes Freeman <freeman....@gmail.com>wrote:
>>> I think he wants to prune the tree starting at a node, but not including
>>> that node. I'm also interested in this ability (it would be nice not to
>>> have to traverse and prune). Is there syntax that allows for this already?
>>>>> REF_NODE
>>>>> |
>>>>> |
>>>>> |
>>>>> some node
>>>>> | | | |
>>>>> a b c d
>>>>> Nodes a, b, c and d also have other nodes. The point is - there is
>>>>> only a single reference to 'some node' from REF_NODE and for each of its
>>>>> children. I would like to be able to delete 'some node' with all nodes that
>>>>> are 'under it' - that's what I mean by cutting off, for lack of a better,
>>>>> scientific word ;d There can, however, be references between all other
>>>>> nodes below 'some node' (for example, a references c, and grandchildren of
>>>>> d reference b and the other way round). For the delete operation, it's all
>>>>> the same as long as there are no references to the 'top level' 'some node'.
>>>>> The Node.delete() method will not allow me to delete it as there are
>>>>> other references. The way I can see it work is to have some complex
>>>>> algorithm to 'disintegrate' the graph somehow, which I think would be
>>>>> difficult and time consuming - the subgraph below 'some node' might be very
>>>>> big indeed.
>>>>> How can I do it best?
> Great, I will test it. Thank you for your help.
> One question - you said no traversal is done - how does this work then? Does cypher don't do traversal in this case?
> Sorry for this potentially dumb question, I am just starting with neo4j, and haven't looked at cypher yet!
> Regards,
> wujek
> On Tue, Oct 2, 2012 at 10:00 AM, Wes Freeman <freeman....@gmail.com> wrote:
> I think the syntax to delete collections of relationships in cypher would make this trivial (either deleting the starting node or not), as I mentioned in my ticket. I don't think there's another way to do it without doing multiple calls and traversing.
> Wes
> On Tue, Oct 2, 2012 at 3:57 AM, Wujek Srujek <wujek.sru...@gmail.com> wrote:
> Thank you! Yes, 'prune' would be the better word.
> With the difference that when I prune starting with a node, I also want to remove the node itself. But that should be a simple change?
> wujek
> On Tue, Oct 2, 2012 at 9:55 AM, Wes Freeman <freeman....@gmail.com> wrote:
> I think he wants to prune the tree starting at a node, but not including that node. I'm also interested in this ability (it would be nice not to have to traverse and prune). Is there syntax that allows for this already?
> On Tue, Oct 2, 2012 at 3:49 AM, Mattias Persson <matt...@neotechnology.com> wrote:
> I don't quite understand as your sentences seem to contradict each other.
> On the one hand you'd like to delete "some node" and "all nodes under it".
> On the other hand you'd just like to cut it off, which I interpret as just remove all its relationships.
> Can you elaborate?
> Best,
> Mattias
> 2012/10/2 wujek <wujek.sru...@gmail.com>
> Hi. I have the following structure:
> REF_NODE
> |
> |
> |
> some node
> | | | |
> a b c d
> Nodes a, b, c and d also have other nodes. The point is - there is only a single reference to 'some node' from REF_NODE and for each of its children. I would like to be able to delete 'some node' with all nodes that are 'under it' - that's what I mean by cutting off, for lack of a better, scientific word ;d There can, however, be references between all other nodes below 'some node' (for example, a references c, and grandchildren of d reference b and the other way round). For the delete operation, it's all the same as long as there are no references to the 'top level' 'some node'.
> The Node.delete() method will not allow me to delete it as there are other references. The way I can see it work is to have some complex algorithm to 'disintegrate' the graph somehow, which I think would be difficult and time consuming - the subgraph below 'some node' might be very big indeed.
> How can I do it best?