-
Notifications
You must be signed in to change notification settings - Fork 0
tokenInfo Internal Action
Nilson Lazarin edited this page Sep 12, 2024
·
3 revisions
Internal Actions | Wiki |
---|
(available at velluscinum >= 24.7.23)
Retrieves the content of a Token and return a belief with a list of fields, like: b(List).
.velluscinum.tokenInfo(S,A,D,q);
Parameters | Description |
---|---|
q |
It's a belief that represents the retrieved information (list) about a token. |
A |
It's a literal that represents an asset. |
D |
It's a literal that represents the wanted information (all, data, or metadata). |
S |
It's a literal that represents the address of a DLT node. |
chainServer("http://testchain.chon.group:9984/").
!start.
+!start <-
?chainServer(S);
.velluscinum.buildWallet(myWallet);
.wait(myWallet(P,Q));
.velluscinum.deployNFT(S,P,Q,"ka:vb;kb:kb","kc:vc;kd:vd",asset);
.wait(asset(A));
/* ************** Retrieving Informations from DLT ********************* */
.velluscinum.tokenInfo(S,A,all,content); /* ALL fields */
// .velluscinum.tokenInfo(S,A,data,content); /* only immutable fields */
// .velluscinum.tokenInfo(S,A,metadata,content); /* last mutable fields */
.wait(content(Content));
.print("The content of ",A," is:");
/* **************Searching data into the digital asset********************* */
!findContent("*",set(Content)); /* all FIELDs in Asset data */
// !findContent("ka",set(Content));/* a specific FIELD in Asset data */
.
+!findContent(Wanted,set([Head|Tail])) <-
!compare(Wanted,Head,set(Tail));
!findContent(Wanted,set(Tail)).
+!compare(Wanted,[Key,Value],set(V)):
(Wanted == Key) | (Wanted == "*") <-
.print("key: ", Key, " value: ", Value);
/*
TODO
*/
.
-!compare(Wanted,[Key,Value] ,set(V)) <-
.print("The key ",Key, " is not a ",Wanted)
.
-!findContent(Wanted,set([ ]))
// <- .print("End of List.")
.
Velluscinum is licensed under a Creative Commons Attribution 4.0 International License. The licensor cannot revoke these freedoms as long as you follow the license terms:
- Attribution — You must give appropriate credit like below:
Mori Lazarin, N., Machado Coelho, I., Pantoja, C.E., Viterbo, J. (2023). Velluscinum: A Middleware for Using Digital Assets in Multi-agent Systems. In: Mathieu, P., Dignum, F., Novais, P., De la Prieta, F. (eds) Advances in Practical Applications of Agents, Multi-Agent Systems, and Cognitive Mimetics. The PAAMS Collection. PAAMS 2023. Lecture Notes in Computer Science(), vol 13955. Springer, Cham. DOI: https://doi.org/10.1007/978-3-031-37616-0_17
Cite using Bibtex
@InProceedings{velluscinum,
author="Mori Lazarin, Nilson
and Machado Coelho, Igor
and Pantoja, Carlos Eduardo
and Viterbo, Jos{\'e}",
editor="Mathieu, Philippe
and Dignum, Frank
and Novais, Paulo
and De la Prieta, Fernando",
title="{Velluscinum: A Middleware for Using Digital Assets in Multi-agent Systems}",
doi="10.1007/978-3-031-37616-0_17",
booktitle="Advances in Practical Applications of Agents, Multi-Agent Systems, and Cognitive Mimetics. The PAAMS Collection",
year="2023",
publisher="Springer Nature Switzerland",
address="Cham",
pages="200--212",
isbn="978-3-031-37616-0"
}