neo4j: load2neo not working with arrays - neo4j

I'm trying to use load2neo to read in a graph in Geoff format (which I wrote out using load2neo!). The extension is installed properly and works with simple queries:
$ curl -X POST http://localhost:7474/load2neo/load/geoff -d '(alice)-[:KNOWS]->(bob)'
returns:
{"alice":70,"bob":69}
and
$ curl -X POST http://localhost:7474/load2neo/load/geoff -d '(bob)-[:KNOWS]->(carol)'
{"carol":72,"bob":71}
Both show up fine in the graph browser. But when I try to do both at once:
curl -X POST http://localhost:7474/load2neo/load/geoff -d '[(alice)<-[:KNOWS]->(bob),(bob)-[:KNOWS]->(carol)]'
it fails silently. It also fails silently with:
curl -X POST http://localhost:7474/load2neo/load/geoff -d #test.geoff
with the file contents:
[(alice)-[:KNOWS]->(bob),(bob)-[:KNOWS]->(carol)]
It's not an authentication problem, I don't think I have the syntax wrong (I've copied it directly from the files that load2neo itself output, and double-checked it against the spec), but I just can't figure out why it's not working. Any ideas?
This is with load2neo 0.6.0 downloaded from the website and Neo4J 2.3.1, community edition.

Related

Using REST API to deploy Liberty Docker containers

Has anyone been able to use the WebSphere Liberty REST API to deploy remote Docker containers? The docs describe all the steps, but I am not able to repeat the results. I get an error when calling REST deploy function (details are posted on the other forum).
If anyone was able to do it - please let me know and would be great if you share how you were able to do it.
Not long after posting this question I tried using the curl command with the JSON header spec and now it works. Here is the curl command I am using that works:
curl --verbose --insecure -X POST --data #docker_deploy.json --header "Content-Type: application/json" -u ${ADMIN_USER}:${ADMIN_PASSWORD} https://${CONTROLLER_HOST_NAME}:${CONTROLLER_PORT}/ibm/api/collective/v1/deployment/deploy

How can I test a Rails app using WGET

I want to test my rails app using "wget", specifically the part that returns JSON-data. I don't really understand the syntax I should use. I have tried this:
wget --user=username#example.com --password=somepass localhost:3000/folders/1.json
and variations of it, without any success. Which is the exact syntax? Would it be better to use CURL instead?
-- edit --
I found at this blog:
http://blogs.operationaldynamics.com/andrew/software/research/testing-rest-the-hard-way
this suggestion:
$ wget -S -q --header "Accept: application/json" -O - http://localhost:3000/folders/1
but even when I add
--user=username#example.com --password=somepass
...I get 401 Unauthorised. The username is correct, I can login via the browser.
curl -u username:password http://localhost:3000/folders/1.json
Read more here http://curl.haxx.se/docs/manpage.html#-u
An alternative to curl is the less well known but equally capable httpie - https://github.com/jkbrzt/httpie - I find it to be a bit more straightforward and friendly to use, and includes syntax colouring for output.
http -a user:pass :3030/folders/1.json would do the trick here, I think.

Single quote formatting issue in curl syntax

I integrated linkedin with Rails 4 and trying to share post on linkedin.
I used curl in rails and post on linked-in wall using below curl post. I used below code in rails console and its work fine but when i used it in rails code with system and single quote then issue create because already single quote use in inside.
system 'curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"comment":"hello from system www.google.com! http://google.com","visibility":{"code":"anyone"}}' https://api.linkedin.com/v1/people/~/shares?oauth2_access_token=xxxxxXygzp_8E3xxvg7_7FaxxxxxxnxtWzBXAxxxxa0wta5z1MVK6-kubHJ5JxxxndpAMc_CxmCsIHxFlxxx0t_WNEhxxxMz8_cKpeOidAxxx5-X-MdvzYVxxQ&format=json&title=linkedin HTTP/1.1'
What do I have to add to resolve this issue? I tried a lot then I posted here.
Thanks in advance.
In your application (as opposed to in the terminal), I suggest you use an HTTP library (I use HTTParty, but there are many options).

Multi files upload using curl to ruby on rails app

I'm struggling about how I can send an unknow number of files to my rails app using curl.
This is my curl request to POST with one file :
curl -H 'Authorization: Token token=your_token' -X POST -F job[webapp_id]=2 -F job[file]=#test.txt localhost:3000/api/v0/jobs
It works.
I would like to allow the user to send as much as file as he wants with something like :
-F job[files][]=#test1.txt -F job[files][]=#test2.txt
-F job[files[]]=#test1.txt -F job[files[]]=#test2.txt
But it's not working.
I also tried with :
-F job[files[0]]=#test.txt -F job[files[1]]=#test2.txt
Still not working. I think it's because I don't know how to tweak my permit parameters. I get an empty array.
Any idea on how to do it with one request ?
RestClient may be easier to work with.

PhantomJS - sending a POST from the cmd w/ Curl isn't working

I'm getting an error when I tried to post the sample codes found in your documentation http://www.highcharts.com/docs/export-module/render-charts-serverside.
Here is the screencast when I tried to start PhantomJS through commandline.
http://www.screencast.com/t/rDcPYZOi1
Here is the error when I tried to post through commandline using curl.
http://www.screencast.com/t/GnYoMBsUqXfR
Here are the other details that might be probably helpful for investigating what is cause of the error.
Files that were all in one location.
http://www.screencast.com/t/VJ7aK6igSTha
I have also tried to run this code through commandline **"phantomjs highcharts-convert.js -infile options.json -outfile chartTest.png -scale 2.5 -width 300 "** and it works and rendered a graph.
http://www.screencast.com/t/G3U2QatAjgU
Just let me know if you need any other details to solve the issue.
Okay, the problem is with extra spaces and using ' in CLI.
Working JSON example for windows CURL:
curl -H "Content-Type: application/json" -X POST -d "{\"infile\":\"{series:[{data:[29.9,71.5,106.4]}]}\"}" 127.0.0.1:8080

Resources