org.topbraid.core.model
Class Deleting

java.lang.Object
  extended by org.topbraid.core.model.Deleting

public class Deleting
extends java.lang.Object

Utility methods for delete operations.

Author:
Holger Knublauch

Constructor Summary
Deleting()
           
 
Method Summary
static void delete(com.hp.hpl.jena.ontology.OntModel ontModel, com.hp.hpl.jena.graph.Node subject, com.hp.hpl.jena.graph.Node predicate, com.hp.hpl.jena.graph.Node object)
          Deletes a given triple from the model.
static void delete(com.hp.hpl.jena.rdf.model.Resource subject, com.hp.hpl.jena.rdf.model.Property predicate, com.hp.hpl.jena.rdf.model.RDFNode object)
           
static void deleteAll(java.util.Iterator resources)
           
static void deleteAll(com.hp.hpl.jena.rdf.model.Resource resource)
           
static void deleteOperand(com.hp.hpl.jena.ontology.UnionClass unionClass, com.hp.hpl.jena.rdf.model.Resource operand)
           
static boolean isDeletable(java.util.Collection resources)
           
static boolean isDeletable(java.util.Iterator resources)
          Checks if a collection of resources can be deleted from this model.
static boolean isDeletableReference(com.hp.hpl.jena.rdf.model.Resource resource)
          Checks if a given resource is only directly used in triples stored in read/write graphs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Deleting

public Deleting()
Method Detail

delete

public static void delete(com.hp.hpl.jena.rdf.model.Resource subject,
                          com.hp.hpl.jena.rdf.model.Property predicate,
                          com.hp.hpl.jena.rdf.model.RDFNode object)

delete

public static void delete(com.hp.hpl.jena.ontology.OntModel ontModel,
                          com.hp.hpl.jena.graph.Node subject,
                          com.hp.hpl.jena.graph.Node predicate,
                          com.hp.hpl.jena.graph.Node object)
Deletes a given triple from the model. This method is needed because Jena does not correctly delete triples if they are from a sub-Graph.

Parameters:
ontModel - the OntModel to delete from
subject - the subject Node
predicate - the predicate Node
object - the object Node

deleteAll

public static void deleteAll(com.hp.hpl.jena.rdf.model.Resource resource)

deleteAll

public static void deleteAll(java.util.Iterator resources)

deleteOperand

public static void deleteOperand(com.hp.hpl.jena.ontology.UnionClass unionClass,
                                 com.hp.hpl.jena.rdf.model.Resource operand)

isDeletable

public static boolean isDeletable(java.util.Collection resources)

isDeletableReference

public static boolean isDeletableReference(com.hp.hpl.jena.rdf.model.Resource resource)
Checks if a given resource is only directly used in triples stored in read/write graphs. This can be used to quickly detect whether a given resource can be renamed etc.

Parameters:
resource - the resource to test
Returns:
true if all triples using resource can be deleted

isDeletable

public static boolean isDeletable(java.util.Iterator resources)
Checks if a collection of resources can be deleted from this model. A resource is deletable if all depending Statements are deletable.

Parameters:
resources - the resources to delete
Returns:
true if the resources can be deleted
See Also:
Statements.isDeletable(Statement)