Reputation: 123
I try to add a statement to an existing *.ttl file I can add a required text but in some different structure:
InputStream in = new FileInputStream("62692504.ttl");
Model model = Rio.parse(in, RDFFormat.TURTLE );
Resource publication = iri("https://../fcrepo/rest/ajax-mingoo/"+fileName);
IRI namePublication = iri("http://ndl.go.jp/dcndl/publicationPlace");
Literal publicationValue = literal(publication_place);
model.add(publication, namePublication, publicationValue);
FileOutputStream out = new FileOutputStream("62692504_NEW.ttl");
Rio.write(model, out, RDFFormat.TURTLE);
In debug mode, the new line differs from the others, but I want to have the same type. The new line should be SimpleStatement and not from type ContextStatement.
How I can change the type from "default" to SimpleStatement?
Upvotes: 0
Views: 112
Reputation: 123
I already found:
ValueFactory factory = SimpleValueFactory.getInstance();
Statement nameStatement = factory.createStatement(publication, namePublication, publicationValue);
model.add(nameStatement);
Upvotes: 0