Global topic id standard for definition of configuration and formatting. #681
HGraphPunks
started this conversation in
Ideas
Replies: 1 comment
-
I've said this to you before, but I'll say it again. I like this hip a lot. What a great way to describe topic contents. It's very natural and makes a great deal of sense. Building on the examples piece of this hip, here's a schema for a Hypothetical Thread / Discussion: {
"content-type": "JSON-LD",
"schema": "thread",
"config": "seq[1,1]",
"header": "seq[2,2]"
} Config: {
"type": "config",
"setTypes": [
{
"type": "thread",
"title": "string",
"author": "string",
"authorAccount": "string",
"timestamp": "datetime",
"content": "string",
"upvotes": "integer",
"downvotes": "integer"
"tags": ["string"]
},
{
"type": "reply",
"author": "string",
"authorAccount": "string",
"timestamp": "datetime",
"content": "string",
"upvotes": "integer",
"downvotes": "integer"
}
]
} header: {
"type": "header",
"title": "Thread / Discussion on HCS",
"description": "A log of threads and discussions utilizing Hedera Consensus Service."
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
After much discussion in the previous threads, I've decided to make a new discussion with the finalized topic id idea to present a clear story and thought process. Link to old discussion here
I'm proposing that each Topic Id utilizes the memo field to define the standard type, the configuration file, and the header. I believe a simple JSONLD structure that defines the sequence numbers of each is the most flexible and scalable solution.
Example memo field on a topic id:
In the above example,
The data of the header is required to be sequential in the messages so it make be stiched and parsed in order of the messages.
If schema is set to custom, then "config" is required in the topic id memo's JSONLD and should point to sequence numbers where the types are defined for external reading. This enables updating the config through updating the memo if the data is needed to change.
Below is an example of a topic id message that defines a configuration for two types of objects to expect on the topic id, highscore and achievement.
setTypes would always be an array and defined objects that represent objects that can be expected to be found on messages. This format is JSON-LD but these config files would be in the format as defined in content-type in the topid id memo field
The objects only required field will be type. This is the linking attribute that allows anyone reading the Id to match the structure of the object in the config, to the used type in the messages and knowing what values to expect.
To do:
I'm working on finalizing the specific data models that would be set as standards in this HIP that don't require a config file. It's possible that this HIP would define the config method alone and another update could be added to determine the initial supported data format standards.
Beta Was this translation helpful? Give feedback.
All reactions