Re: [Neo4j] OnlineBackup component being upgraded (WasRe: Unrecovable transaction error)

2011-02-10 Thread Gian Luca Farina Perseu
Thanks to all, Peter and Mattias !!

We will try soon !!!

Cheers.

On Wed, Feb 9, 2011 at 8:31 PM, Peter Neubauer
 wrote:
> And the test code has moved here:
>
> https://github.com/neo4j/graphdb/blob/master/com/src/main/java/org/neo4j/com/backup/OnlineBackup.java
>
> /peter
>
> On Wed, Feb 9, 2011 at 8:01 PM, Mattias Persson
>  wrote:
>> 2011/2/9 Gian Luca Farina Perseu 
>>
>>> Thank you Peter !
>>>
>>> Message for Mattias:
>>>
>>> the link you provided
>>>
>>>
>>> https://github.com/neo4j/graphdb/blob/master/backup/src/main/java/org/neo4j/backup/OnlineBackup.java
>>>
>>> return 404 :-(
>>>
>>> In any case, if you say that this weekend this component will be
>>> integrated into milestone ... I can wait for it ;-)
>>>
>>
>> Exactly, it won't require HA... you can do it off of a normal
>> EmbeddedGraphDatabase. With this next milestone there'll be a (at the least)
>> decent documentation about how to use the new and great backup utility.
>>
>>>
>>> Thank you very much !
>>>
>>> Cheers.
>>>
>>> On Wed, Feb 9, 2011 at 6:11 PM, Peter Neubauer
>>>  wrote:
>>> > Gian,
>>> > no, the message is that the new Online Backup component is using the
>>> > same communication protocols as HA, but does not require HA and
>>> > ZooKeeper to be set up.
>>> >
>>> > So, using the code Mattias pointed out, you should be able to back up
>>> > a running embedded 1.3 Neo4j DB out of the 1.3 box. The next milestone
>>> > will hopefully include this code (due this week).
>>> >
>>> > So, even without HA setup, the Online Backup can be used to do both
>>> > full and incremental backups.
>>> >
>>> > If you have questions, feel free to ask more!
>>> >
>>> > /peter
>>> >
>>> > On Wed, Feb 9, 2011 at 5:53 PM, Gian Luca Farina Perseu
>>> >  wrote:
>>> >> Sorry for delay in response, but I follow older thread and I miss this
>>> >> response :-(
>>> >>
>>> >> Peter, yes I was using 1.2 M2 with Neo4jBackup class for onlinebackup
>>> >> BUT  the (previous indicated) bug obligate me to run on latest 1.3.
>>> >> I tried to use 1.2 after db recovery but the error (nullPointer on
>>> >> lucene) persist and now it's running all the day without issue.
>>> >>
>>> >> I have some users that are heavly inserting data into the DB  in
>>> >> this phase I need to create periodical backups without stop the
>>> >> server.
>>> >>
>>> >> Keep in mind, I'm using embedded server without any remote interface !!
>>> >>
>>> >> So, I don't understand your response (and Mattias also)  is the
>>> >> online backup feature ONLY available in High Availability logic ? So,
>>> >> how can I provide online backup without High Availability ?
>>> >>
>>> >> At the moment I cannot use 1.2, I need to run on 1.3 but 1.3 does not
>>> >> provide onlinebackup  :-((
>>> >>
>>> >> Any advice ?
>>> >>
>>> >> Thanks !
>>> >>
>>> >> Gianluca Farina Perseu
>>> >> skype: farinaperseu
>>> >>
>>> >> On Wed, Feb 9, 2011 at 9:09 AM, Peter Neubauer
>>> >>  wrote:
>>> >>> Gian and all,
>>> >>> we are moving the OnlineBackup component onto the Hich Availability
>>> >>> logic. It will be included into Neo4j 1.3, but we didn't move the
>>> >>> OnlineBackup Component over to GITHub, so for the time being, it is
>>> >>> not included in the milestone releases.
>>> >>>
>>> >>> Gian, are you actively using OnlineBackup? Let's connect and sort out
>>> >>> how to best move!
>>> >>>
>>> >>> If you are using the component, please consider staying on 1.2 or
>>> >>> contact us so we can solve your usecase while we are on milestones, if
>>> >>> you need it.
>>> >>>
>>> >>> Thanks for your consideration!
>>> >>>
>>> >>> /peter
>>> >>>
>>> >>> On Wed, Feb 9, 2011 at 8:00 AM, Gian Luca Farina Perseu
>>> >>>  wrote:
>>>  Starting from now I'll try to use M3  but with this release I have
>>>  this error related to
>>> 
>>>   java.lang.NoClassDefFoundError: org/neo4j/onlinebackup/Neo4jBackup
>>> 
>>>  I didn't check yet in documentation (I'm involved in some other topics
>>>  ...) . Neo4jBackup is simply missing from build or backup
>>>  management is different from M2 ?
>>> 
>>>  Many thanks !!
>>> 
>>>  --
>>> 
>>>  [INFO] BaseResource - 2011.02.09 08:00:02 - ServiceResource
>>> Constructor.
>>>  [INFO] TimeoutHandler - Time: Wed Feb 09 08:00:02 CET 2011
>>>  9-feb-2011 8.00.02
>>>  org.neo4j.kernel.impl.transaction.xaframework.XaLogicalLog
>>>  doInternalRecovery
>>>  INFO: Non clean shutdown detected on log
>>>  [\temp\graphdb\neo4j_online_backup\nioneo_logical.log.1]. Recovery
>>>  started ...
>>>  extension:org.neo4j.kernel.KernelExtension[online backup]
>>>  extension:org.neo4j.graphdb.index.IndexProvider[lucene]
>>>  9-feb-2011 8.00.02
>>>  org.neo4j.kernel.impl.transaction.xaframework.XaLogicalLog
>>>  doInternalRecovery
>>>  INFO: Non clean shutdown detected on log
>>>  [C:\temp\graphdb\neo4j_online_backup\index/lucene.log.1]. Recovery
>>>  started ...
>>> >

Re: [Neo4j] FOLLOW UP? Installing the python bindings ( I think )

2011-02-10 Thread Michael Hunger
Cool, congratulations :)

Have fun with the REST API and please report back any issues so that we can 
improve it.

Thanks

Michael

Am 10.02.2011 um 15:37 schrieb Tom Smith:

> Just to follow up and get some data out of the index ... 
> 
> import os, re
> import simplejson as json
> 
> def match(s, reg):
>   p = re.compile(reg, re.IGNORECASE| re.DOTALL)
>   results = p.findall(s)
>   return results
> 
> def get_data(response_data):
>   ' Avoids the headers'
>   regex = '\r\n\r\n(.*)'
>   results = match(response_data, regex)
>   return results[0]
> 
> def get_node_from_index(index_name, property_value,property_name='name' ):
>   curl_str = '''curl -i -s -H Accept:application/json 
> 'http://localhost:7474/db/data/index/node/%s/%s/%s'  ''' % (index_name, 
> property_name, property_value)
>   print curl_str
>   response = os.popen( curl_str )
>   #print "Errors", response.errors
>   data = response.read( )
>   json_data = get_data(data)
>   python_data = json.loads(json_data)
>   return python_data
> 
> ...produces...
> 
> curl -i -s -H Accept:application/json 
> 'http://localhost:7474/db/data/index/node/medical/name/Hospitality_Recreation'
>  
> 
> [{'traverse': 'http://localhost:7474/db/data/node/29/traverse/{returnType}', 
> 'create_relationship': 'http://localhost:7474/db/data/node/29/relationships', 
> 'self': 'http://localhost:7474/db/data/node/29', 
> 'outgoing_typed_relationships': 
> 'http://localhost:7474/db/data/node/29/relationships/out/{-list|&|types}', 
> 'all_typed_relationships': 
> 'http://localhost:7474/db/data/node/29/relationships/all/{-list|&|types}', 
> 'all_relationships': 
> 'http://localhost:7474/db/data/node/29/relationships/all', 
> 'outgoing_relationships': 
> 'http://localhost:7474/db/data/node/29/relationships/out', 
> 'incoming_typed_relationships': 
> 'http://localhost:7474/db/data/node/29/relationships/in/{-list|&|types}', 
> 'indexed': 
> 'http://localhost:7474/db/data/index/node/medical/name/Hospitality_Recreation/29',
>  'extensions': {'DepthTwo': {'nodesOnDepthTwo': 
> 'http://localhost:7474/db/data/ext/DepthTwo/node/29/nodesOnDepthTwo', 
> 'relationshipsOnDepthTwo': 
> 'http://localhost:7474/db/data/ext/DepthTwo/node/29/relationshipsO
 nD
> epthTwo', 'pathsOnDepthTwo': 
> 'http://localhost:7474/db/data/ext/DepthTwo/node/29/pathsOnDepthTwo'}, 
> 'ShortestPath': {'shortestPath': 
> 'http://localhost:7474/db/data/ext/ShortestPath/node/29/shortestPath'}}, 
> 'incoming_relationships': 
> 'http://localhost:7474/db/data/node/29/relationships/in', 'property': 
> 'http://localhost:7474/db/data/node/29/properties/{key}', 'data': {'type': 
> 'tag', 'name': 'Hospitality_Recreation'}, 'properties': 
> 'http://localhost:7474/db/data/node/29/properties'}]
> 
> 
> 
> 
> 
> 
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] SOLVED? Installing the python bindings ( I think )

