Skip to content

Instantly share code, notes, and snippets.

@TimmyStorms
TimmyStorms / fuseki.ttl
Last active August 29, 2015 14:16
Fuseki configuration for Stardog & TDB
@prefix : <#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
@prefix fuseki: <http://jena.apache.org/fuseki#> .
@prefix text: <http://jena.apache.org/text#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
[] rdf:type fuseki:Server ;
ja:loadClass "package.StardogInitializer" ;
@TimmyStorms
TimmyStorms / Person.java
Last active April 15, 2019 17:57
Example that shows how to use QueryDSL with Neo4j.
package com.github.timmystorms.querydsl.entity;
import com.mysema.query.annotations.QueryEntity;
@QueryEntity
public final class Person {
private Long id;
private String firstName;
public final class Neo2Label {
public static void main(final String[] args) {
final GraphDatabaseService db = new TestGraphDatabaseFactory().newImpermanentDatabase();
ExecutionEngine engine = new ExecutionEngine(db);
System.out.println(engine.execute("create (n:Person {first_name : \"Peppa\", last_name : \"Pig\"})").dumpToString());
System.out.println(engine.execute("create (n:Person {first_name : \"George\", last_name : \"Pig\"})").dumpToString());
System.out.println(engine.execute("create (n:Person {first_name : \"Mummy\", last_name : \"Pig\"})").dumpToString());
System.out.println(engine.execute("create (n:Person {first_name : \"Daddy\", last_name : \"Pig\"})").dumpToString());
System.out.println(engine.execute("create (n:Location {location : \"The Pigs house\"})").dumpToString());