I think so, on the issue.

// compatible with back until 1.8 and maybe earlier... will return fast as
long as there aren't millions of empty nodes at the beginning of the file
start n=node(*) return n limit 1;

Wes

On Wed, Dec 18, 2013 at 3:11 PM, Alan Robertson <[email protected]> wrote:

>  Should I open an issue on this?
>
>
>
> On 12/18/2013 11:47 AM, Wes Freeman wrote:
>
>
> And yeah you're right, ::1 doesn't work in the config file (which is odd),
> but if you bind to :: you can connect to ::1. Just tested with my go driver
> using the following connection string:
>    db, err := sql.Open("neo4j-cypher", 
> "http://[::1]:7474/";<http://[::1]:7474/>
> )
>
>  Wes
>
> On Wed, Dec 18, 2013 at 1:22 PM, Alan Robertson <[email protected]> wrote:
>
>>  I meant to say "::1".  Right now, it won't hear local only ipv6
>> connections...
>>
>> But your suggested query doesn't have to touch the data store at all.
>> Right?
>>
>> I would assume that either of the others I gave would touch the data
>> store, and would typically fail of the data store was hung or broken...
>>
>> I would assume your suggested query would not touch the data store.
>>
>> Is that a correct understanding?
>>
>>
>>
>>
>> On 12/18/2013 11:13 AM, Wes Freeman wrote:
>>
>> You can make it listen on :: if you set it in neo4j-server.properties:
>> # Let the webserver only listen on the specified IP. Default is localhost
>> (only
>> # accept local connections). Uncomment to allow any connection. Please
>> see the
>> # security section in the neo4j manual before modifying this.
>> org.neo4j.server.webserver.address=::
>>
>>  My favorite ultra-simple 2.0 query is "RETURN 1;"--which works even if
>> db is totally empty.
>>
>>  Wes
>>
>> On Wed, Dec 18, 2013 at 10:56 AM, Alan Robertson <[email protected]> wrote:
>>
>>>  Thanks for the explanation.  I have always (mistakenly) thought of the
>>> type of the relationship as a sort of property.
>>>
>>> In any case, the script seems to work quite nicely, and is easy to
>>> autogenerate the parameters for from Assimilation discovery information.
>>>
>>> I discovered something surprising (a bug?) about curl -- unless I give
>>> it the -g flag (don't expand globs), then it doesn't like ipv6 IP/port
>>> combinations - like [::ffff:127.0.0.1]:7474.  IMHO, it shouldn't be
>>> trying to glob IP addresses...
>>>
>>> I noticed that neo4j doesn't appear to be ipv6 compliant (i.e., it
>>> doesn't listen on '::').  Is that intentional?
>>>
>>> In any case, the script seems to give neo4j some trivial, but meaningful
>>> exercise.  You have to parse the query, optimize it, create a query plan,
>>> execute it, walk through the results, convert them to JSON and send them
>>> back out the REST interface.  Quite a few things have to be working for it
>>> to succeed.
>>>
>>> Do you have a favorite trivial query that will succeed in any non-empty
>>> neo4j database?
>>>
>>> Do you have a better grep pattern for matching correct output?
>>>
>>>
>>>
>>> On 12/17/2013 11:18 PM, Michael Hunger wrote:
>>>
>>> return type(r)
>>>
>>> Empty curly braces mean no props
>>>
>>> Sent from mobile device
>>>
>>> Am 18.12.2013 um 06:41 schrieb Alan Robertson <[email protected]> 
>>> <[email protected]>:
>>>
>>>
>>>  The query in the script below produces the following output:
>>> {"results":[{"columns":["one","rel","two"],"data":[{"row":[{"domain":"metadata","nodetype":"CMAclass","name":"HbRing"},{},{"domain":"metadata","nodetype":"CMAclass","name":"CMAclass"}]}]}],"errors":[]}
>>>
>>> What I noticed is that the relationship shows up as {}.  Do I need to
>>> change the query to get the relationship type?  [See the script below
>>> for the query]
>>>
>>> In any case, below is a script which does a passable job of seeing if
>>> Neo4j is operational (and not dead, comatose, or laying on the ground
>>> twitching)...  I'm going to write an OCF resource agent using it - so I
>>> can monitor neo4j "properly".  And I could also make it highly-available
>>> using Pacemaker...
>>>
>>> It can use either wget or curl to talk to Neo4j.
>>>
>>> #
>>> #    Simple script to monitor Neo4j for basic operation
>>> #
>>> #    Potential inputs to this script are:
>>> #    ipport:    IP-port combination of the neo4j REST server
>>> #    cypher:    Cypher query string
>>> #    regex:     Regular expression to match server output against
>>> #    grepflags: flags to give grep
>>> ipport='127.0.0.1:7474'
>>> ipport='[::ffff:127.0.0.1]:7474'
>>> cypher="START one=node(*) RETURN one LIMIT 1"
>>> #    Need at least one node and one relationship for this one to succeed...
>>> cypher="START one=node(*) MATCH one-[rel]->two RETURN one, rel, two LIMIT 1"
>>> regex='^{ *"results" *: *\[.*\] *, *"errors" *: *\[ *\] *}$'
>>> grepflags=""
>>> #
>>> #    Other variables in the script
>>> #    queryjson:    JSON-encapsulated version of cypher query
>>> #    committrans:  url suffix for committing transactions in one go
>>> #    URL:          URL to give to Neo4j REST service
>>> #    header:       Extra header information to give REST service (i.e.,
>>> Content-type)
>>> queryjson="{\"statements\" : [ { \"statement\" : \"$cypher\" } ] }"
>>> committrans='db/data/transaction/commit'
>>> URL=http://${ipport}/${committrans}
>>> header='Content-type: application/json'
>>> use_wget=1
>>>
>>> runquery() {
>>>    if
>>>      [ "$use_wget" -eq 1 ]
>>>    then
>>>      wget -q    --header="${header}" --post-data="$queryjson"
>>> --output-document=- $URL
>>>    else
>>>      curl -s -g --header "${header}" --data      "$queryjson"  --output
>>> -          $URL
>>>    fi
>>> }
>>> monitor() {
>>>    runquery | grep ${grepflags} "${regex}" >/dev/null
>>> }
>>> runquery
>>> monitor
>>> rc=$?
>>> echo $rc
>>> exit $rc
>>>
>>>
>>>
>>> --
>>>    Alan Robertson <[email protected]> <[email protected]> - @OSSAlanR
>>>
>>> "Openness is the foundation and preservative of friendship...  Let me claim 
>>> from you at all times your undisguised opinions." - William Wilberforce
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "Neo4j" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to [email protected].
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>> --
>>>     Alan Robertson <[email protected]> <[email protected]> - @OSSAlanR
>>>
>>> "Openness is the foundation and preservative of friendship...  Let me claim 
>>> from you at all times your undisguised opinions." - William Wilberforce
>>>
>>>
>>
>>
>> --
>>     Alan Robertson <[email protected]> <[email protected]> - @OSSAlanR
>>
>> "Openness is the foundation and preservative of friendship...  Let me claim 
>> from you at all times your undisguised opinions." - William Wilberforce
>>
>>
>
>
> --
>     Alan Robertson <[email protected]> <[email protected]> - @OSSAlanR
>
> "Openness is the foundation and preservative of friendship...  Let me claim 
> from you at all times your undisguised opinions." - William Wilberforce
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to