Skip to content

Instantly share code, notes, and snippets.

@KnowledgeGarden
Created April 12, 2015 17:09
Show Gist options
  • Save KnowledgeGarden/87ac9991cafc69d179e1 to your computer and use it in GitHub Desktop.
Save KnowledgeGarden/87ac9991cafc69d179e1 to your computer and use it in GitHub Desktop.
Blazegraph test 1
The embedded driver:
public class EmbeddedDriver implements IGraphDriver {
private JSONGraphStoreEnvironment environment;
//TODO make this a config property
private final String DBPATH = "/data/bg/mygraphjournal";
private BigdataGraph _MyGraph;
public EmbeddedDriver() {}
@Override
public IResult init(JSONGraphStoreEnvironment env) {
IResult result = new ResultPojo();
environment = env;
try {
_MyGraph = BigdataGraphFactory.open(DBPATH, true);
System.out.println("GRAPH "+_MyGraph);
} catch (Exception e) {
environment.logError(e.getMessage(), e);
result.addErrorString(e.getMessage());
}
return result;
}
@Override
public BigdataGraph getGraph() {
return _MyGraph;
}
@Override
public void shutDown() {
_MyGraph.shutdown();
}
}
The test:
public class FirstGraphTest {
private JSONGraphStoreEnvironment environment;
private final String example = "data/examples/graph-example-1.xml";
public FirstGraphTest() {
environment = new JSONGraphStoreEnvironment();
EmbeddedDriver d = new EmbeddedDriver();
IResult r = d.init(environment);
BigdataGraph graph = d.getGraph();
try {
GraphMLReader.inputGraph(graph, example);
for (Vertex v : graph.getVertices()) {
System.err.println(v);
}
for (Edge e : graph.getEdges()) {
System.err.println(e);
}
} catch (IOException e) {
e.printStackTrace();
}
d.shutDown();
System.out.println("Fini "+r.getErrorString());
}
}
Trace if I do not hand create file "mygraphjournal" which never gets created
INFO: com.bigdata.util.config.LogUtil: Configure: jar:file:/C:/projects/eclipseTQ/workspace/JSONGraphStore/lib/bigdata-bundled.jar!/log4j.properties
WARN : ServiceProviderHook.java:162: Running.
GRAPH bigdatagraphembedded
v[1]
v[2]
v[3]
v[4]
v[5]
v[6]
e[7][1->2]
e[8][1->4]
Fini
Did
e[9][1->3]
e[10][4->5]
e[11][4->3]
e[12][6->3]
Trace if I hand create the file "mygraphjournal" which balloons to 10,240kb
INFO: com.bigdata.util.config.LogUtil: Configure: jar:file:/C:/projects/eclipseTQ/workspace/JSONGraphStore/lib/bigdata-bundled.jar!/log4j.properties
WARN : ServiceProviderHook.java:162: Running.
GRAPH bigdatagraphembedded
ERROR: Banner.java:112: Uncaught exception in thread
java.lang.RuntimeException: java.util.concurrent.ExecutionException: com.bigdata.rdf.internal.NotMaterializedException: TermId(1U)
at com.bigdata.rdf.store.AbstractTripleStore.copyStatements(AbstractTripleStore.java:3808)
at com.bigdata.rdf.inf.TruthMaintenance.assertAll(TruthMaintenance.java:497)
at com.bigdata.rdf.sail.BigdataSail$BigdataSailConnection.flushStatementBuffers(BigdataSail.java:3580)
at com.bigdata.rdf.sail.BigdataSail$BigdataSailConnection.removeStatements(BigdataSail.java:2898)
at com.bigdata.rdf.sail.BigdataSail$BigdataSailConnection.removeStatements(BigdataSail.java:2865)
at org.openrdf.repository.sail.SailRepositoryConnection.removeWithoutCommit(SailRepositoryConnection.java:296)
at org.openrdf.repository.base.RepositoryConnectionBase.remove(RepositoryConnectionBase.java:543)
at com.bigdata.blueprints.BigdataGraph.setProperty(BigdataGraph.java:500)
at com.bigdata.blueprints.BigdataGraph.setProperty(BigdataGraph.java:479)
at com.bigdata.blueprints.BigdataElement.setProperty(BigdataElement.java:84)
at com.bigdata.blueprints.BigdataVertex.setProperty(BigdataVertex.java:213)
at com.tinkerpop.blueprints.util.wrappers.batch.BatchGraph$BatchVertex.setProperty(BatchGraph.java:492)
at com.tinkerpop.blueprints.util.io.graphml.GraphMLReader.inputGraph(GraphMLReader.java:274)
at com.tinkerpop.blueprints.util.io.graphml.GraphMLReader.inputGraph(GraphMLReader.java:145)
at com.tinkerpop.blueprints.util.io.graphml.GraphMLReader.inputGraph(GraphMLReader.java:128)
at test.FirstGraphTest.<init>(FirstGraphTest.java:34)
at test.TestHarness.main(TestHarness.java:32)
Caused by: java.util.concurrent.ExecutionException: com.bigdata.rdf.internal.NotMaterializedException: TermId(1U)
at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at com.bigdata.rdf.store.AbstractTripleStore.copyStatements(AbstractTripleStore.java:3790)
... 16 more
Caused by: com.bigdata.rdf.internal.NotMaterializedException: TermId(1U)
at com.bigdata.rdf.internal.impl.AbstractIV.getValue(AbstractIV.java:929)
at com.bigdata.rdf.internal.impl.AbstractNonInlineIV.getLocalName(AbstractNonInlineIV.java:173)
at com.bigdata.blueprints.DefaultBlueprintsValueFactory.fromURI(DefaultBlueprintsValueFactory.java:304)
at com.bigdata.blueprints.BigdataGraph.toGraphAtom(BigdataGraph.java:1448)
at com.bigdata.blueprints.BigdataGraphEmbedded.toGraphEdit(BigdataGraphEmbedded.java:311)
at com.bigdata.blueprints.BigdataGraphEmbedded.notify(BigdataGraphEmbedded.java:281)
at com.bigdata.blueprints.BigdataGraphEmbedded.changeEvent(BigdataGraphEmbedded.java:270)
at com.bigdata.rdf.changesets.DelegatingChangeLog.changeEvent(DelegatingChangeLog.java:75)
at com.bigdata.rdf.changesets.StatementWriter.addStatements(StatementWriter.java:97)
at com.bigdata.rdf.changesets.StatementWriter.addStatements(StatementWriter.java:62)
at com.bigdata.rdf.spo.StatementWriter.call(StatementWriter.java:120)
at com.bigdata.rdf.spo.StatementWriter.call(StatementWriter.java:26)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
@thompsonbry
Copy link

Data?

@KnowledgeGarden
Copy link
Author

The only data in the mix is the same blueprints gml graph used in your unit tests. There was, in fact, data in the journal, some 10,000 kb of it; I suppose I could zip it up and send it somewhere. But, in fact, if I run the system with create = true and an empty journal directory, it does not make one, but runs fine. The moment I actually drop an empty file with the journal's name in the directory, it fills it with background data, then blows up while reading the gml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment