@Test(expected = java.io.InvalidClassException.class) public void testWritabeRejectWrongClass() throws Exception { SchemaTest trouble = new SchemaTest(); ByteArrayOutputStream bytes = new ByteArrayOutputStream(); ObjectOutputStream stream = new ObjectOutputStream(bytes); stream.writeObject(trouble); stream.writeObject(trouble); byte[] troubleArray = bytes.toByteArray(); stream.close(); final ByteArrayOutputStream outToArray = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputStream(outToArray); out.writeInt(troubleArray.length); out.write(troubleArray); out.close(); byte inputArray[] = outToArray.toByteArray(); SchemaWritable schema2 = new SchemaWritable(); schema2.readFields(new DataInputStream(new ByteArrayInputStream(inputArray))); Assert.assertTrue("hasValue should be returned for restriction x after serializeing and deserializing.", schema2.getClass(TestUtils.uri("x")).hasValue().contains(TestUtils.uri("y"))); }
public OwlClass getClass(Resource c) { if (!classes.containsKey(c)) { classes.put(c, new OwlClass(c)); } return classes.get(c); }
Schema { public OwlClass getClass(Resource c) { if (!classes.containsKey(c)) { classes.put(c, new OwlClass(c)); } return classes.get(c); } }
Schema { public OwlClass getClass(Resource c) { if (!classes.containsKey(c)) { classes.put(c, new OwlClass(c)); } return classes.get(c); } Schema(); }
Schema { public OwlClass getClass(Resource c) { if (!classes.containsKey(c)) { classes.put(c, new OwlClass(c)); } return classes.get(c); } Schema(); static boolean isSchemaTriple(Statement triple); OwlClass getClass(Resource c); OwlClass getClass(Value c); OwlProperty getProperty(IRI p); OwlProperty getProperty(Value p); boolean hasProperty(IRI r); boolean hasClass(Resource r); boolean hasRestriction(Resource r); void processTriple(Statement triple); void closure(); boolean containsTriple(Statement triple); String getSummary(); String explainRestriction(Resource type); }
Schema { public OwlClass getClass(Resource c) { if (!classes.containsKey(c)) { classes.put(c, new OwlClass(c)); } return classes.get(c); } Schema(); static boolean isSchemaTriple(Statement triple); OwlClass getClass(Resource c); OwlClass getClass(Value c); OwlProperty getProperty(IRI p); OwlProperty getProperty(Value p); boolean hasProperty(IRI r); boolean hasClass(Resource r); boolean hasRestriction(Resource r); void processTriple(Statement triple); void closure(); boolean containsTriple(Statement triple); String getSummary(); String explainRestriction(Resource type);  }