2011-02-10 Thread Michael Hunger
Sorry for the misunderstanding and confusion.

Will clean up the docs after adding some facts. (and also mention the "quote" 
problem)

Cheers

Michael
Am 10.02.2011 um 15:21 schrieb Tom Smith:

> So... my scruffy python code looks like this...
> 
> import urllib
> 
> def add_node_to_index(index_name, node_id, property_value,  
> property_name='name' ):
>   ''
>   index_name = urllib.quote(index_name) #i.e "cities"
>   property_value = urllib.quote(property_value) # i.e "New York"
>   property_name = urllib.quote(property_name) # i.e "name"
> 
>   curl_str = '''curl -i -s -HContent-Type:application/json 
> -HAccept:application/json  -X POST -d 
> '"http://localhost:7474/db/data/node/%s";' 
> http://localhost:7474/db/data/index/node/%s/%s/%s ''' % 
> (str(node_id),index_name,property_name, property_value  )
>   print curl_str
>   response = os.popen( curl_str )
>   print "Errors", response.errors
>   data = response.read( )
>   return data
> 
> 
> ...and when I ...
> 
> add_node_to_index("medical", node.id, node['name'])
> 
> ... the url created is ( you are right Michael, those pesky quotes were 
> killing it) ...
> 
> curl -i -s -HContent-Type:application/json -HAccept:application/json  -X POST 
> -d '"http://localhost:7474/db/data/node/29";' 
> http://localhost:7474/db/data/index/node/medical/name/Hospitality_Recreation
> 
> ...and the output is...
> 
> HTTP/1.1 201 Created
> Content-Length: 1585
> Location: 
> http://localhost:7474/db/data/index/node/medical/name/Hospitality_Recreation/29
> Content-Encoding: UTF-8
> Content-Type: application/json
> Access-Control-Allow-Origin: *
> Server: Jetty(6.1.25)
> 
> {
>  "indexed" : 
> "http://localhost:7474/db/data/index/node/medical/name/Hospitality_Recreation/29";,
>  "outgoing_relationships" : 
> "http://localhost:7474/db/data/node/29/relationships/out";,
>  "data" : {
>"name" : "Hospitality_Recreation",
>"type" : "tag"
>  },
>  "traverse" : "http://localhost:7474/db/data/node/29/traverse/{returnType}";,
>  "all_typed_relationships" : 
> "http://localhost:7474/db/data/node/29/relationships/all/{-list|&|types}",
>  "property" : "http://localhost:7474/db/data/node/29/properties/{key}";,
>  "self" : "http://localhost:7474/db/data/node/29";,
>  "properties" : "http://localhost:7474/db/data/node/29/properties";,
>  "outgoing_typed_relationships" : 
> "http://localhost:7474/db/data/node/29/relationships/out/{-list|&|types}",
>  "incoming_relationships" : 
> "http://localhost:7474/db/data/node/29/relationships/in";,
>  "extensions" : {
>"ShortestPath" : {
>  "shortestPath" : 
> "http://localhost:7474/db/data/ext/ShortestPath/node/29/shortestPath";
>},
>"DepthTwo" : {
>  "nodesOnDepthTwo" : 
> "http://localhost:7474/db/data/ext/DepthTwo/node/29/nodesOnDepthTwo";,
>  "relationshipsOnDepthTwo" : 
> "http://localhost:7474/db/data/ext/DepthTwo/node/29/relationshipsOnDepthTwo";,
>  "pathsOnDepthTwo" : 
> "http://localhost:7474/db/data/ext/DepthTwo/node/29/pathsOnDepthTwo";
>}
>  },
>  "create_relationship" : 
> "http://localhost:7474/db/data/node/29/relationships";,
>  "all_relationships" : 
> "http://localhost:7474/db/data/node/29/relationships/all";,
>  "incoming_typed_relationships" : 
> "http://localhost:7474/db/data/node/29/relationships/in/{-list|&|types}"
> }
> 
> ... Now to try and get data out of the index. 
> 
> Thanks
> 
> 
> 
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] FOLLOW UP? Installing the python bindings ( I think )

