Did you know ... Search Documentation:
Pack rdf_notification -- prolog/rdf_notification.pl
PublicShow source

RDF Notification.

author
- Hongxin Liang
license
- Apache License Version 2.0
 rdf_subscribe(+Topic, +Callback, -SubscriberId) is semidet
 rdf_subscribe(+Topic, +Callback, +Options, -SubscriberId) is semidet
Subscribe to the Topic which could be subject, predicate or object. When assert, retract or update event happens on the topic, Callback will be invoked. Upon successful subscription, SubscriberId will be unified and can be later on used to unsubscribe. Callback should be prefixed with a module name.

It is highly NOT recommended to do any intensive or long time computation in Callback, however if that is required, a separated thread must be used.

Supported options are:

type(+Type)
Can be subject (default), predicate or object, indicating what to subscribe.
db(+DB)
Specify which database should be monitored. If not specified, all databases will be monitored. Database refers to the fourth argument of rdf_assert/4, and sometimes it's called graph.
monitor_descendant(+Boolean)
Indicate whether descendant of the Topic should also be monitored. The default value is false and it's only applicable when type is subject. For example if Topic is a and this option is true, and there is a triple =rdf(a, b, c)= already in database, =rdf_assert(c, d, e)= will trigger a callback to subscribers of a.

N.B. subscribing to the same Topic with the same Callback and Options will result a new subscribers without having any impact on the existing one. If this is not the wanted result, unsubscribe existing one first.

 rdf_unsubscribe(+SubscriberId) is semidet
Unsubscribe the subscriber specifed by SubscriberId. Unsubscribing a non-existing subscriber does not have any impact.

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

 rdf_subscribe(Arg1, Arg2, Arg3, Arg4)