When two component libraries have compatible stores and each agree to share, it becomes possible for either to write to the store so that the other can read from it. In the demo the left side (PodOS) writes a triple into the store with each button click. On the right side (Sol-Component), an img tag gets its src from querying the joint store, including what PodOS just put in it.
Note: this demo is one way because PodOS doesn't have the ability to use a foreign store. It could with six lines of code if it wanted to.
data-from-query attribute, when placed in an img tag, does a live query of the store and replaces the img tag's src attribute based on CurrentPerson.
# pod-os.manifest.json — PodOS hands over its store
{
"objects": {
"provides": { "store": { "respondTo": "pod-os:loaded", "sendValue": "detail.os.store.internalStore" } }
}
}
# sol-components manifest — swc adopts it (calls its rdf.useStore handler)
{
"objects": {
"consumes": { "store": { "call": "rdf.useStore" } }
}
}