2011-02-10 Thread Tom Smith
Just to follow up and get some data out of the index ... 

import os, re
import simplejson as json

def match(s, reg):
p = re.compile(reg, re.IGNORECASE| re.DOTALL)
results = p.findall(s)
return results

def get_data(response_data):
' Avoids the headers'
regex = '\r\n\r\n(.*)'
results = match(response_data, regex)
return results[0]

def get_node_from_index(index_name, property_value,property_name='name' ):
curl_str = '''curl -i -s -H Accept:application/json 
'http://localhost:7474/db/data/index/node/%s/%s/%s'  ''' % (index_name, 
property_name, property_value)
print curl_str
response = os.popen( curl_str )
#print "Errors", response.errors
data = response.read( )
json_data = get_data(data)
python_data = json.loads(json_data)
return python_data

...produces...

curl -i -s -H Accept:application/json 
'http://localhost:7474/db/data/index/node/medical/name/Hospitality_Recreation' 

[{'traverse': 'http://localhost:7474/db/data/node/29/traverse/{returnType}', 
'create_relationship': 'http://localhost:7474/db/data/node/29/relationships', 
'self': 'http://localhost:7474/db/data/node/29', 
'outgoing_typed_relationships': 
'http://localhost:7474/db/data/node/29/relationships/out/{-list|&|types}', 
'all_typed_relationships': 
'http://localhost:7474/db/data/node/29/relationships/all/{-list|&|types}', 
'all_relationships': 'http://localhost:7474/db/data/node/29/relationships/all', 
'outgoing_relationships': 
'http://localhost:7474/db/data/node/29/relationships/out', 
'incoming_typed_relationships': 
'http://localhost:7474/db/data/node/29/relationships/in/{-list|&|types}', 
'indexed': 
'http://localhost:7474/db/data/index/node/medical/name/Hospitality_Recreation/29',
 'extensions': {'DepthTwo': {'nodesOnDepthTwo': 
'http://localhost:7474/db/data/ext/DepthTwo/node/29/nodesOnDepthTwo', 
'relationshipsOnDepthTwo': 
'http://localhost:7474/db/data/ext/DepthTwo/node/29/relationshipsOnD
 epthTwo', 'pathsOnDepthTwo': 
'http://localhost:7474/db/data/ext/DepthTwo/node/29/pathsOnDepthTwo'}, 
'ShortestPath': {'shortestPath': 
'http://localhost:7474/db/data/ext/ShortestPath/node/29/shortestPath'}}, 
'incoming_relationships': 
'http://localhost:7474/db/data/node/29/relationships/in', 'property': 
'http://localhost:7474/db/data/node/29/properties/{key}', 'data': {'type': 
'tag', 'name': 'Hospitality_Recreation'}, 'properties': 
'http://localhost:7474/db/data/node/29/properties'}]






