title: Jena changes my owl file after adding an instance
body: <p>I have an owl file created with protege 4.2. when I add some Instance with Jena, Jena changes the file structure but the file extension remains the same (.owl) the file is readable in protege with some error. Anyone knows where is the problem with my code?</p>
  
  <p>Because the result of the <a href="/questions/tagged/sparql" class="post-tag" title="show questions tagged 'sparql'" rel="tag">sparql</a> query is somehow strange after the edit with Jena.</p>
  
  <p>For example, Before editing with Jena </p>
  
  <pre><code> &lt;owl:NamedIndividual rdf:about="&amp;ontologies;thesis_ontology_1try#AM6"&gt;
      &lt;rdf:type rdf:resource="&amp;ontologies;thesis_ontology_1try#ApplicationModel"/&gt;
      &lt;hasID rdf:datatype="&amp;xsd;string"&gt;20125157-d62b-45de-8809-84186c7169b5AM6&lt;/hasID&gt;
      &lt;name rdf:datatype="&amp;xsd;string"&gt;GebÃ¤udemodell / Buildingmodel&lt;/name&gt;
      &lt;hasContent rdf:resource="&amp;ontologies;cpixml"/&gt;
      &lt;hasLevelOfDetail rdf:resource="&amp;ontologies;thesis_ontology_1try#4"/&gt;
      &lt;hasDomain rdf:resource="&amp;ontologies;thesis_ontology_1try#BIM"/&gt;
      &lt;hasType rdf:resource="&amp;ontologies;thesis_ontology_1try#Object"/&gt;
      &lt;hasPhase rdf:resource="&amp;ontologies;thesis_ontology_1try#SLCT"/&gt;
      &lt;hasContent rdf:resource="&amp;ontologies;thesis_ontology_1try#ifc"/&gt;
  &lt;/owl:NamedIndividual&gt;
  </code></pre>
  
  <p>After Jena</p>
  
  <pre><code>&lt;rdf:Description rdf:about="http://www.semanticweb.org/thato/ontologies/2012/10/9/thesis_ontology_1try#AM6"&gt;
  &lt;hasContent rdf:resource="http://www.semanticweb.org/thato/ontologies/2012/10/9/cpixml"/&gt;
  &lt;rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/&gt;
  &lt;hasDomain rdf:resource="http://www.semanticweb.org/thato/ontologies/2012/10/9/thesis_ontology_1try#BIM"/&gt;
  &lt;hasType rdf:resource="http://www.semanticweb.org/thato/ontologies/2012/10/9/thesis_ontology_1try#Object"/&gt;
  &lt;hasID rdf:datatype="http://www.w3.org/2001/XMLSchema#string"&gt;20125157-d62b-45de-8809-84186c7169b5AM6&lt;/hasID&gt;
  &lt;hasPhase rdf:resource="http://www.semanticweb.org/thato/ontologies/2012/10/9/thesis_ontology_1try#SLCT"/&gt;
  &lt;rdf:type rdf:resource="http://www.semanticweb.org/thato/ontologies/2012/10/9/thesis_ontology_1try#ApplicationModel"/&gt;
  &lt;hasContent rdf:resource="http://www.semanticweb.org/thato/ontologies/2012/10/9/thesis_ontology_1try#ifc"/&gt;
  &lt;name rdf:datatype="http://www.w3.org/2001/XMLSchema#string"&gt;GebÃ¤udemodell / Buildingmodel&lt;/name&gt;
  &lt;hasLevelOfDetail rdf:resource="http://www.semanticweb.org/thato/ontologies/2012/10/9/thesis_ontology_1try#4"/&gt;
  &lt;rdf:type rdf:nodeID="A28"/&gt;
  &lt;rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Thing"/&gt;
  &lt;rdf:type rdf:nodeID="A29"/&gt;
  &lt;rdf:type rdf:nodeID="A30"/&gt;
  &lt;rdf:type rdf:nodeID="A31"/&gt;
  &lt;rdf:type rdf:nodeID="A32"/&gt;
  &lt;rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/&gt;
  &lt;rdf:type rdf:nodeID="A33"/&gt;
  &lt;rdf:type rdf:nodeID="A34"/&gt;
  &lt;rdf:type rdf:nodeID="A12"/&gt;
  &lt;rdf:type rdf:nodeID="A15"/&gt;
  &lt;rdf:type rdf:nodeID="A35"/&gt;
  &lt;rdf:type rdf:nodeID="A5"/&gt;
  &lt;Linkedby rdf:resource="http://www.semanticweb.org/thato/ontologies/2012/10/9/thesis_ontology_1try#LM2"/&gt;
  &lt;isAMof rdf:resource="http://www.semanticweb.org/thato/ontologies/2012/10/9/thesis_ontology_1try#MMC2"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>And This is the code</p>
  
  <pre><code>public static void main(String[] args) throws IOException {
  InputStream in = FileManager.get().open("./src/thesis_ontology_1try.owl");
  OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_MICRO_RULE_INF, null);
  model.read(in, null);
  in.close();
  
  String NS = "http://www.semanticweb.org/thato/ontologies/2012/10/9/thesis_ontology_1try#";
  OntClass ApplicationModel = model.getOntClass(NS + "ApplicationModel");
  
  
  Individual dom = model.getIndividual(NS + "RFP");
  Individual pha = model.getIndividual(NS + "SLCT");
  Individual lev =  model.getIndividual(NS + "3");
  
  Individual new1 = model.createIndividual(NS + "new1", ApplicationModel);  
  
  ObjectProperty domain = model.createObjectProperty(NS +"hasDomain");
  ObjectProperty phase = model.createObjectProperty(NS +"hasPhase");
  ObjectProperty lod = model.createObjectProperty(NS +"hasLevelOfDetail");
  
  model.add(new1, domain, dom);
  model.add(new1, phase, pha);
  model.add(new1, lod, lev);
  
  
  PrintStream p= new PrintStream("./src/thesis_ontology_1try.owl");
  model.writeAll(p, "RDF/XML", null);
  p.close();
  
  System.out.println("Done");
  
  
  }
  
  }
  </code></pre>