--
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/360c4e85-30f3-482d-b7f7-20f5cbee5b58n%40googlegroups.com.
On Feb 27, 2025, at 11:45, Jorrit Dorman <jor...@gmail.com> wrote:Thanks Holger, that seems to work.I've made it like this, but I was wondering if there is a more streamlined way to do this? Also, is there documentation available about the tbs functions?const targetGraph <urn:x-evn-master:test> ;const targetUserGraph = graph.withDataGraph(targetGraph,function getUserGraph() {return tbs.queryGraph();});
To view this discussion visit https://groups.google.com/d/msgid/topbraid-users/4438b957-fc74-4952-a243-ce61a9feeb49n%40googlegroups.com.
I'm looking for a similar approach. For each taxonomy modification (e.g. in labels) I want to trigger that update and append the "action" to another taxonomy (in my case <urn:x-evn-master:events_store_taxonomy> ) that would have the source taxonomy label, who edited, date, etc (basically keeping a history of each taxo changes in a separate taxonomy for further external process).
I'm new to ADS scripting inside EDG Sudio and without much documentation I end up creating a ttl File, adding my code as text strings under dash:js """ and finally included that file under a common ontology, which is further included in all my taxonomies, so whenever a taxonomy gets edited that CommitScript is triggered. I'm not sure that's the normal development practice with ADS or writing the code as strings there's no code completion and I relate mostly on console logs with a Trial and error programming approach.
So the question is what's the best approach to go with the development if I need to get the changes of a taxo using commitScript or similar?
Thank you in advance!!
Valentin
On Aug 7, 2025, at 12:20, Valentin Chialda (vali fpv) <valentin...@gmail.com> wrote:Hi Jorrit, HolgerI'm looking for a similar approach. For each taxonomy modification (e.g. in labels) I want to trigger that update and append the "action" to another taxonomy (in my case <urn:x-evn-master:events_store_taxonomy> ) that would have the source taxonomy label, who edited, date, etc (basically keeping a history of each taxo changes in a separate taxonomy for further external process).
I'm new to ADS scripting inside EDG Sudio and without much documentation I end up creating a ttl File, adding my code as text strings under dash:js """ and finally included that file under a common ontology, which is further included in all my taxonomies, so whenever a taxonomy gets edited that CommitScript is triggered. I'm not sure that's the normal development practice with ADS or writing the code as strings there's no code completion and I relate mostly on console logs with a Trial and error programming approach.
To view this discussion visit https://groups.google.com/d/msgid/topbraid-users/ae3581fc-e587-484a-9c14-cce418754621n%40googlegroups.com.
<http://ibm.tvm.org/changescripts/taxonomycommitscript#TaxonomyCommitScript>
a dash:CommitScript ;
dash:js """console.log('Commit Script is running...');
// Get the current collection being edited
//const currentGraph = graph;
//const currentGraphURI = currentGraph.dataGraphURI;
const targetUserGraph = graph.withDataGraph('urn:x-evn-master:events_store_taxonomy', tbs.queryGraph);
// Define the existing ConceptScheme URI
let conceptSchemeURI = "http://www.ibm.com/standards/vocabulary/taxonomies/events_store_taxonomy/Events_root";
// Generate URIs for the new top concepts
let topConcept1URI = "http://www.ibm.com/standards/vocabulary/taxonomies/events_store_taxonomy/Events_root/newtest";
graph.transaction(
targetUserGraph,
"add top concepts to Events_root",
function addTopConcepts() {
let res = [
[topConcept1URI, "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", "http://www.w3.org/2004/02/skos/core#Concept"],
[topConcept1URI, "http://www.w3.org/2000/01/rdf-schema#label", "Business Events"],
[topConcept1URI, "http://www.w3.org/2004/02/skos/core#prefLabel", "Business Events"],
[topConcept1URI, "http://www.w3.org/2004/02/skos/core#inScheme", conceptSchemeURI],
[topConcept1URI, "http://www.w3.org/2004/02/skos/core#topConceptOf", conceptSchemeURI],
[conceptSchemeURI, "http://www.w3.org/2004/02/skos/core#hasTopConcept", topConcept1URI]
];
graph.addTriples(res);
}
);
console.log('Commit Script finished.');
""" ;
rdfs:comment """This CommitScript captures taxonomy edit events and stores them in the events_store_taxonomy.
It extracts the editor information from the graph URI, generates event metadata, and inserts
the event data using SPARQL INSERT queries. The script creates Events_Concept instances
with all required properties including taxo_id, graph_uri, timestamp, and editor information.
Note that this gets only executed when changes have really been asserted, i.e. unlike ChangeScripts they will not execute when the user merely does a Preview or a change gets rejected due to constraint violations.
To try this out, include/owl:import this file into any asset collection and make some changes.""" ;
rdfs:label "Taxonomy Event Capture Commit Script" ;
.
On Aug 11, 2025, at 09:16, Valentin Chialda (vali fpv) <valentin...@gmail.com> wrote:Thank you Holger!I've just tried to use the script editor, although it won't execute transactions.
To view this discussion visit https://groups.google.com/d/msgid/topbraid-users/e69e8aec-83ca-4ab1-9372-c04796aeda8an%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 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/CAPTynH95tVdnc_BhFuWjDFRdNsTxJjpChX_VNeZPHafNKw_TWw%40mail.gmail.com.
<image.png>
You received this message because you are subscribed to a topic in the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/topbraid-users/3QxHt_UrCjA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to topbraid-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/topbraid-users/5EB9E72A-05F3-4001-B420-5768E016B459%40topquadrant.com.