After executing this code, I can not find the resource (Ranjani) in my
Protege owl file. Where is the mistake in code?




public class rdffile {
    public static void main(String[] args) throws IOException {

    String ns = "
http://www.semanticweb.org/ontologies/2016/7/my-ontology-54#Ranjani";;



   Model model=ModelFactory.createDefaultModel();
InputStream in = FileManager.get().open("C:/User/Desktop/first.owl");
if (in==null) {
throw new IllegalArgumentException(
"File: " +  " not found ");
}
model.read(in, "");


                Resource ranjani = model.createResource(ns+"Ranjani");

                String ss= "C:/Users/Desktop/first.owl";
               FileWriter out = new FileWriter( ss );

                 model.write(out, "RDF/XML-ABBREV");

Reply via email to