According to [JENA], JENA is a Java framework for building Semantic Web Applications. It’s a wonderful thing to build ontology. I’ll blog about it later. 😀

The problem with JENA is, there is no obvious way to delete a Resource from a Model. Fortunately, I’ve found the way from [LB] that we must:

  1. Deleting ALL properties in that particular Resource.
  2. Deleting ALL statements that contains this Resource.

Let the code speaks for itself:

public static void removeResource (

String Uri, Model model) {

        Resource r = model.getResource(Uri);

        if (p != null) {

                p.removeProperties();

                dataModel.removeAll(null, null, p);

        }

}

Referensi:

[JENA] http://jena.sourceforge.net/ [LB] Lost Boy. http://www.ldodds.com/blog/2003/01/rdf-graphs-xpath-and-the-jena-api/