Skip to content

Instantly share code, notes, and snippets.

View ikwattro's full-sized avatar

Christophe Willemsen ikwattro

View GitHub Profile
[0] => Array
(
[n] => Array
(
[firstname] => Rhoda
[lastname] => Feeney
)
[COLLECT(r)] => Array
(
@ikwattro
ikwattro / query.php
Created July 26, 2015 10:13
issue stefan
$q = 'MATCH (n:Person) OPTIONAL MATCH (n)-[r]->(m) RETURN DISTINCT n,COLLECT(r),m';
$result = $client->sendCypherQuery($q)->getResult();
print_r($result->getTableFormat());
@ikwattro
ikwattro / instructions.md
Created July 25, 2015 19:13
Live Transaction with Neo4j's PHP NeoClient

Using live transactions can have some benefits :

  • Having a result of the transaction for each statement
  • Replicating batch process and benefit of the Cypher Transactional endpoint
  • Using the same transaction between multiple http requests

How-to:

  1. Open the transaction, you don't have to care about transaction ids etc.., all is handled by the transaction object you receive back
@ikwattro
ikwattro / User.php
Created July 23, 2015 23:14
OGM Thoughts
<?php
namespace Play\Entities;
use Fathom\Runtime\Annotation as OGM;
/**
* @OGM\Entity(labels="User")
*/
class User

My pi runs a raspbian distro (2013-09-25-wheezy-raspbian.zip)

Java

What the raspberry page officially recommends is the jdk. (Source: http://www.raspberrypi.org/archives/4920).

sudo apt-get update && sudo apt-get install oracle-java7-jdk

However, this doesn't include a server on the pi. The jre needs to be installed instead.

d	h	m	c
9	0	0	359
9	0	1	328
9	0	2	324
9	0	3	464
9	0	4	397
9	0	5	405
9	0	6	318
9	0	7	310
@ikwattro
ikwattro / neo4j-cli
Last active August 29, 2015 14:23 — forked from jexp/neo4j-cli
#!/bin/bash
echo "Usage bin/neo4j-cli [path/to/db] [host-or-ip] [port]"
DIR=${0%%neo4j-cli}
DB=${1-data/graph.db}
IP=${2-127.0.0.1}
PORT=${3-7474}
CONFIG=${DIR}../conf/neo4j-server.properties
#!/bin/bash
# usage neo.sh [-h host:port] [-u user:pass] [cmd]
# end cypher statements with semicolon
# terminate read loop with ^d or return
HOST="localhost:7474"
if [ "$1" == "-h" ]; then
shift; HOST="$1";shift;
fi
AUTH=""
@ikwattro
ikwattro / resources.md
Last active August 29, 2015 14:23
Resources Neo4j
@ikwattro
ikwattro / response.txt
Last active August 29, 2015 14:21
Neo4j result format for paths
Array
(
[results] => Array
(
[0] => Array
(
[columns] => Array
(
[0] => path
)