Skip Menu |

This queue is for tickets about the REST-Neo4p CPAN distribution.

Report information
The Basics
Id: 92135
Status: resolved
Priority: 0/
Queue: REST-Neo4p

People
Owner: maj.fortinbras [...] gmail.com
Requestors: kevin.pluck [...] ivendi.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Neo4p batches
Date: Tue, 14 Jan 2014 10:17:22 +0000
To: bug-REST-Neo4p [...] rt.cpan.org
From: Kevin Pluck <kevin.pluck [...] ivendi.com>
Hi, I was playing with the Neo4p batch module but fell at the first hurdle; I can't seem to create a node with lables as I can only add labels after a node has been generated but, of course, in batch mode the node hasn't been created yet. batch { my $dealerNode = REST::Neo4p::Node->new({source => $source}); $dealerNode->set_labels("Dealer"); ... returns Can't call method "set_labels" on an undefined value. Is it possible to create a new node with labels? Also I had to turn off strict "refs" in Entity.pm as I was getting "Can't use string ("{3}") as a HASH ref while "strict refs" in use at C:/strawberry/perl/site/lib/REST/Neo4p/Entity.pm line 67" Your help would be greatly appreciated. Thanks. -- *Kevin Pluck* *i**V**endi Limited*
Subject: Re: [rt.cpan.org #92135] AutoReply: Neo4p batches
Date: Tue, 14 Jan 2014 10:31:18 +0000
To: bug-REST-Neo4p [...] rt.cpan.org
From: Kevin Pluck <kevin.pluck [...] ivendi.com>
Looks like you'd need to send some cypher with the post: http://docs.neo4j.org/chunked/milestone/rest-api-cypher.html#rest-api-create-a-node On 14 January 2014 10:17, Bugs in REST-Neo4p via RT < bug-REST-Neo4p@rt.cpan.org> wrote: Show quoted text
> > Greetings, > > This message has been automatically generated in response to the > creation of a trouble ticket regarding: > "Neo4p batches", > a summary of which appears below. > > There is no need to reply to this message right now. Your ticket has been > assigned an ID of [rt.cpan.org #92135]. Your ticket is accessible > on the web at: > > https://rt.cpan.org/Ticket/Display.html?id=92135 > > Please include the string: > > [rt.cpan.org #92135] > > in the subject line of all future correspondence about this issue. To do > so, > you may reply to this message. > > Thank you, > bug-REST-Neo4p@rt.cpan.org > > ------------------------------------------------------------------------- > Hi, > > I was playing with the Neo4p batch module but fell at the first hurdle; I > can't seem to create a node with lables as I can only add labels after a > node has been generated but, of course, in batch mode the node hasn't been > created yet. > > batch { > my $dealerNode = REST::Neo4p::Node->new({source => $source}); > $dealerNode->set_labels("Dealer"); > > ... > > > returns Can't call method "set_labels" on an undefined value. Is it > possible to create a new node with labels? > > Also I had to turn off strict "refs" in Entity.pm as I was getting "Can't > use string ("{3}") as a HASH ref while "strict refs" in use at > C:/strawberry/perl/site/lib/REST/Neo4p/Entity.pm line 67" > > Your help would be greatly appreciated. > > Thanks. > > -- > *Kevin Pluck* > *i**V**endi Limited* >
-- *Kevin Pluck* *i**V**endi Limited*
Thanks Kevin- I probably need to instrument set_labels etc for batch processing, I'm pretty sure it should work theoretically. I will have a look- appreciate the ticket- MAJ On Tue Jan 14 05:17:32 2014, kevin.pluck@ivendi.com wrote: Show quoted text
> Hi, > > I was playing with the Neo4p batch module but fell at the first hurdle; I > can't seem to create a node with lables as I can only add labels after a > node has been generated but, of course, in batch mode the node hasn't been > created yet. > > batch { > my $dealerNode = REST::Neo4p::Node->new({source => $source}); > $dealerNode->set_labels("Dealer"); > > ... > > > returns Can't call method "set_labels" on an undefined value. Is it > possible to create a new node with labels? > > Also I had to turn off strict "refs" in Entity.pm as I was getting "Can't > use string ("{3}") as a HASH ref while "strict refs" in use at > C:/strawberry/perl/site/lib/REST/Neo4p/Entity.pm line 67" > > Your help would be greatly appreciated. > > Thanks. >
Kevin -- seems to work fine for me. Can you run the attached test for me and let me know the output? thanks MAJ On Sat Jan 18 12:08:29 2014, MAJENSEN wrote: Show quoted text
> > Thanks Kevin- I probably need to instrument set_labels etc for batch > processing, I'm pretty sure it should work theoretically. I will have > a look- > appreciate the ticket- > MAJ > On Tue Jan 14 05:17:32 2014, kevin.pluck@ivendi.com wrote:
> > Hi, > > > > I was playing with the Neo4p batch module but fell at the first > > hurdle; I > > can't seem to create a node with lables as I can only add labels > > after a > > node has been generated but, of course, in batch mode the node hasn't > > been > > created yet. > > > > batch { > > my $dealerNode = REST::Neo4p::Node->new({source => $source}); > > $dealerNode->set_labels("Dealer"); > > > > ... > > > > > > returns Can't call method "set_labels" on an undefined value. Is it > > possible to create a new node with labels? > > > > Also I had to turn off strict "refs" in Entity.pm as I was getting > > "Can't > > use string ("{3}") as a HASH ref while "strict refs" in use at > > C:/strawberry/perl/site/lib/REST/Neo4p/Entity.pm line 67" > > > > Your help would be greatly appreciated. > > > > Thanks. > >
Subject: rt_92135.t
#$Id: rt_92135.t 333 2014-01-19 01:20:37Z maj $ use Test::More qw/no_plan/; use Test::Exception; use Module::Build; use lib '../lib'; use REST::Neo4p; use REST::Neo4p::Batch; use strict; use warnings; no warnings qw(once); my $build; my ($user,$pass); my $test_index = '828e55b1_d050_41e9_8d9e_68c25f72275c'; my ($dealerNode, $index); eval { $build = Module::Build->current; $user = $build->notes('user'); $pass = $build->notes('pass'); }; my $TEST_SERVER = $build ? $build->notes('test_server') : 'http://127.0.0.1:7474'; my $num_live_tests = 6; my $not_connected; eval { REST::Neo4p->connect($TEST_SERVER,$user,$pass); }; if ( my $e = REST::Neo4p::CommException->caught() ) { $not_connected = 1; diag "Test server unavailable : tests skipped"; } SKIP : { skip 'no local connection to neo4j', $num_live_tests if $not_connected; my $version = REST::Neo4p->neo4j_version; my $VERSION_OK = REST::Neo4p->_check_version(2,0); my $source = 'flerb'; SKIP : { skip "Server version $version < 2.0", $num_live_tests unless $VERSION_OK; eval { batch { ok $dealerNode = REST::Neo4p::Node->new({source => $source}), 'create node in batch'; ok $dealerNode->set_labels("Dealer"), 'set label in batch'; } 'keep_objs'; }; if ($@) { fail $@ } else { pass 'batch ran ok' } isa_ok $dealerNode, 'REST::Neo4p::Node'; ok grep (/Dealer/,$dealerNode->get_labels), 'node label is set after batch run'; is $dealerNode->get_property('source'), $source, 'source property is set after batch'; } } END { $dealerNode && $dealerNode->remove; $index && $index->remove; }
Sorry, pls use the attached version of test-- thanks MAJ On Sat Jan 18 20:26:19 2014, MAJENSEN wrote: Show quoted text
> Kevin -- seems to work fine for me. Can you run the attached test for > me and let me know the output? > thanks MAJ > On Sat Jan 18 12:08:29 2014, MAJENSEN wrote:
> > > > Thanks Kevin- I probably need to instrument set_labels etc for batch > > processing, I'm pretty sure it should work theoretically. I will have > > a look- > > appreciate the ticket- > > MAJ > > On Tue Jan 14 05:17:32 2014, kevin.pluck@ivendi.com wrote:
> > > Hi, > > > > > > I was playing with the Neo4p batch module but fell at the first > > > hurdle; I > > > can't seem to create a node with lables as I can only add labels > > > after a > > > node has been generated but, of course, in batch mode the node > > > hasn't > > > been > > > created yet. > > > > > > batch { > > > my $dealerNode = REST::Neo4p::Node->new({source => > > > $source}); > > > $dealerNode->set_labels("Dealer"); > > > > > > ... > > > > > > > > > returns Can't call method "set_labels" on an undefined value. Is > > > it > > > possible to create a new node with labels? > > > > > > Also I had to turn off strict "refs" in Entity.pm as I was getting > > > "Can't > > > use string ("{3}") as a HASH ref while "strict refs" in use at > > > C:/strawberry/perl/site/lib/REST/Neo4p/Entity.pm line 67" > > > > > > Your help would be greatly appreciated. > > > > > > Thanks. > > >
Subject: rt_92135.t
#$Id: rt_92135.t 334 2014-01-19 01:27:06Z maj $ use Test::More tests => 6; use Module::Build; use lib '../lib'; use REST::Neo4p; use REST::Neo4p::Batch; use strict; use warnings; no warnings qw(once); my $build; my ($user,$pass); my $dealerNode; eval { $build = Module::Build->current; $user = $build->notes('user'); $pass = $build->notes('pass'); }; my $TEST_SERVER = $build ? $build->notes('test_server') : 'http://127.0.0.1:7474'; my $num_live_tests = 6; my $not_connected; eval { REST::Neo4p->connect($TEST_SERVER,$user,$pass); }; if ( my $e = REST::Neo4p::CommException->caught() ) { $not_connected = 1; diag "Test server unavailable : tests skipped"; } SKIP : { skip 'no local connection to neo4j', $num_live_tests if $not_connected; my $version = REST::Neo4p->neo4j_version; my $VERSION_OK = REST::Neo4p->_check_version(2,0); my $source = 'flerb'; SKIP : { skip "Server version $version < 2.0", $num_live_tests unless $VERSION_OK; eval { batch { ok $dealerNode = REST::Neo4p::Node->new({source => $source}), 'create node in batch'; ok $dealerNode->set_labels("Dealer"), 'set label in batch'; } 'keep_objs'; }; if ($@) { fail $@ } else { pass 'batch ran ok' } isa_ok $dealerNode, 'REST::Neo4p::Node'; ok grep (/Dealer/,$dealerNode->get_labels), 'node label is set after batch run'; is $dealerNode->get_property('source'), $source, 'source property is set after batch'; } } END { $dealerNode && $dealerNode->remove; }
Subject: Re: [rt.cpan.org #92135] Neo4p batches
Date: Sun, 19 Jan 2014 16:12:48 +0000
To: bug-REST-Neo4p [...] rt.cpan.org
From: Kevin Pluck <kevin.pluck [...] ivendi.com>
Thanks Mark, I've run the tests and they all passed. Unfortunately I didn't keep my original code that was failing so I can't replicate the issue. I simply appended all the cypher together that I wanted to execute which did the trick. The job I'm doing is a one-off so not concerned about proper implementation. But am curious as to what I did wrong! Next time I need to implement a batch then I shall refer to this email. Thanks for your help, apologies for taking up your time! Kevin. On 19 January 2014 01:28, Mark Allen Jensen via RT < bug-REST-Neo4p@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=92135 > > > Sorry, pls use the attached version of test-- thanks MAJ > > On Sat Jan 18 20:26:19 2014, MAJENSEN wrote:
> > Kevin -- seems to work fine for me. Can you run the attached test for > > me and let me know the output? > > thanks MAJ > > On Sat Jan 18 12:08:29 2014, MAJENSEN wrote:
> > > > > > Thanks Kevin- I probably need to instrument set_labels etc for batch > > > processing, I'm pretty sure it should work theoretically. I will have > > > a look- > > > appreciate the ticket- > > > MAJ > > > On Tue Jan 14 05:17:32 2014, kevin.pluck@ivendi.com wrote:
> > > > Hi, > > > > > > > > I was playing with the Neo4p batch module but fell at the first > > > > hurdle; I > > > > can't seem to create a node with lables as I can only add labels > > > > after a > > > > node has been generated but, of course, in batch mode the node > > > > hasn't > > > > been > > > > created yet. > > > > > > > > batch { > > > > my $dealerNode = REST::Neo4p::Node->new({source => > > > > $source}); > > > > $dealerNode->set_labels("Dealer"); > > > > > > > > ... > > > > > > > > > > > > returns Can't call method "set_labels" on an undefined value. Is > > > > it > > > > possible to create a new node with labels? > > > > > > > > Also I had to turn off strict "refs" in Entity.pm as I was getting > > > > "Can't > > > > use string ("{3}") as a HASH ref while "strict refs" in use at > > > > C:/strawberry/perl/site/lib/REST/Neo4p/Entity.pm line 67" > > > > > > > > Your help would be greatly appreciated. > > > > > > > > Thanks. > > > >
> > > >
-- *Kevin Pluck* *i**V**endi Limited*
Subject: Re: [rt.cpan.org #92135] Neo4p batches
Date: Sun, 19 Jan 2014 13:14:14 -0500
To: bug-REST-Neo4p [...] rt.cpan.org
From: Mark Jensen <jensen [...] fortinbras.us>
No problem Kevin, any time. Glad it's working for you- MAJ Sent from my T-Mobile 4G LTE Device Show quoted text
-------- Original message -------- From: Kevin Pluck via RT <bug-REST-Neo4p@rt.cpan.org> Date: 01/19/2014 11:12 AM (GMT-05:00) To: Subject: Re: [rt.cpan.org #92135] Neo4p batches        Queue: REST-Neo4p Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=92135 > Thanks Mark, I've run the tests and they all passed. Unfortunately I didn't keep my original code that was failing so I can't replicate the issue. I simply appended all the cypher together that I wanted to execute which did the trick. The job I'm doing is a one-off so not concerned about proper implementation.  But am curious as to what I did wrong! Next time I need to implement a batch then I shall refer to this email. Thanks for your help, apologies for taking up your time! Kevin. On 19 January 2014 01:28, Mark Allen Jensen via RT < bug-REST-Neo4p@rt.cpan.org> wrote:
> <URL: https://rt.cpan.org/Ticket/Display.html?id=92135 > > > Sorry, pls use the attached version of test-- thanks MAJ > > On Sat Jan 18 20:26:19 2014, MAJENSEN wrote:
> > Kevin -- seems to work fine for me. Can you run the attached test for > > me and let me know the output? > > thanks MAJ > > On Sat Jan 18 12:08:29 2014, MAJENSEN wrote:
> > > > > > Thanks Kevin- I probably need to instrument set_labels etc for batch > > > processing, I'm pretty sure it should work theoretically. I will have > > > a look- > > > appreciate the ticket- > > > MAJ > > > On Tue Jan 14 05:17:32 2014, kevin.pluck@ivendi.com wrote:
> > > > Hi, > > > > > > > > I was playing with the Neo4p batch module but fell at the first > > > > hurdle; I > > > > can't seem to create a node with lables as I can only add labels > > > > after a > > > > node has been generated but, of course, in batch mode the node > > > > hasn't > > > > been > > > > created yet. > > > > > > > > batch { > > > >        my $dealerNode = REST::Neo4p::Node->new({source => > > > > $source}); > > > >        $dealerNode->set_labels("Dealer"); > > > > > > > > ... > > > > > > > > > > > > returns Can't call method "set_labels" on an undefined value.  Is > > > > it > > > > possible to create a new node with labels? > > > > > > > > Also I had to turn off strict "refs" in Entity.pm as I was getting > > > > "Can't > > > > use string ("{3}") as a HASH ref while "strict refs" in use at > > > > C:/strawberry/perl/site/lib/REST/Neo4p/Entity.pm line 67" > > > > > > > > Your help would be greatly appreciated. > > > > > > > > Thanks. > > > >
> > > >
-- *Kevin Pluck* *i**V**endi Limited*