___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] SOLVED? Installing the python bindings ( I think )

2011-02-10 Thread Tom Smith
So... my scruffy python code looks like this...

import urllib

def add_node_to_index(index_name, node_id, property_value,  
property_name='name' ):
''
index_name = urllib.quote(index_name) #i.e "cities"
property_value = urllib.quote(property_value) # i.e "New York"
property_name = urllib.quote(property_name) # i.e "name"

curl_str = '''curl -i -s -HContent-Type:application/json 
-HAccept:application/json  -X POST -d '"http://localhost:7474/db/data/node/%s";' 
http://localhost:7474/db/data/index/node/%s/%s/%s ''' % 
(str(node_id),index_name,property_name, property_value  )
print curl_str
response = os.popen( curl_str )
print "Errors", response.errors
data = response.read( )
return data


...and when I ...

add_node_to_index("medical", node.id, node['name'])

 ... the url created is ( you are right Michael, those pesky quotes were 
killing it) ...

curl -i -s -HContent-Type:application/json -HAccept:application/json  -X POST 
-d '"http://localhost:7474/db/data/node/29";' 
http://localhost:7474/db/data/index/node/medical/name/Hospitality_Recreation

...and the output is...

HTTP/1.1 201 Created
Content-Length: 1585
Location: 
http://localhost:7474/db/data/index/node/medical/name/Hospitality_Recreation/29
Content-Encoding: UTF-8
Content-Type: application/json
Access-Control-Allow-Origin: *
Server: Jetty(6.1.25)

