Hello Holger,
I still got a problem in implementing that. The gist of the code is:

data = graph.select(somequery); // returns s p o resultset
target = tbs.queryGraph(WorkflowID);
graph.transaction(target, "transfer", ()=>{
data.bindings.forEach(t => {
     graph.add(t.s, t.p, t.o);
  })
})

The problem: nothing gets added to the workflow (neither in the history, 
nor in the actual graph).
There are no errors returned nor log entries in EDG log that would point to 
any problems.
I also made sure, that the user executing the code has appropriate roles 
assigned as needed for the workflow.

When I exchange the target above against the underlying mastergraph of the 
workflow, the code runs as expected and transfers the triples into the 
mastergraph (without change history entry).

Do I miss something obvious here?

Thanks for suggestions
Greetings
Bernd
On Tuesday, February 4, 2025 at 11:29:03 AM UTC+1 Bernd Johannes wrote:

> Hi Holger,
> many thanks for the quick reply - I assume 'workflow_1' is the ID / Tag of 
> the workflow?
>
> Anyway - I have now the required pointer which I was missing: 
> tbs.queryGraph() shall provide me with the right graph to send transactions 
> to via graph.transaction().
>
> Splendid!
> Greetings
> Bernd
>
> On Tuesday, February 4, 2025 at 9:38:53 AM UTC+1 Holger Knublauch wrote:
>
>> Hi Bernd,
>>
>> to add or remove triples, don't go directly through the TCH graph. That's 
>> too error prone and it's much simpler to do this
>>
>> let workflowGraph = tbs.queryGraph('workflow_1');
>> graph.transaction(workflowGraph, 'Adding a triple', () => {
>> owl.Thing.add(rdfs.seeAlso, owl.Nothing);
>> });
>>
>> Which will create the added triple in the given workflow and record it 
>> properly in the change history.
>>
>> Does this give you enough clues to proceed?
>>
>> Holger
>>
>>
>> On 4 Feb 2025, at 9:11 AM, Bernd Johannes <bjo...@gmail.com> wrote:
>>
>> Hello everybody,
>> I struggle to find the right sequence of actions to select a workflow and 
>> mutate data within via ADS.
>>
>> I would appreciate a solution template, that documents the relevant steps.
>>
>> The situation:
>> in ontology *M* there is a modify action bound to owl:Ontology that 
>> should:
>>
>> - select ontology *A *
>> - select a specific workflow *T* in that ontology *A*.
>> - then add and remove some triples in that workflow (so that it gets part 
>> of the workflow changes - no direct write to the underlying ontology A)
>>
>> I am aware about the data structure in the teamgraph and have no problems 
>> to solve the problem in SPARQL - however SPARQL does not allow me to write 
>> into the workflow - only to the underlying ontology A directly.
>>
>> I read, that I also should not use graph.transaction(<target>, ...) where 
>> I could provide *A->T* as <target> resource, as this bypasses the 
>> workflows.
>>
>> Is there a solution pattern?
>>
>> Thanks for your suggestions.
>> Greetings
>> Bernd
>>
>>
>>
>>
>> -- 
>> The topics of this mailing list include TopBraid EDG and related 
>> technologies such as SHACL.
>> To post to this group, send email to topbrai...@googlegroups.com
>> --- 
>> 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 topbraid-user...@googlegroups.com.
>> To view this discussion visit 
>> https://groups.google.com/d/msgid/topbraid-users/f200a66f-46f1-436c-9eae-cda108c45f63n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/topbraid-users/f200a66f-46f1-436c-9eae-cda108c45f63n%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 topbraid-users@googlegroups.com
--- 
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 topbraid-users+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/topbraid-users/e79fc8d1-9019-45d0-9472-eb3257970f29n%40googlegroups.com.

Reply via email to