Skip to content

Instantly share code, notes, and snippets.

@joshsh
joshsh / gist:4644515
Created January 26, 2013 20:45
LinkedDataSail + SPARQL usage example
package net.fortytwo.ripple;
import info.aduna.iteration.CloseableIteration;
import net.fortytwo.linkeddata.sail.LinkedDataSail;
import org.openrdf.query.BindingSet;
import org.openrdf.query.QueryEvaluationException;
import org.openrdf.query.impl.EmptyBindingSet;
import org.openrdf.query.parser.ParsedQuery;
import org.openrdf.query.parser.sparql.SPARQLParser;
import org.openrdf.sail.Sail;
@joshsh
joshsh / gist:4759199
Created February 12, 2013 01:16
neo4j-sail-test updated for Blueprints 2.3.0-SNAPSHOT
package be.datablend.sailtest;
import com.tinkerpop.blueprints.KeyIndexableGraph;
import com.tinkerpop.blueprints.impls.neo4j.Neo4jGraph;
import com.tinkerpop.blueprints.oupls.sail.GraphSail;
import org.openrdf.query.BindingSet;
import org.openrdf.query.MalformedQueryException;
import org.openrdf.query.QueryEvaluationException;
import org.openrdf.query.QueryLanguage;
import org.openrdf.query.TupleQuery;
// to download RDF dumps of WordNet 3.0:
// git clone git://eculture.cs.vu.nl/home/git/wordnet
import com.tinkerpop.blueprints.impls.neo4j.Neo4jGraph;
import com.tinkerpop.blueprints.oupls.sail.GraphSail;
import org.openrdf.model.Statement;
import org.openrdf.rio.RDFFormat;
import org.openrdf.rio.RDFHandler;
import org.openrdf.rio.RDFHandlerException;
import org.openrdf.rio.RDFParser;
@joshsh
joshsh / gist:7259576
Last active December 27, 2015 03:29
unified CSV format for property graphs (graph-example-1)
SEPARATE VERTEX/EDGE FILES (NO TYPES):
id,age,lang,name
1,29,,marko
2,27,,vadas
3,,java,lop
4,32,,josh
5,,java,ripple
6,35,,peter
e..4q...POST /sparql HTTP/1.1^M
Accept: text/plain, application/rdf+xml, application/xml, application/x-binary-rdf, text/turtle, application/x-turtle, text/rdf+n3, application/xhtml+xml, text/html, image/svg+xml, application/x-trig, application/trix, text/x-nquads^M
User-Agent: OpenRDF.org SPARQLConnection/2.6.10 Jakarta Commons-HttpClient/3.1^M
Host: dbpedia.org^M
Content-Length: 173^M
Content-Type: application/x-www-form-urlencoded^M
^M
query=CONSTRUCT+%7B+%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2FGrateful_Dead%3E+%3Fp+%3Fo+%7D+WHERE+%7B+%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2FGrateful_Dead%3E+%3Fp+%3Fo+%7D
09:10:12.509475 IP (tos 0x0, ttl 51, id 2372, offset 0, flags [DF], proto TCP (6), length 52)
194.109.129.58.http > 192.168.1.106.51903: Flags [.], cksum 0x6b10 (correct), ack 602, win 123, options [nop,nop,TS val 1908842297 ecr 1711144500], length 0
package com.tinkerpop.rexster.config;
import com.tinkerpop.blueprints.Graph;
import com.tinkerpop.blueprints.KeyIndexableGraph;
import com.tinkerpop.blueprints.util.wrappers.id.IdGraph;
import com.tinkerpop.rexster.RexsterApplicationGraph;
import com.tinkerpop.rexster.Tokens;
import org.apache.commons.configuration.HierarchicalConfiguration;
import org.apache.commons.configuration.SubnodeConfiguration;
package com.tinkerpop.rexster.config;
import com.tinkerpop.blueprints.Graph;
import com.tinkerpop.blueprints.impls.sail.impls.LinkedDataSailGraph;
import com.tinkerpop.blueprints.util.wrappers.id.IdGraph;
import com.tinkerpop.rexster.RexsterApplicationGraph;
import com.tinkerpop.rexster.Tokens;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.HierarchicalConfiguration;
import org.junit.Test;
@joshsh
joshsh / gist:10953965
Created April 17, 2014 04:59
OOME in titan-cassandra unit test (titan05 branch)
Running com.thinkaurelius.titan.diskstorage.cassandra.thrift.InternalCassandraThriftMultiWriteKeyColumnValueStoreTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 36.272 sec - in com.thinkaurelius.titan.diskstorage.cassandra.thrift.InternalCassandraThriftMultiWriteKeyColumnValueStoreTest
76484 [MutationStage:30] WARN org.apache.cassandra.db.commitlog.CommitLog - Skipping commitlog append of extremely large mutation (37749187 bytes)
77500 [MutationStage:14] WARN org.apache.cassandra.db.commitlog.CommitLog - Skipping commitlog append of extremely large mutation (46137871 bytes)
java.lang.OutOfMemoryError: Java heap space
Dumping heap to java_pid3461.hprof ...
Heap dump file created [1079694436 bytes in 5.678 secs]
89178 [FlushWriter:1] ERROR org.apache.cassandra.service.CassandraDaemon - Exception in thread Thread[FlushWriter:1,5,main]
java.lang.OutOfMemoryError: Java heap space
at org.apache.cassandra.io.util.FastByteArrayOutputStream.expand(FastByteArrayOutputStream.java:104)
@joshsh
joshsh / gist:11341645
Created April 27, 2014 09:42
titan05 unit test failures (titan-berkeleyje and titan-cassandra)
-------------------------------------------------------------------------------
Test set: com.thinkaurelius.titan.graphdb.berkeleyje.BerkeleyJEGraphTest
-------------------------------------------------------------------------------
Tests run: 29, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 71.581 sec <<< FAILURE! - in com.thinkaurelius.titan.graphdb.berkeleyje.BerkeleyJEGraphTest
testTypes(com.thinkaurelius.titan.graphdb.berkeleyje.BerkeleyJEGraphTest) Time elapsed: 0.15 sec <<< ERROR!
java.lang.IllegalArgumentException: Only one open instance but its not the current one: [c0a801746369@marvin6]
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:120)
at com.thinkaurelius.titan.graphdb.database.management.ManagementSystem$1.verifyModification(ManagementSystem.java:98)
at com.thinkaurelius.titan.diskstorage.configuration.UserModifiableConfiguration.set(UserModifiableConfiguration.java:84)
at com.thinkaurelius.titan.graphdb.database.management.ManagementSystem.set(ManagementSyst
@joshsh
joshsh / gist:11381828
Created April 28, 2014 19:34
titan-hbase-094/logs/hbase-josh-master-marvin6.local.log
Sun Apr 27 06:16:12 EDT 2014 Starting master on marvin6.local
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 10240
pipe size (512 bytes, -p) 1
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited