Re: [topbraid-users] Using dash:BatchAction in EDG

2024-03-19 Thread Holger Knublauch
The jsCondition needs to return a boolean but the forEach doesn't return 
anything. Maybe you mean

focusNodes.every(node => node.instanceOf(ex.Concept))

Holger


> On 19 Mar 2024, at 4:41 pm, Marie Valadez  wrote:
> 
> Thank you for the feedback. I found them in the Asset List panel. So if it is 
> not associated with a specific class, how would you go about making sure you 
> can't batch add the action to other classes by accident. So for instance, I 
> only want it to add to Concept. I tried this, but it isn't working. I am 
> assuming I am misunderstanding something or typing something incorrectly.  
> 
> dash:jsCondition "focusNodes.forEach(node => 
> node.values(rdf.type).some((Class) => Class == ex.Concept))" ;
> 
> 
> On Tuesday, March 19, 2024 at 2:36:23 AM UTC-6 Holger Knublauch wrote:
>> Hi Marie,
>> 
>> BatchActions are not linked to specific classes. Instead they are invoked on 
>> a list of nodes as values of the variable focusNodes, and are called from 
>> the batch actions drop down buttons that are found in various places. For 
>> example, you can run them from the Asset List panel, the Instances Panel and 
>> other tabular displays. So there is no need to declare a dash:resourceAction 
>> triple.
>> 
>>> On 18 Mar 2024, at 10:04 pm, Marie Valadez > wrote:
>>> 
>>> Hello Holger,
>>> 
>>> I am looking into BatchActions and only seemed to find a snippet in the 
>>> documentation where it says it is the similar to 
>>> dash:ModifyActions/dash:ExploreActions 
>>> (https://archive.topquadrant.com/doc/7.8/scripting/actions.html?highlight=batchaction).
>>>  I have a dash:ModifyActions instance that works, but tried to implement a 
>>> similar case for dash:BatchAction to see if I can essentially take the 
>>> action from dash:ModifyActions and apply it to multiple instances. However, 
>>> I don't seem to even find it populating under the Batch Actions Menu. I am 
>>> trying to test it out in EDG Studio version 7.8. Is there something I am 
>>> missing with how to implement??
>>> 
>>> Here is an example of the script:
>>> 
>>> ex:Concept
>>>   a owl:Class ;
>>>   a sh:NodeShape ;
>>>   dash:resourceAction exsh:CategoryBatchAction ;
>>> ...
>>> 
>>> exsh:CategoryBatchAction
>>>   a dash:BatchAction ;
>>>   dash:actionGroup exsh:CategoryActionGroup ;
>>>   dash:actionIconClass "fas fa-plus" ;
>>>   dash:canWrite true ;
>>>   dash:js """
>>>   focusNode.add(graph.node({qname: "ex:category"}), 
>>> graph.node({qname: "ex_graph:_123"}))""" ;
>> 
>> The main difference to resource actions is that batch actions process all 
>> nodes at once. So their dash:js would be something like
>> 
>> focusNodes.forEach(node => node.add(graph.node))
>> 
>> If things remain unclear, please ask again.
>> 
>> HTH
>> Holger
>> 
>> 
>> 
>> 
>>>   rdfs:comment "Add `example category to the concept" ;
>>>   rdfs:label "Example Category Batch Action" ;
>>>   sh:order 0 ;
>>> ...
>>> 
>> 
>>> -- 
>>> 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 on the web visit 
>>> https://groups.google.com/d/msgid/topbraid-users/ba6bec74-cc10-4e9f-8fa5-8bb87aca61d9n%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 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 on the web visit 
> https://groups.google.com/d/msgid/topbraid-users/7948c382-ec1b-4248-a111-e9623bc2acden%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 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 on the web visit 

Re: [topbraid-users] Using dash:BatchAction in EDG

2024-03-19 Thread Marie Valadez
Thank you for the feedback. I found them in the Asset List panel. So if it 
is not associated with a specific class, how would you go about making sure 
you can't batch add the action to other classes by accident. So for 
instance, I only want it to add to Concept. I tried this, but it isn't 
working. I am assuming I am misunderstanding something or typing something 
incorrectly.  

dash:jsCondition "focusNodes.forEach(node => 
node.values(rdf.type).some((Class) => Class == ex.Concept))" ;


On Tuesday, March 19, 2024 at 2:36:23 AM UTC-6 Holger Knublauch wrote:

