// Marks the TlnResource as deleted and starts deprecation of that resource with all its properties
public setDeleted() {
this._deleted = true;
}
public setUndeleted() {
this._deleted = false;
}
// returns all statements of a thing as n3.Quad[];
// First getting all outgoing/agent statements. patientStatements are not needed, hence they are in the parent and handled by deprecation:
// if
// (properties with object) as n3 quad array in which there are both: the usual spo as well as a list containing all o's
// public getAllAgentStatementQuads(): N3.Quad[] {
// let quads: N3.Quad[] = this._rdfDatasetToEdit.statements().agentStmAsQuads(this._rdfDatasetToEdit.iri()) // getting all outgoing statements as quads
// console.log(quads);
// return quads;
// }
//
// // returns the new thing with all its poperties & objects as N3-quads/lists
if (this._additions.length + this._deletions.length === 0) {
return false } else { return true }
}
preview() {
this.writeOut();
}
push(queryServeice: QueryService) {
if (!this.committed) {
console.warn('nothing to push. Commit before pushing');
return; }
this.writeOut();
//todo: import
}
}
// creates/contains all rdf data needed if a resource gets deleted or deprecated due to changes
export class TlnDeprecation {
private _iri: string;
private deprecatedResource: TlnDeprecatedResource; // the deprecated thing dep:DeprecatedRescource with its props to be imported
private _productiveOperations: StatementOperations; // the operations needed to perform for the new valid resouce, e.g.creating, updating, deleting, ...
private _predecessor: RdfStoredData; // the original thing which needs to be depricated/deleted
private _additions: N3.Quad[] = []; // new statements of the dep:deprecation
private _depTreeDeletions: N3.Quad[] = []; // MetaData only: former statements of the deprecation tree which have to be deleted in order to update the tree
// Todo: lists???
constructor(predecessor: RdfStoredData) {
this._iri = RdfData.createIri('Deprecation_');
this._predecessor = predecessor;
this._productiveOperations = new StatementOperations();
// Updates the derivation tree with the latest changes: Changes the link from the latest Version to this depretaion and takes over the link to the former deprecation