I have to define a sheaf over $X$ knowing what happens in each open for a basis of the topology of $X$. That is, I have $\mathcal{B} = \{U_i\}$ a basis of $X$, for each $U_i$ I have an $k$-algebra $K_i$ and $\rho_{U_i}^{U_j}: K_j \to K_i$ morphisms such that $\rho_{U_i}^{U_i} = id_{K_i}$ and $\rho_{U_i}^{U_j} \circ \rho_{U_j}^{U_k} = \rho_{U_i}^{U_k}$ for all $U_i \subseteq U_j \subseteq U_k \subseteq X$ and I want a sheaf over $X$ to match with the open sets of $\mathcal{B}$.
Thank you for your help.