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 ");

    }
    catch(Exception e)
    {

    }

onto.writeAll(output, "RDF/XML-ABBREV","xmlbase");

asked 02 Dec '12, 19:38

salem's gravatar image

salem
5912
accept rate: 0%


Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×649

Asked: 02 Dec '12, 19:38

Seen: 493 times

Last updated: 03 Dec '12, 03:05