org.topbraid.change
Class ReplaceSuperClassesChange
java.lang.Object
org.topbraid.core.change.AbstractChange
org.topbraid.change.ReplaceSuperClassesChange
- All Implemented Interfaces:
- IChange
public class ReplaceSuperClassesChange
- extends AbstractChange
|
Constructor Summary |
ReplaceSuperClassesChange(java.util.Collection<com.hp.hpl.jena.rdf.model.Resource> subClasses,
com.hp.hpl.jena.rdf.model.Resource newSuperClass)
|
|
Method Summary |
java.lang.String |
check(ISession session)
Checks if this can be executed and returns an error string if not. |
void |
execute(ISession session,
org.eclipse.core.runtime.IProgressMonitor monitor)
Executes the change. |
protected com.hp.hpl.jena.rdf.model.Resource |
getNewObject()
|
protected java.util.Collection<com.hp.hpl.jena.rdf.model.Resource> |
getSubjects()
|
protected com.hp.hpl.jena.graph.Graph |
getTargetGraph(com.hp.hpl.jena.rdf.model.Resource subject,
com.hp.hpl.jena.ontology.OntModel ontModel,
java.util.List<com.hp.hpl.jena.rdf.model.Statement> oldStatements)
|
protected boolean |
isSurviving(com.hp.hpl.jena.rdf.model.Statement s)
Determines whether an existing statement shall be removed. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReplaceSuperClassesChange
public ReplaceSuperClassesChange(java.util.Collection<com.hp.hpl.jena.rdf.model.Resource> subClasses,
com.hp.hpl.jena.rdf.model.Resource newSuperClass)
check
public java.lang.String check(ISession session)
- Description copied from interface:
IChange
- Checks if this can be executed and returns an error string if not.
This method is usually called by the execution environment prior to
calling the
IChange.execute(org.topbraid.core.session.ISession, org.eclipse.core.runtime.IProgressMonitor) method.
- Specified by:
check in interface IChange
- Parameters:
session - the session to check against
- Returns:
- null if the change can be performed, an error message otherwise
getTargetGraph
protected com.hp.hpl.jena.graph.Graph getTargetGraph(com.hp.hpl.jena.rdf.model.Resource subject,
com.hp.hpl.jena.ontology.OntModel ontModel,
java.util.List<com.hp.hpl.jena.rdf.model.Statement> oldStatements)
isSurviving
protected boolean isSurviving(com.hp.hpl.jena.rdf.model.Statement s)
- Determines whether an existing statement shall be removed.
Subclasses can overload this to "save" existing values, such as restrictions.
- Parameters:
s - the Statement that is about to be deleted
- Returns:
- true if s shall not be deleted
execute
public void execute(ISession session,
org.eclipse.core.runtime.IProgressMonitor monitor)
- Description copied from interface:
IChange
- Executes the change. This should perform the changes to a Jena model.
In case of an unexpected state, the method may throw an IllegalStateException.
- Parameters:
session - the session to execute the change onmonitor - a progress monitor for longish operations (may be null)
getNewObject
protected com.hp.hpl.jena.rdf.model.Resource getNewObject()
getSubjects
protected java.util.Collection<com.hp.hpl.jena.rdf.model.Resource> getSubjects()