Hi Rob,
you'll need 7.2 for this, using graph.transaction. Example:
let result = graph.withDataGraph('http://uri.of.example.graph/toUpdate',
'Some log message', () => {
owl.Thing.add(rdfs.comment, 'Added this comment');
return 'whatever';
});
This will switch to the first argument as the active graph for the
transaction. The second argument can be a log message for the change
history. The 3rd argument is the callback function which is the body of
the transaction. Here you have the new active graph and can add or
delete triples etc. You could also check constraints and decide not to
proceed by throwing an exception, i.e. not committing the transaction.
Prior to 7.1 graph.withDataGraph *probably* worked somehow, but that
would be a hack and wouldn't properly support transactions etc.
Holger
On 2022-05-09 4:57 pm, Rob Atkinson wrote:
Hi
trying to find examples to understand options for inserting into a
named graph..
I have a situation where I need to process a graph and send data to
multiple related graphs
ADS offers me the "withDataGraph" that calls a function with no
parameters...
seems like it might be relevant to use that and update...
not sure how I invoke the function I want to call with the parameters
I need to send however?
I can force access to a sparql endpoint as in
https://www.topquadrant.com/doc/7.1/user_guide/working_with_asset_collections/using_sparql_to_query_and_modify_data.html?highlight=insert
might work if all my data is a simply query/insert - in a
parameterless function, but I would like to have the option of
manipulating data in ADS and potentially introducing external lookup,
validation after transformation and/or human review activities.
I probably want to use transaction() eventually if I encounter some
error.
What is available -- or if not what approach fits into the EDG
architecture best?
--
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/3868b242-d714-4a4c-a837-03a6ad7061d4n%40googlegroups.com
<https://groups.google.com/d/msgid/topbraid-users/3868b242-d714-4a4c-a837-03a6ad7061d4n%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
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/73f52167-ede7-4a7c-0344-64f9653e9982%40topquadrant.com.