3. Publish assets
Guide on how to publish data and services in AgrospAI.
Publishing a dataset
Adding a dataset to the data space means registering its metadata so that it appears in the marketplace for acquisition and consumption. Only the metadata is registered in the data space infrastructure; the data remains under the control of the data owner. Publishing can be done interactively from the data space marketplace by selecting the top menu option "Publish", as shown in Fig. 5. The publication form first collects the necessary metadata for the dataset, including title, description, tags...
To ensure the asset is visible and listed on the portal, it is essential to add the tag agrospai in the tags field. If this tag is not included, the asset will be registered but will not appear publicly on the portal.
Then, the publisher must also specify how the dataset is made accessible, either via "download" or "compute". In both cases, a "data provider" will mediate to enforce access rules. The default provider can be used, although the publisher is free to define a custom one. Additional access information includes where the data is available from (generally the URL from which it can be downloaded and which will be kept private by the "Data Provider"), the timeout for consumption, or a link to a sample file that helps potential consumers get an idea about the data. The next step in the form is to set the price of the dataset, which can be offered for free or for a price in EUROe, a trial version of a digital currency linked to the euro. This is the recommended currency for prices to be more transparent for consumers.
Finally, it is possible to review how the asset will be presented in the marketplace before confirming the publication by signing the corresponding transactions, which will maintain an immutable record of the publication and link the dataset to the account signing the transactions.
Fig. 5. Dataset publication form (source: https://portal.agrospai.udl.cat)
Alternatively, it is also possible to publish a dataset from code using the TypeScript library Nautilus or from the command line using the "publish" command of the Pontus-X CLI command-line tool.
Publishing an algorithm
The AgrospAI data space also supports the publication of algorithms: data processing services packaged as Docker containers. From the portal, publication is activated in the same way as for a dataset — "Publish" option from the menu bar — by selecting "Algorithm" as the asset type. In addition to the usual metadata (title, description, tags), the algorithm's Docker image and a pointer to the script that triggers its execution within the container must be specified. Algorithms can be offered for "Download" or only for "Compute", and are consumed together with a dataset configured for compute-to-data.
This section covers quick publication from the portal. If you are a developer and want the full flow — writing code with ocean-runner, building the image with docker buildx, fixing the checksum and publishing via command line with Pontus-X CLI — consult the subsection Develop algorithms.
Access and usage policies
The AgrospAI data space implements the set of access and usage policies implemented in the Pontus-X ecosystem through smart contracts and distributed ledger technology. These policies can be defined through the marketplace user interface during resource publication. Additionally, they can be configured programmatically using Nautilus or Pontus-X CLI.
For example, as shown in Fig. 6, it is possible to define the timeout period for anyone acquiring an asset (dataset or algorithm) before it needs to be re-acquired. This ranges from 1 day to 1 year. Furthermore, the right of consumption cannot expire and can be perpetual after acquisition.
Fig. 6. Definition of asset consumption timeout during publication (source: https://portal.agrospai.udl.cat)
Additional policy definition instruments during asset publication are the allowed and denied account lists, as shown in Fig. 7. The allowlist defines which data space participants can explicitly consume the resource (dataset or algorithm). If the list is empty, anyone can download or compute this resource. On the other hand, if an address is on the denylist, the download or computation of this resource will be denied for the corresponding dataset participant.
Fig. 7. Definition of allowed and denied accounts for asset consumption during publication (source: https://portal.agrospai.udl.cat)
Finally, it is also possible to edit an existing dataset configured for "compute" consumption to define the individual algorithms that can be run on the dataset, as shown in Fig. 8. Additionally, allowed algorithms for a dataset can also be customized by the dataset owner using the "edit-trusted-algos" command of the Pontus-X CLI tool.
Fig. 8. Definition of allowed algorithms for a dataset for compute consumption (source: https://portal.agrospai.udl.cat)
🎥 If you prefer, you can follow this step-by-step video guide.