-
Install Neo4j 3.1.0-M12-beta2
-
copy APOC library to
plugins
folder -
drop
Node.txt
andLink.txt
toimport
folder
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
#!/bin/sh | |
#!/bin/bash | |
# Generate a private key | |
openssl genpkey -algorithm RSA -out private.key | |
# Generate a certificate signing request (CSR) | |
openssl req -new -key private.key -subj "/C=DE/L=Munich/O=Company/CN=www.myurl.com" -out certificate.csr |
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
#!/bin/sh | |
# start a neo4j docker container with apoc and bloom (server variant) configured | |
# this requires to have | |
# * curl, unzip and jq being installed | |
# * having a valid bloom license file | |
# released under the WTFPL (http://www.wtfpl.net/) | |
# (c) Stefan Armbruster |
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
= Soft drinks Stefan variant | |
This graph contains the top 15 leading brands of soft drinks as of 2013 according to brand value (in million USD). | |
It will serve as a classification system based on the qualities of the drink as well as the company manufacturing it. | |
We will also have access to the brand value statistics, allowing us to make certain queries pertaining to tendencies in the market. | |
It uses a simple domain model that will nevertheless allow for some interesting queries. | |
image::https://dl.dropboxusercontent.com/u/47527342/drinks.jpg[DataModel] |
For the past couple of years, I have been preaching the Neo4j gospel in many different places, meetups, conferences, and what have you. For the most part, I have been using a very specific demo that has been super well-received: The Belgian Beer Graph. It started out as a learning experience for me personally back in the day when Neo4j did not have any proper data import functionality - and I had to load the graph by jumping through all kinds of hoops.
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
private void mergeConnectedNodes(Label myLabel, RelationshipType relationshipType, String propertyKey, String valueA, String valueB) { | |
try (Transaction tx = db.beginTx()) { | |
// get or create start end node | |
Node a = mergeAndLockNode(myLabel, propertyKey, valueA); | |
Node b = mergeAndLockNode(myLabel, propertyKey, valueB); | |
grabLocksInConsistentOrder(tx, a,b); | |
boolean aIsCheaper = a.getDegree(relationshipType) < b.getDegree(relationshipType); |
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
#!/bin/sh | |
# screen and input device rotation for e.g. a Thinkpad X1 Yoga | |
# adopted from by the script from http://ubuntuforums.org/showthread.php?t=996830&p=6274392#post6274392 | |
# | |
# Usage: | |
# ./rotate.sh | |
# will rotate both the screen and input device either to right or normal setting depending on previous state. Additionally: | |
# * in "right" layout, a on screen keyboard (onboard) is started or stopped in normal mode | |
# * the touchpad is switched off in "right" mode |
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
package org.neo4j.extension.tei | |
import org.junit.Rule | |
import org.neo4j.extension.spock.Neo4jResource | |
import org.neo4j.graphdb.DynamicLabel | |
import org.neo4j.graphdb.GraphDatabaseService | |
import spock.lang.Specification | |
import java.util.concurrent.Executors |
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
// short snippet to retrieve the type of a given property in cypher | |
CREATE (x {myProp: 1.2}) // create a sample node with a float property, change the value to whatever you like | |
RETURN | |
CASE x.myProp | |
WHEN toString(x.myProp) THEN "STRING" | |
WHEN toFloat(x.myProp) THEN "FLOAT" | |
WHEN toInt(x.myProp) THEN "INTEGER" | |
END |
NewerOlder