Skip to main content

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. Publication can be done interactively from the data space marketplace by selecting the "Publish" option from the top menu, as shown in Fig. 5. The publication form first collects the necessary metadata for the dataset, including title, description, tags...

Important

To ensure that 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.

Next, the publisher must also provide how the dataset is made accessible, either through "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 (usually 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 to help 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 publication by signing the corresponding transactions, which will maintain an immutable record of the publication and link the dataset to the account that signs 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 tool.

Publishing an Algorithm

The AgrospAI data space supports the publication of datasets and algorithms. The latter are data processing services packaged as Docker containers and scripts that will run in the context of those containers. Publication is activated interactively in the same way as datasets are published, through the "Publish" menu bar option. In the associated form, it is necessary to select "Algorithm" as the asset type instead of "Dataset".

Additionally, besides metadata such as title, description, or tags, it is also necessary to define the Docker image to be used for the algorithm. Regarding access details, a pointer to the location of the script that triggers the algorithm's execution within the container must be provided. More details on how to package and run the algorithm in the data space are provided in "Writing Algorithms" from Ocean Protocol. Furthermore, examples are available in the ocean-algo repository.

Algorithms can be available for "Download" or solely for "Compute" processing. In the first case, the script used by the algorithm will be available for download once acquired. In both cases, the algorithm can be consumed along with a dataset configured for compute-to-data consumption. As with datasets, it is also possible to define the consumption deadline after acquisition or the algorithm's price. Finally, after reviewing the algorithm's metadata, publication is confirmed by signing the corresponding transactions.

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.

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 that anyone acquiring an asset (dataset or algorithm) has before it needs to be re-acquired. It ranges from 1 day to 1 year. Furthermore, the right to consume 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 allow list 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 deny list, the download or computation of this resource will be denied for the corresponding data set 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 run on the dataset, as shown in Fig. 8. Additionally, the algorithms allowed 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.