Hi Marie,

thanks for those details. I believe I was able to reproduce the same scenario. 
It happens when the sh:class of a parameter points at a class that isn't 
covered by the ADS code generation. I have just made this code more resilient 
for 8.0 but in the meantime I think the following work-around should allow you 
to proceed:

1) On the Script API tab of the Home asset of the collection/file that defines 
the batch action, add "ex" to "generate prefix classes". In my example this 
produces a triple such as dash:generatePrefixClasses "ex" ;

2) On the Script Editor make sure to press Refresh so that the API gets 
rebuilt. This should produce a JS class such as ex_Category.

3) Reload the browser where this action is used and it should hopefully work.

Please let me know if this doesn't work.

Thanks,
Holger


> On 21 Mar 2024, at 10:13 PM, Marie Valadez <[email protected]> wrote:
> 
> I am trying to take in a parameter from the user that can be used as the 
> object. In this example it would be for the category. I added the parameter 
> like below, but I keep getting the error "Not a JSON string". I want to be 
> able to get a drop down where the user selects the category and then it is 
> added as the triple. I am able to populate the drop down but it keeps giving 
> an error when selecting "Okay" to add the triple. My potential use case is 
> actually use this to bulk add a blank node but first trying to get the 
> parameter part working first and resolve the "Not a JSON string". 
> 
> dashjs: """focusNodes.forEach(node => node.add(graph.node({qname: 
> "ex:category"}), graph.node(category)))""";
> sh:parameter ex:Concept-categoryParameter
> 
> ex:Concept-categoryParameter
>  a sh:Parameter;
> sh:path ex:category ;
> sh:class ex:Category ;
> sh:name "category" ; 
> sh:nodeKind sh:IRI ;
> sh:description "Concept Category" ;
> .
> 
> 
> 
> 
> On Monday, March 18, 2024 at 4:04:46 PM UTC-6 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"}))""" ;
>>   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 [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/07d898d5-c816-4e61-9289-e0444833e3een%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/topbraid-users/07d898d5-c816-4e61-9289-e0444833e3een%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/46C0BF8A-601B-4C9E-843B-6CC6BC4AE6B9%40topquadrant.com.

Reply via email to