Would you be able to send me your workflow template definition? Private email to [email protected] <mailto:[email protected]> is OK.
Holger > On 4 Jan 2024, at 4:35 pm, Rebecca Jackson <[email protected]> wrote: > > Hi Holger, thanks for getting back to me! Yes, I have tried this, and it does > not update the labels. Is it possible that it has something to do with the > "Frozen for Review" state, which is not editable? > > On Thursday, January 4, 2024 at 12:12:38 AM UTC-8 Holger Knublauch wrote: >> Hi Rebecca, >> >> the documentation of WorkflowStatusScript (the superclass of >> WorkflowStatusEntryScript) states: >> >> --- >> The default query graph that these scripts run against is a sandbox above >> the workflow itself. The script may modify that graph using operations such >> as graph.add() and those changes will be applied to the sandbox where they >> will only be committed to the graph when all scripts have finished >> successfully. >> >> Therefore scripts should not use graph.transaction. Using transactions would >> bypass the sandboxing mechanism and would commit the changes even if other >> parts of the script or other workflow status scripts fail with an exception. >> --- >> >> So I think you can just remove the graph.transaction and do the graph.add >> directly. Have you tried this already? >> >> Holger >> >> >> >> > On 3 Jan 2024, at 6:02 pm, Rebecca Jackson <[email protected] <>> >> > wrote: >> > >> > As part of a custom workflow, we want to create an entry script for the >> > "Frozen for Review" status that queries the graph for any instances >> > missing an rdfs:label, then adds a new rdfs:label triple for each of these >> > instances with an auto-generated label. We want our SMEs to be able to >> > review the auto-generated labels before committing to production. >> > >> > I have created a Web Service that successfully does this with the >> > following code (exact query removed as it is kind of long): >> > >> > const rdfsLabel = graph.node({"qname": "rdfs:label"}); >> > const currentGraph = teamwork.currentMasterGraph(); >> > >> > let noLabels = graph.select(`SELECT * WHERE { <QUERY BODY HERE> }`); >> > let results = noLabels.bindings; >> > let labels = {} >> > for (var i = 0; i < results.length; i++) { >> > let r = results[i]; >> > let instance = r["s"]["uri"]; >> > >> > // some code to build a label goes here >> > >> > let label = `<AUTO GENERATED LABEL HERE>` >> > labels[instance] = label; >> > graph.transaction(currentGraph, "Adding new label", () => { >> > graph.add(graph.node({"uri": instance}), rdfsLabel, graph.node(label)); >> > }); >> > } >> > labels; >> > >> > I tried to tweak this to work for the dash:js of our >> > WorkflowStatusEntryScript, but I can't figure out the "currentGraph" to >> > query and use in the transaction. I know I can get the workflow tag, but >> > that results in an error if I try to use it as the graph ID: >> > >> > org.topbraidlive.script.js.JSException: Unknown named graph >> > urn:x-tags:cir_workflow___rebecca_jackson_on_2024_jan_3_16_28_15 >> > .. and if I just query the master graph, it will not return results that >> > have been added in the workflow. Thanks in advance for any help! >> > >> > -- >> > The topics of this mailing list include TopBraid EDG and related >> > technologies such as SHACL. >> > To post to this group, send email to [email protected] <> >> > --- >> > You received this message because you are subscribed to the Google Groups >> > "TopBraid Suite Users" group. >> > To unsubscribe from this group and stop receiving emails from it, send an >> > email to [email protected] <>. >> > To view this discussion on the web visit >> > https://groups.google.com/d/msgid/topbraid-users/a9048189-dd2a-4369-839c-31723542df8an%40googlegroups.com. >> > > > -- > The topics of this mailing list include TopBraid EDG and related technologies > such as SHACL. > To post to this group, send email to [email protected] > <mailto:[email protected]> > --- > You received this message because you are subscribed to the Google Groups > "TopBraid Suite Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/topbraid-users/fb07bdb6-862d-47b6-8d28-0a60ab8f4a0bn%40googlegroups.com > > <https://groups.google.com/d/msgid/topbraid-users/fb07bdb6-862d-47b6-8d28-0a60ab8f4a0bn%40googlegroups.com?utm_medium=email&utm_source=footer>. -- The topics of this mailing list include TopBraid EDG and related technologies such as SHACL. To post to this group, send email to [email protected] --- You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/3A18764B-9466-441C-8CAE-E52CF7FA2471%40topquadrant.com.
