kumar rohit
2016-07-09 10:43:21 UTC
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");
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");