@Test public void testUpdate() { ds.begin(ReadWrite.WRITE); try { Ontology ont = Ontology.loadOntology(ds, testOntologyName); JSONObject values = new JSONObject(); OntologyInstance instance = ont.createInstance(simpleClassId, values); JSONObject rep = instance.getJSONRepresentation(); assertTrue(rep.length() == 0); // Add DataProperty values.put(idChar + dataPropId, new JSONArray("[test]")); instance.update(values); rep = instance.getJSONRepresentation(); assertTrue(rep.length() == 1); assertTrue(rep.toString().equals(values.toString())); ds.commit(); } catch (JSONException e) { ds.abort(); fail(e.getMessage()); } finally { ds.end(); } }