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?
I already found:
ValueFactory factory = SimpleValueFactory.getInstance();
Statement nameStatement = factory.createStatement(publication, namePublication, publicationValue);
model.add(nameStatement);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.