Hi Marko,
Yes I have another separate file for loading the data( .NT format). Let me
know if I should tell anything more clearly, sorry for being slow...
snippet :
Neo4jGraph neo = new Neo4jGraph("dataset");
Sail sail = new GraphSail(neo);
sail.initialize();
CommitManager manager =
TransactionalGraphHelper.createCommitManager(neo, 10000);
SailConnection sc= sail.getConnection();
for (String file: args)
{
System.out.println("Loading " + file + ": ");
loadFile(file, sail.getConnection(), sail.getValueFactory(),
manager);
System.out.print('\n');
}
private static void loadFile(final String file, SailConnection sc,
ValueFactory vf, CommitManager manager) throws RDFParseException,
RDFHandlerException, FileNotFoundException, IOException {
NTriplesParser parser = new NTriplesParser(vf);
TripleHandler handler = new TripleHandler(sc, manager);
parser.setRDFHandler(handler);
parser.setStopAtFirstError(false);
parser.setParseErrorListener(new ParseErrorListener() {
@Override
public void warning(String msg, int lineNo, int colNo) {
System.err.println("warning: " + msg);
System.err.println("file: " + file + " line: "
+ lineNo + " column: "
+colNo);
}
@Override
public void error(String msg, int lineNo, int colNo) {
System.err.println("error: " + msg);
System.err.println("file: " + file + " line: "
+ lineNo + " column: "
+colNo);
}
@Override
public void fatalError(String msg, int lineNo, int
colNo) {
System.err.println("fatal: " + msg);
System.err.println("file: " + file + " line: "
+ lineNo + " column: "
+colNo);
}
});
parser.parse(new BufferedInputStream(new FileInputStream(new
File(file))),
"http://dbpedia.org/");
}
}
Cheers,
Shri
--
View this message in context:
http://neo4j-community-discussions.438527.n3.nabble.com/problem-in-SPARQL-querying-tp3298204p3298337.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user