Notification upon individual update

Hi,

Is there a way to get warned when an indivual gets updated?

Thanks for your info.

Johan,

Hi Johan,

We don't have an explicit facility to handle this. What are you wanting to do in response to such a notification?

I can point you again to the thread here which is a generic mechanism to perform actions in response to changes to a database: How to handle nulls in SNARL

Jess

Hi Jess,

The idea is as follows. Adding a triple to the store should in some cases trigger some action. An action will most probably always result in adding an individual of a triple to an existing individual. We can use SWRL rules in some cases but we also will have some more complex business logic to execute. In this case an µService (API) should be invoked. The result of this microservice call will also result in some triples.

I think I can use the transaction listener approach for this in case the business logic to execute is more complex than we can encapsulate in SWRL.

Is it correct that extentions like this should be implemented as an OSGI bundle? The artifact should be put in the %STARDOG_HOME%\server\dbms folder?

How does Stardog know to execute the custom logic in the processIndexChange method upon transaction commit? Just by deploying the bundle?

Thanks for your help!
Johan

Stardog plug-ins use the java service loader.

That would work. Technically anything on the class path. In addition you could use %STARDOG_HOME%\server\ext or a directory pouted to by the %STARDOG_EXT% env variable.

It will get picked up by Guice in the module definition. You should be able to get a good idea how it works from any one of the examples in the Stardog-examples got repo that use this. Functions, aggregates, transaction listener. Etc

So, this approach is the right one to achieve what I want?

I don’t know if it’s the right one but I’d say that it would be a reasonable approach :wink:

I don’t mean to be flippant. I just don’t know enough about your exact use case to say definitively that this would achieve what you’re looking for but it seems like it’s headed in the right direction.

Thank you all!

I’ll give this design a try.

Kind regards,
Johan,

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.