|
Hi, am trying to create individuals and save them in owl file. The owl file was created in protege. The size of the owl file was 10 KB but after trying to save the individuals in the ontology the size of the code becomes 7 KB. Then I tried to open the owl file using protege but it will not open . The code is : String SOURCE = "http://www.semanticweb.org/ontologies/2012/9/untitled-ontology-19"; String NS = SOURCE + "#"; OntModel onto = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM, null); onto.read("file:/home/tourism.owl", "RDF/XML"); OntClass place = onto.getOntClass(NS+"Mountains"); Individual am1 = onto.createIndividual(NS+Concept1, place); FileOutputStream output = null; try { output = new FileOutputStream( "/home/tourism.owl ");
onto.writeAll(output, "RDF/XML-ABBREV","xmlbase"); |
|
|