{
  "indexed" : 
"http://localhost:7474/db/data/index/node/medical/name/Hospitality_Recreation/29";,
  "outgoing_relationships" : 
"http://localhost:7474/db/data/node/29/relationships/out";,
  "data" : {
"name" : "Hospitality_Recreation",
"type" : "tag"
  },
  "traverse" : "http://localhost:7474/db/data/node/29/traverse/{returnType}";,
  "all_typed_relationships" : 
"http://localhost:7474/db/data/node/29/relationships/all/{-list|&|types}",
  "property" : "http://localhost:7474/db/data/node/29/properties/{key}";,
  "self" : "http://localhost:7474/db/data/node/29";,
  "properties" : "http://localhost:7474/db/data/node/29/properties";,
  "outgoing_typed_relationships" : 
"http://localhost:7474/db/data/node/29/relationships/out/{-list|&|types}",
  "incoming_relationships" : 
"http://localhost:7474/db/data/node/29/relationships/in";,
  "extensions" : {
"ShortestPath" : {
  "shortestPath" : 
"http://localhost:7474/db/data/ext/ShortestPath/node/29/shortestPath";
},
"DepthTwo" : {
  "nodesOnDepthTwo" : 
"http://localhost:7474/db/data/ext/DepthTwo/node/29/nodesOnDepthTwo";,
  "relationshipsOnDepthTwo" : 
"http://localhost:7474/db/data/ext/DepthTwo/node/29/relationshipsOnDepthTwo";,
  "pathsOnDepthTwo" : 
"http://localhost:7474/db/data/ext/DepthTwo/node/29/pathsOnDepthTwo";
}
  },
  "create_relationship" : "http://localhost:7474/db/data/node/29/relationships";,
  "all_relationships" : 
"http://localhost:7474/db/data/node/29/relationships/all";,
  "incoming_typed_relationships" : 
"http://localhost:7474/db/data/node/29/relationships/in/{-list|&|types}"
}