> Hi Marie,
>
> BatchActions are not linked to specific classes. Instead they are invoked 
> on a list of nodes as values of the variable focusNodes, and are called 
> from the batch actions drop down buttons that are found in various places. 
> For example, you can run them from the Asset List panel, the Instances 
> Panel and other tabular displays. So there is no need to declare a 
> dash:resourceAction triple.
>
> On 18 Mar 2024, at 10:04 pm, Marie Valadez  wrote:
>
> Hello Holger,
>
> I am looking into BatchActions and only seemed to find a snippet in the 
> documentation where it says it is the similar to 
> dash:ModifyActions/dash:ExploreActions (
> https://archive.topquadrant.com/doc/7.8/scripting/actions.html?highlight=batchaction).
>  
> I have a dash:ModifyActions instance that works, but tried to implement a 
> similar case for dash:BatchAction to see if I can essentially take the 
> action from dash:ModifyActions and apply it to multiple instances. However, 
> I don't seem to even find it populating under the Batch Actions Menu. I am 
> trying to test it out in EDG Studio version 7.8. Is there something I am 
> missing with how to implement??
>
> Here is an example of the script:
>
> ex:Concept
>   a owl:Class ;
>   a sh:NodeShape ;
>   dash:resourceAction exsh:CategoryBatchAction ;
> ...
>
> exsh:CategoryBatchAction
>   a dash:BatchAction ;
>   dash:actionGroup exsh:CategoryActionGroup ;
>   dash:actionIconClass "fas fa-plus" ;
>   dash:canWrite true ;
>   dash:js """
>   focusNode.add(graph.node({qname: "ex:category"}), 
> graph.node({qname: "ex_graph:_123"}))""" ;
>
>
> The main difference to resource actions is that batch actions process all 
> nodes at once. So their dash:js would be something like
>
> focusNodes.forEach(node => node.add(graph.node))
>
> If things remain unclear, please ask again.
>
> HTH
> Holger
>
>
>
>   rdfs:comment "Add `example category to the concept" ;
>   rdfs:label "Example Category Batch Action" ;
>   sh:order 0 ;
> ...
>
> -- 
> 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 on the web visit 
> https://groups.google.com/d/msgid/topbraid-users/ba6bec74-cc10-4e9f-8fa5-8bb87aca61d9n%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 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 on the web visit 
https://groups.google.com/d/msgid/topbraid-users/7948c382-ec1b-4248-a111-e9623bc2acden%40googlegroups.com.


Re: [topbraid-users] Using dash:BatchAction in EDG

2024-03-19 Thread Holger Knublauch
Hi Marie,

BatchActions are not linked to specific classes. Instead they are invoked on a 
list of nodes as values of the variable focusNodes, and are called from the 
batch actions drop down buttons that are found in various places. For example, 
you can run them from the Asset List panel, the Instances Panel and other 
tabular displays. So there is no need to declare a dash:resourceAction triple.

> On 18 Mar 2024, at 10:04 pm, Marie Valadez  wrote:
> 
> Hello Holger,
> 
> I am looking into BatchActions and only seemed to find a snippet in the 
> documentation where it says it is the similar to 
> dash:ModifyActions/dash:ExploreActions 
> (https://archive.topquadrant.com/doc/7.8/scripting/actions.html?highlight=batchaction).
>  I have a dash:ModifyActions instance that works, but tried to implement a 
> similar case for dash:BatchAction to see if I can essentially take the action 
> from dash:ModifyActions and apply it to multiple instances. However, I don't 
> seem to even find it populating under the Batch Actions Menu. I am trying to 
> test it out in EDG Studio version 7.8. Is there something I am missing with 
> how to implement??
> 
> Here is an example of the script:
> 
> ex:Concept
>   a owl:Class ;
>   a sh:NodeShape ;
>   dash:resourceAction exsh:CategoryBatchAction ;
> ...
> 
> exsh:CategoryBatchAction
>   a dash:BatchAction ;
>   dash:actionGroup exsh:CategoryActionGroup ;
>   dash:actionIconClass "fas fa-plus" ;
>   dash:canWrite true ;
>   dash:js """
>   focusNode.add(graph.node({qname: "ex:category"}), 
> graph.node({qname: "ex_graph:_123"}))""" ;

The main difference to resource actions is that batch actions process all nodes 
at once. So their dash:js would be something like

focusNodes.forEach(node => node.add(graph.node))

If things remain unclear, please ask again.

HTH
Holger



>   rdfs:comment "Add `example category to the concept" ;
>   rdfs:label "Example Category Batch Action" ;
>   sh:order 0 ;
> ...
> 
> -- 
> 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 on the web visit 
> https://groups.google.com/d/msgid/topbraid-users/ba6bec74-cc10-4e9f-8fa5-8bb87aca61d9n%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 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 on the web visit 
https://groups.google.com/d/msgid/topbraid-users/2A55E519-90CC-456B-A5A3-7E7D0F49CAFC%40topquadrant.com.