This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.iws | |
*.ipr | |
*.iml | |
.classpath | |
.DS_Store | |
.project | |
.settings | |
*.launch | |
*.tmproj | |
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// hackish script for upgrading a neo4j datastore | |
// uncomment one of Grab annotations below to match the desired target version of neo4j | |
def cli = new CliBuilder(usage: 'upgrade_neo4j.groovy -[h] [graphdb-directory]', | |
header: ''' | |
upgrades a Neo4j database to any desired versions. Notes: | |
* take backup before running this | |
* upgrades must be done step-by-step, e.g. 1.5 -> 1.6, 1.6 -> 1.7 | |
* to specify the upgrade for a step, enable the @Grab line in the script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Grab(group = 'org.neo4j', module='neo4j-community', version='1.8.M06') | |
import org.neo4j.kernel.EmbeddedGraphDatabase | |
import org.neo4j.cypher.ExecutionEngine | |
import org.neo4j.cypher.ExecutionResult | |
import org.neo4j.graphdb.Direction | |
import org.neo4j.graphdb.Node | |
import org.neo4j.tooling.GlobalGraphOperations | |
def dir = '/tmp/poc' | |
new File(dir).deleteDir(); // clean up directory from prev. runs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Grab(group="org.neo4j", module="neo4j-community", version="1.9.M05") | |
import org.neo4j.graphdb.* | |
// make sure we start with empty dir | |
def graphDbDir = "/tmp/neo4j-dummy" | |
new File(graphDbDir).deleteDir() | |
def graphDb = new org.neo4j.kernel.EmbeddedGraphDatabase(graphDbDir) | |
def indexer = graphDb.index().relationshipAutoIndexer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@GrabResolver(name='grails-core', root='http://repo.grails.org/grails/core') | |
@Grab(group='org.grails', module='grails-datastore-gorm-mongo', version='1.0.0.BUILD-SNAPSHOT') | |
@Grab(group='org.slf4j', module='slf4j-simple', version='1.6.1') | |
import grails.persistence.* | |
import org.grails.datastore.gorm.mongo.config.* | |
MongoDatastoreConfigurer.configure("myDatabase", Book) | |
Book.withSession { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Grab(group="org.neo4j", module="neo4j-cypher", version="1.9") | |
@Grab(group='net.sf.opencsv', module='opencsv', version='2.3') | |
import org.neo4j.kernel.EmbeddedGraphDatabase | |
import org.neo4j.cypher.javacompat.ExecutionEngine | |
import au.com.bytecode.opencsv.CSVWriter | |
assert args, "specify location of graph.db" | |
def db = new org.neo4j.kernel.EmbeddedGraphDatabase(args[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:util="http://www.springframework.org/schema/util" | |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd | |
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@GrabResolver(name="neo4j", root="http://m2.neo4j.org/") | |
@GrabResolver(name="restlet", root="http://maven.restlet.org/") | |
@GrabConfig(systemClassLoader = true) | |
@Grab('org.neo4j:neo4j-jdbc:1.9') | |
import groovy.sql.* | |
def sql = Sql.newInstance('jdbc:neo4j://localhost:7474/') | |
println "simple cypher statement" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:util="http://www.springframework.org/schema/util" | |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd | |
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
small groovy script to demo how to spawn a neo4j ha instance from own code *and* run a server on top of it | |
requirement for this script: | |
* a 3 member cluster is assumed, so either use this script 3 times with adopted config or run 2 Neo4j servers + this script | |
* have two files neo4j-server.properties and neo4.properties in the same directory with this script, having the following contents: | |
neo4j-server.properties: | |
======================== |
OlderNewer