opencog / atomspace

The OpenCog (hyper-)graph database and graph rewriting system
https://wiki.opencog.org/w/AtomSpace
Other
795 stars 225 forks source link

Atomic grant of a link between two Atoms #3033

Closed linas closed 1 year ago

linas commented 1 year ago

Introduce a new GrantLink between source and target Atoms. This link can be created once and only once for a given source. Thread-safe, atomic, first-person wins. All subsequent attempts to create a GrantLink with the same source Atom will return the original target.

This is unlike UniqueLink, with throws an error, and unlike DefineLink, which can only be used with DefinedPredicate, DefinedSchema. It is unlike StateLink, which is similar in that only one exists for that source Atom, but StateLinks allow the target to be changed at any time. GrantLinks freeze the target to it's initial setting.

GrantLinks are needed for thread-race safe lookup tables between different atoms.

linas commented 1 year ago

Merging despite unit test failures; the URE unit tests are timing out. This pull req has no impact on URE whatsoever, it only introduces a new Atom type, and that's all.

linas commented 1 year ago

See https://wiki.opencog.org/w/GrantLink for documentation