... Now to try and get data out of the index. 

Thanks



___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Installing the python bindings ( I think )

2011-02-10 Thread Michael Hunger
Yes because your post data has to be a valid JSON string

so you have to write
-d '"http://localhost:7474/db/data/node/29";'

wrap the double quotes in single quotes, otherwise json just gets http://...29 
which it can't parse as a string.

the "h" that it complains about is from http :)

Cheers

Michael
Am 10.02.2011 um 14:55 schrieb Tom Smith:

> So... my curl string for ...
> 
> Adding node id 29 to an index called "medical" with an index property name of 
> "name" with a value of "Hospitality_Recreation"
> 
> ...looks like  this ...
> 
> curl -i -s -HAccept:application/json  -HContent-Type:application/json -X POST 
> -d "http://localhost:7474/db/data/node/29"; 
> "http://localhost:7474/db/data/index/node/medical/name/Hospitality_Recreation";
>  
> 
> ... which can't quite be right. I'm getting...
> 
> Unexpected character ('h' (code 104)): expected a valid value (number, 
> String, array, object, 'true', 'false' or 'null')\n at [Source: 
> java.io.StringReader@f0754b8; line: 1, column: 2]
> 
> 
> 
> 
> 
> 
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Installing the python bindings ( I think )

2011-02-10 Thread Tom Smith
So... my curl string for ...

Adding node id 29 to an index called "medical" with an index property name of 
"name" with a value of "Hospitality_Recreation"

...looks like  this ...

curl -i -s -HAccept:application/json  -HContent-Type:application/json -X POST 
-d "http://localhost:7474/db/data/node/29"; 
"http://localhost:7474/db/data/index/node/medical/name/Hospitality_Recreation"; 

... which can't quite be right. I'm getting...

Unexpected character ('h' (code 104)): expected a valid value (number, String, 
array, object, 'true', 'false' or 'null')\n at [Source: 
java.io.StringReader@f0754b8; line: 1, column: 2]






___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Installing the python bindings ( I think )

2011-02-10 Thread Michael Hunger
Yes, you're right, didn't read that piece of code [ graphdb.index("cities") ]

it is graphDb.index().forNodes("cities").add/get

