public static void createNewVersion(WriteGraph graph, Resource oldDocument, Resource newDocument, Resource relation) throws DatabaseException{
DocumentResource doc = DocumentResource.getInstance(graph);
if (graph.hasStatement(oldDocument, doc.HasNewerVersion))
- throw new DatabaseException("Document " + NameUtils.getSafeName(graph, oldDocument) +" has already new version");
+ throw new DatabaseException("Document " + NameUtils.getSafeName(graph, oldDocument) +" has already new version"); //$NON-NLS-1$ //$NON-NLS-2$
Resource inverse = graph.getInverse(relation);
Resource lib = graph.getSingleObject(oldDocument, inverse);
if (!graph.getSingleType(document2, doc.Document).equals(graph.getSingleType(document1, doc.Document)))
return;
if (!versionRel.equals(doc.HasNewerVersion) && !(versionRel.equals(doc.HasOlderVersion)))
- throw new IllegalArgumentException("Unknow version relation + " + graph.getPossibleURI(versionRel));
+ throw new IllegalArgumentException("Unknow version relation + " + graph.getPossibleURI(versionRel)); //$NON-NLS-1$
Resource versionRelInv = graph.getInverse(versionRel);
// toSet must not be part of the document's version history
if (lib != null) {
Resource relation = graph.getPossibleObject(lib, doc.HasLibraryRelation);
String type= graph.getPossibleRelatedValue(lib, doc.HasVersionType);
- if ("TREE".equals(type) && relation != null) {
+ if ("TREE".equals(type) && relation != null) { //$NON-NLS-1$
if (versionRel.equals(doc.HasOlderVersion)) {
graph.deny(document2, graph.getInverse(relation));
graph.claim(document1,relation,document2);
public static void unsetVersion(WriteGraph graph, Resource document1, Resource document2, Resource versionRel) throws DatabaseException {
DocumentResource doc = DocumentResource.getInstance(graph);
if (!versionRel.equals(doc.HasNewerVersion) && !(versionRel.equals(doc.HasOlderVersion)))
- throw new IllegalArgumentException("Unknow version relation + " + graph.getPossibleURI(versionRel));
+ throw new IllegalArgumentException("Unknow version relation + " + graph.getPossibleURI(versionRel)); //$NON-NLS-1$
graph.deny(document1, versionRel,document2);
Resource lib = getLib(graph, document1);
if (lib != null) {
Resource relation = graph.getPossibleObject(lib, doc.HasLibraryRelation);
String type= graph.getPossibleRelatedValue(lib, doc.HasVersionType);
- if ("TREE".equals(type) && relation != null) {
+ if ("TREE".equals(type) && relation != null) { //$NON-NLS-1$
if (versionRel.equals(doc.HasOlderVersion)) {
graph.deny(document1, relation);
graph.claim(lib,relation,document2);