When loading a N3 RDF file with the below format into Sesame Repository, is it possible to tell Sesame '|' as separator?
The below triple is separated by | :
http://article.com/1-3|http://relationship.com/wasGeneratedBy|http://edit.com/comment1-2
As also indicated in the comments: the format you have simply is not N3 syntax, so you can't upload this using Sesame's N3 parser. Nor is it in any other standardized format, so there is no parser available for handling it.
However, it would be fairly simple to process a file in this format "manually" and add it to Sesame yourself. This will likely do the trick:
try (RepositoryConnection conn = rep.getConnection()) {
ValueFactory vf = conn.getValueFactory();
File file = new File("/path/to/weirdlyformattedrdffile.txt");
// open the file for reading
try (BufferedReader br = new BufferedReader(new FileReader(file))) {
String line;
// start a transaction
conn.begin();
// read the file line-by-line
while ((line = br.readLine()) != null) {
// each line is an RDF triple with a subject, predicate, and object
String[] triple = line.split("|");
IRI subject = vf.createIRI(triple[0]);
IRI predicate = vf.createIRI(triple[1]);
IRI object = vf.createIRI(triple[2]);
// add the triple to the database
conn.add(subject, predicate, object);
}
// commit the txn when all lines are read
conn.commit();
}
}
Of course if your file also contains other things than IRIs (for example literals or blank nodes), you will have to include some logic to distinguish these, rather than just blindly creating IRIs for everything. But that's the price you pay for not using a standardized syntax format.