you add the "name" field to the index as otherwise there wouldn't be a 
distinction where "New York" appears (e.g. you have a name field and a 
destination that both can contain "New York" but you just want to get("name", 
"New York" and not those
containing it in the "destination" field. That's the way the Neo4j index API 
was designed. You also need the property names if you want to do querying as 
you have to be able to address the individual properties when comparing them to 
your search values.

Michael

Am 10.02.2011 um 13:28 schrieb Tom Smith:

> 
> On 10 Feb 2011, at 12:11, Michael Hunger wrote:
> 
>> so for your example it would look like:
>> 
>>> curl -Haccept:application/json -HContent-Type:application/json -X POST -d 
>>> '"http://localhost:7474/db/data/node/123";'http://localhost:7474/db/data/index/node/nodes/name/New%20York
>> 
>> Sorry, I thought someone updated the wiki, we had the discussion before. 
>> Will do it now.
> 
> Cheers.. but wouldn't it be...
> 
> curl -Haccept:application/json -HContent-Type:application/json -X POST -d 
> '"http://localhost:7474/db/data/node/123";'http://localhost:7474/db/data/index/node/cities/name/New%20York
> 
> ... if my index name was "cities"?
> 
> I'm slightly unsure why I'd have to specify /name/ too... something that in 
> the python api I don't do to add an item I would just...
> 
> cities[ "New York" ] = new_york_node
> 
> I don't mind giving an index value a "name" but just want to be sure I'm 
> doing it right...
> 
> thanks again
> 
> Tom
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Installing the python bindings ( I think )

2011-02-10 Thread Tom Smith

On 10 Feb 2011, at 12:11, Michael Hunger wrote:

> so for your example it would look like:
> 
>> curl -Haccept:application/json -HContent-Type:application/json -X POST -d 
>> '"http://localhost:7474/db/data/node/123";'http://localhost:7474/db/data/index/node/nodes/name/New%20York
> 
> Sorry, I thought someone updated the wiki, we had the discussion before. Will 
> do it now.

Cheers.. but wouldn't it be...

curl -Haccept:application/json -HContent-Type:application/json -X POST -d 
'"http://localhost:7474/db/data/node/123";'http://localhost:7474/db/data/index/node/cities/name/New%20York

... if my index name was "cities"?

I'm slightly unsure why I'd have to specify /name/ too... something that in the 
python api I don't do to add an item I would just...

cities[ "New York" ] = new_york_node

I don't mind giving an index value a "name" but just want to be sure I'm doing 
it right...

thanks again

Tom














___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Installing the python bindings ( I think )

2011-02-10 Thread Michael Hunger
Tom,

sorry for the confusion.
my_nodes is the index name (you can several index-names per type (node, 
relationship) the default names are "nodes" and "relationships"

so for your example it would look like:

> curl -Haccept:application/json -HContent-Type:application/json -X POST -d 
> '"http://localhost:7474/db/data/node/123";' 
> http://localhost:7474/db/data/index/node/nodes/name/New%20York

Sorry, I thought someone updated the wiki, we had the discussion before. Will 
do it now.

Michael

Am 10.02.2011 um 13:06 schrieb Tom Smith:

> 
> On 9 Feb 2011, at 21:25, Michael Hunger wrote:
> 
>> and this is supported by the REST API, see:
>> http://components.neo4j.org/neo4j-server/milestone/rest.html#Add_to_index
>> 
>> Hope that helps
> 
> It nearly does. In the above example, adding something to an index via curl 
> is documented as...
> 
> curl -HContent-Type:application/json -X POST -d 
> '"http://localhost:7474/db/data/node/123";' 
> http://localhost:7474/db/data/index/node/my_nodes/foo/bar
> 
> ... it's not clear what "my_nodes" is. Is that the index name? As in 
> graphdb.index("cities")?
> 
> And secondly, does each index entry need a key of "foo" with a value of 
> "bar"? As in   {'name': 'New York'}?
> 
> thanks
> 
> Tom
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Traversing by Relationship property

2011-02-10 Thread Michael Hunger
Perhaps leave off the "relationship" restriction. Then you should be able to 
get what you want.


Am 10.02.2011 um 12:43 schrieb Mattias Persson:

> You could use a custom filter (not tested, just written here in the reply):
> 
> {
>"order" : "depth first",
>"uniqueness" : "node",
>"relationships" : [{"type" : "abc", "direction" : "out" }],
>"return filter" :
>{
>"language" : "javascript",
>"body" : "position.length() > 0 &&
> position.lastRelationship().getProperty('number',0) == 1"
>},
>"max depth" : 1
> }
> 
> 
> 2011/2/10 mike_t 
> 
>> 
>> Hi,
>> 
>> i`m using neo4j with the rest api. I have following question about
>> traversing the graph:
>> 
>> Is it possible to get all relationships of a node by a special property?
>> 
>> Example:
>> 
>> Node A has a relationship ("type=abc", property "number=1") to Node B
>> Node A has a relationship ("type=def", property "number=1") to Node C
>> Node A has a relationship ("type=xyz", property "number=1") to Node D
>> 
>> Now, i wanna have all relationships for Node A with relationship property
>> "number=1". The relationship type don´t cares.
>> 
>> When I traverse the graph i have to define the relationship type like:
>> curl -X POST -H Accept:application/json -H Content-Type:application/json -d
>> '{  "order" : "depth first",  "uniqueness" : "node", "relationships" : [{
>> "type" : "abc", "direction" : "out" }], "return filter" : { "language" :
>> "builtin", "name" : "all" }, "max depth" : 1 }'
>> http://localhost:7474/db/data/node/1/traverse/node
>> 
>> Is the only solution to make an index?
>> 
>> Thanks for your answers!
>> --
>> View this message in context:
>> http://neo4j-user-list.438527.n3.nabble.com/Traversing-by-Relationship-property-tp2464461p2464461.html
>> Sent from the Neo4J User List mailing list archive at Nabble.com.
>> ___
>> Neo4j mailing list
>> User@lists.neo4j.org
>> https://lists.neo4j.org/mailman/listinfo/user
>> 
> 
> 
> 
> -- 
> Mattias Persson, [matt...@neotechnology.com]
> Hacker, Neo Technology
> www.neotechnology.com
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Installing the python bindings ( I think )

2011-02-10 Thread Tom Smith

On 9 Feb 2011, at 21:25, Michael Hunger wrote:

> and this is supported by the REST API, see:
> http://components.neo4j.org/neo4j-server/milestone/rest.html#Add_to_index
> 
> Hope that helps

It nearly does. In the above example, adding something to an index via curl is 
documented as...

curl -HContent-Type:application/json -X POST -d 
'"http://localhost:7474/db/data/node/123";' 
http://localhost:7474/db/data/index/node/my_nodes/foo/bar

... it's not clear what "my_nodes" is. Is that the index name? As in 
graphdb.index("cities")?

And secondly, does each index entry need a key of "foo" with a value of "bar"? 
As in   {'name': 'New York'}?

thanks

Tom














___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Traversing by Relationship property

2011-02-10 Thread Mattias Persson
You could use a custom filter (not tested, just written here in the reply):

{
"order" : "depth first",
"uniqueness" : "node",
"relationships" : [{"type" : "abc", "direction" : "out" }],
"return filter" :
{
"language" : "javascript",
"body" : "position.length() > 0 &&
position.lastRelationship().getProperty('number',0) == 1"
},
"max depth" : 1
}


2011/2/10 mike_t 

>
> Hi,
>
> i`m using neo4j with the rest api. I have following question about
> traversing the graph:
>
> Is it possible to get all relationships of a node by a special property?
>
> Example:
>
> Node A has a relationship ("type=abc", property "number=1") to Node B
> Node A has a relationship ("type=def", property "number=1") to Node C
> Node A has a relationship ("type=xyz", property "number=1") to Node D
>
> Now, i wanna have all relationships for Node A with relationship property
> "number=1". The relationship type don´t cares.
>
> When I traverse the graph i have to define the relationship type like:
> curl -X POST -H Accept:application/json -H Content-Type:application/json -d
> '{  "order" : "depth first",  "uniqueness" : "node", "relationships" : [{
> "type" : "abc", "direction" : "out" }], "return filter" : { "language" :
> "builtin", "name" : "all" }, "max depth" : 1 }'
> http://localhost:7474/db/data/node/1/traverse/node
>
> Is the only solution to make an index?
>
> Thanks for your answers!
> --
> View this message in context:
> http://neo4j-user-list.438527.n3.nabble.com/Traversing-by-Relationship-property-tp2464461p2464461.html
> Sent from the Neo4J User List mailing list archive at Nabble.com.
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Mattias Persson, [matt...@neotechnology.com]
Hacker, Neo Technology
www.neotechnology.com
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Help us make Neo4j better at handling YOUR data

2011-02-10 Thread Tobias Ivarsson
This tool does not gather statistics for string arrays, since they are not
affected by the proposed patch.

The tool still runs, but if there are no String properties, output will be
pretty boring

Cheers,
Tobias

On Wed, Feb 9, 2011 at 7:04 PM, Massimo Lusetti  wrote:

> On Fri, Feb 4, 2011 at 5:13 PM, Tobias Ivarsson
>  wrote:
> > Friends,
> >
> > Please read this, your involvement will make Neo4j more efficient!
>
> Does this run with a db with only String[] data?!
>
> Cheers
> --
> Massimo
> http://meridio.blogspot.com
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Tobias Ivarsson 
Hacker, Neo Technology
www.neotechnology.com
Cellphone: +46 706 534857
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user