## 4 Design
### Subscriber Request Assessment Module  
If the requested data for a specific topic is available in the blockchain, \(SRAM\) will skip the recommendation step and return the requested topic's data and its quality score.  
But if the subscriber has requested data on the topic, which is currently unavailable or too poor in quality, then the \(SRAM\) performs a _recommendation_. A recommendation is different from a paired data stream. While paired or grouped data streams are expected to hold a steady relationship, they may not be a direct substitute, for example, sunlight and temperature are related but cannot be substituted for each other. The substitution aims to identify another topic that measures the same thing as the original stream.  
The recommendation is performed by comparing the _tags_ of the requested topic \(\tau\) with the tags of each available topic \(\tau\in\Gamma\) in the blockchain. A generic _content-based filtering_ is used to measure the similarity between tags. It generates a similarity score between multiple documents. In this case, the \"document\" is composed of tags in the form of a short string. A minimum similarity score threshold is fixed system-wide to consider two strings as similar. Using this, the smart broker can create (\(\Gamma^{\prime}\)) containing similarity scores of maximum \(m\) topics, as shown in Equation (16), as follows:  
\[\Gamma^{\prime}=\left\{\left({{{\tau^{\prime}}_{1}},\ {s^{\prime}_{1}}} \right),\left({{{\tau^{\prime}}_{2}},\ {s^{\prime}_{2}}}\right),\ \ldots,\left({{{\tau^{\prime}}_{m-1}},\ {s^{\prime}_{m-1}}}\right)\right\} \tag{16}\]  
where \({s^{\prime}_{1}}\geq{s^{\prime}_{2}}\geq{s^{\prime}_{3}}\geq\ldots\geq{s^{ \prime}_{m-1}}\).  
Then, \(SRAM\) retrieves all the corresponding reputation scores. With all the reputation scores, it will append these reputation scores for each recommended topic as follows:  
\[\Gamma^{\prime\prime}=\left\{\left({{{\tau^{\prime}}_{1}},\ {s^{\prime}_{1}} \cdot{r^{\prime}_{1}}}\right),\ \ldots,\left({{{\tau^{\prime}}_{m-1}},\ {s^{\prime}_{m-1}}\cdot{r^{\prime}_{m-1}}}\right)\right\} \tag{17}\]  
where \({s^{\prime}_{1}}\cdot{r^{\prime}_{1}}\geq{s^{\prime}_{2}}\cdot{r^{\prime}_{2} }\geq{s^{\prime}_{3}}\cdot{r^{\prime}_{3}}\geq\ldots\geq{s^{\prime}_{m-1}} \cdot{r^{\prime}_{m-1}}\).  
Before recommending \(\Gamma^{\prime}\) to the subscriber, the SRAM checks the correlation matrix (see Equation (3)), obtains the relationship between the recommended and the requested topic, and incorporates it into the recommendation score, as shown in Equations (18) and (19) as follows:  
\[\Gamma^{\prime\prime\prime}=\left\{\left({{{\tau^{\prime}}_{1}},\ {s^{\prime}_{1}} \cdot{r^{\prime}_{1}}{a_{1}}}\right),\ \ldots,\left({{{\tau^{\prime}}_{k}},\ {s^{\prime}_{k}}\cdot{r^{\prime}_{k}}},{a_{k}} \right)\right\} \tag{18}\]  
where, \({s^{\prime}_{1}}\cdot{r^{\prime}_{1}}{a_{1}}\geq{s^{\prime}_{2}}\cdot{r^{ \prime}_{2}}{a_{2}}\geq\ldots\geq{s^{\prime}_{k}}\cdot{r^{\prime}_{k}}{a_{k}}\).  
Finally, the \(SRAM\) will send the updated set \(\Gamma^{\prime\prime}\) to the subscriber. This list of recommended topics can be large without filtering the location tags appropriately. Even after filtering the number of recommended substitute topics, it could still slow down the PS model. Hence, the SRAM can specifically restrict the number of recommended topics to \(k\). An alternative strategy could be to set a lower limit on the recommendation score as follows:  
\[f(s,r,a)=s\cdot r\cdot a \tag{19}\]  
The exact formula for this may vary between smart brokers. If the subscriber accepts some recommendations from the set, \(\Gamma^{\prime\prime\prime}\), then SRAM responds with the new topic and its quality score.