> Hi
> I want to create student instances of my Student class and enter his
> details. Then at the end I writes model to the file.
>
> OntClass std = model.getOntClass(ns + "Student");
> Individual mystd = std.createIndividual(ns + stdname);
>
> In the file when I enter name of a student, i-e Bob, it saves to the file
> along other information like department, address etc.
> Next time, when I enter another student name, i-e Alice, it replaces
> previous instances of students and currently only one student is saved to
> file.
>
> I want record of all students so need all student instances. I used for
> file writing.
I don't understand the problem. You have to load the existing model and
add new individuals to it. If you don't open the existing model, indeed
only what's added to your new model will be saved to the file.
> try (FileOutputStream write = new FileOutputStream("D://students.owl")) {
> model.write(write, "RDF/XML");
>
--
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center