Skip to content

Instantly share code, notes, and snippets.

View jexp's full-sized avatar
🐉
Watching the chamaeleon.

Michael Hunger jexp

🐉
Watching the chamaeleon.
View GitHub Profile
@jexp
jexp / nosqlnow.markdown
Created August 22, 2012 21:19
Pre-Canned queries for the NoSQL NOW dataset

Index lookup:

start abk=node:speakers(name="Andreas Kollegger") 
return abk;

return properties & id:

start abk=node:speakers(name="Andreas Kollegger") 
return abk.name, id(abk);
@jexp
jexp / Cypher.java
Created August 30, 2012 14:48
Cypher Queries
ExecutionEngine engine = new ExecutionEngine(graphDB);
String query = "start n=node:Person(name={name})
match n-[:ACTS_IN]->movie<-[:ACTS_IN]-friend
return friend";
ExecutionResult result = engine.query(query, map("name", "Keanu");
for (Map<String,Object> row : result) {
Node friend = row.get("friend");
}
@jexp
jexp / gist:3559295
Created August 31, 2012 21:26
Cypher Webinar Chat
  • Neo Technology: hey everyone, feel free to chat here amongst your peers
  • Neo Technology: Michael was just testing the sound
  • Mylène: We noticed :P
  • fabio: hi guys
  • Andreas Kollegger: key clicks are coming through perfectly :)
  • Michael Nero: Hello everyone!
  • fabio: :)
  • Andoni: Hello!
  • Charlie: Morning
  • Mylène: Afternoon...
@jexp
jexp / gist:5185545
Created March 18, 2013 07:16
opera issues neo4j.org
[18. März 2013 08:11:46] CSS - http://localhost:3000/assets/new/css/main.css
Linked-in stylesheet
Declaration syntax error
Line 293:
*border: 0;
---------------^
[18. März 2013 08:11:46] CSS - http://localhost:3000/assets/new/css/main.css
Linked-in stylesheet
Declaration syntax error
Line 300:
= The Neo4j GraphGist Console =
This is a sample GraphGist explaining some of the base concepts of sharing graphs using http://docs.neo4j.org/chunked/milestone/cypher-query-lang.html[the Cypher query language].
[source,cypher]
----
CREATE ({name:'you'})-[:SEE]->({name:'This GraphGist'})-[:FORK_ON_GITHUB]->(your_gistfile{name:'Your Gist'})
CREATE (your_gistfile)-[:INSERT_ID_HERE]->({name:'Your GraphGist'})
----
@jexp
jexp / demo transactional endpoint.js
Created August 9, 2013 12:11
Neo4j 2.0 Webinar Code& Query Samples
// Transactional Http Endpoint DEMO
// execute single statement
POST /db/data/transaction/commit {"statements":[{"statement":"MATCH (u:User) RETURN u"}]}
// create transaction with first statement
POST /db/data/transaction {"statements":[{"statement":"CREATE (u:User {login:{name}}) RETURN u","parameters":{"name":"Peter"}}]}
// check data is visible within transaction
POST /db/data/transaction/X {"statements":[{"statement":"MATCH (u:User) RETURN u"}]}
@jexp
jexp / UpdatingDoubleArrayFailsTest.java
Last active December 20, 2015 22:39
error in case: get double array (4 elements) property, modify it, write it back, get it again -> wrong values
import org.junit.Before;
import org.junit.Test;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.test.TestGraphDatabaseFactory;
import static org.junit.Assert.assertArrayEquals;
public class DoubleArrayUpdateTest {
@jexp
jexp / import.rb
Created September 27, 2013 12:53
TheMovieDB.org API v3 Neo4j Movie Database Generation with Cypher
# usage ruby import.rb > cineasts.cql
require 'rubygems'
require 'rest-client'
require 'json'
URL = "http://api.themoviedb.org/3"
KEY = "an-themoviedb-api-key"
def get(type,id)
url = "#{URL}/#{type}/#{id}?api_key=#{KEY}&append_to_response=casts"
@jexp
jexp / ActivityResource.java
Last active December 28, 2015 13:19
Example for loading the first n-elements of a Activity Stream with an unmanaged Neo4j-Server-Extension
package org.neo4j.example.activity;
import org.codehaus.jackson.map.ObjectMapper;
import org.neo4j.graphdb.GraphDatabaseService;
import javax.ws.rs.*;
import javax.ws.rs.core.*;
import java.io.IOException;
import java.io.OutputStream;

Holiday Resorts

Kerala is a state in India and popularly known as "God’s own Country". It is very famous for the BackWaters, HouseBoats, Food, Culture. There are numerous resorts, hotels and homestays in Kerala. This application provides a fun and interactive way to find a Resort of your choice.

Domain_Model