Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define RDF/JSON-LD metadata standards for gov & groups #11301

Closed
aaronc opened this issue Mar 1, 2022 · 17 comments · Fixed by #13118
Closed

Define RDF/JSON-LD metadata standards for gov & groups #11301

aaronc opened this issue Mar 1, 2022 · 17 comments · Fixed by #13118

Comments

@aaronc
Copy link
Member

aaronc commented Mar 1, 2022

The gov and group module have a metadata field for proposals (and other elements) that we want to define JSON-LD standards for.

The basic idea of how the metadata field should be used is that either it should contain a small amount of inline JSON-LD or contain a URL which de-references to some JSON-LD.

We should describe some basic standards for this JSON-LD which define the standardized IRIs to describe basic things like:

  • title
  • description
  • forumUrl

Likely we should reuse existing IRIs from existing projects like schema.org or Dublin Core where possible.

As artifacts of this work we probably want:

  • high-level documentation with examples
  • a reusable JSON-LD context probably served under some cosmos.network URL
  • SHACL shapes graphs for validation &/or OWL ontologies (nice-to-have)

Such documents can be stored in the SDK but should be served from stable URLs, probably under cosmos.network

Note that this can be done after the 0.46 release and is not blocking.

@thelastjosh
Copy link

thelastjosh commented Mar 6, 2022

👋 coming here on Sam Hart's recommendation. A group of us are just getting started on a multi-chain standard for DAOs after releasing EIP-4824 at daostar.one/EIP. Maybe relevant for this issue?

@hxrts
Copy link
Contributor

hxrts commented Jun 24, 2022

linking the following issues so we don't forget

#10932
#11268

@LexaMichaelides
Copy link

LexaMichaelides commented Jun 29, 2022

Proposed structure for the JSON referenced by the metadata field (syntax prob not great...it's my first time).
The thinking being that the least a proposal needs to be legible on an explorer, bot, or other tooling is a title and summary but we also want people to be thinking about what it means to vote yes/no/etc on a particular proposal. Those vote meanings could be used on a voting UI as well.

Edited to add subfield for vote meanings.

{
 "@context": "",
  "title": "",
  "authors": "",
  "summary": "",
  "details": "",
  "forumURL": "",
  “votes”:
        {    
          "yesMeaning": "",
          "noMeaning": "",
          "vetoMeaning": "",
          "abstainMeaning": "",
        },

  "required": ["title","summary","votes"]
}

@thelastjosh
Copy link

Brief comment since I don’t have all the appropriate context here, but in general proposals are going to have lots of different potential options/choices. You may want to define a proposal type for generic yes/no abstain etc. Generically there are different types of proposals re: binding on chain execution, binding off chain execution, and non-binding execution (on-chain signaling), and any variety of off-chain proposals.

@hxrts
Copy link
Contributor

hxrts commented Jun 30, 2022

the proposal type should be queryable on-chain so not sure it makes sense to have that data redundantly here if it opens the door to mismatches.

@nooomski
Copy link
Contributor

nooomski commented Jul 5, 2022

Some conclusions from the last gov/groups call:

  1. Let's not use JSON-LD, for now. This adds complexity to the clients who will need to implement a JSON-LD interpreter instead of simply parsing regular JSON. We can reconsider if clear use cases arise.
  2. The votes field and their individual meanings potentially don't apply to future decision policy types with different voting options. We should use a single field instead, perhaps voteMeaning?
  3. We also need a metadata schema for a Group, a Group Policy and for a Vote. For groups we suggested:
{
  "name": "",
  "description": "",
  "groupURL": "",
  "groupForumURL": "",
}

For decision policies we didn't decide whether to include a description or not:

{
  "name": "",
  "description": "",
}

If we do not include a description, the benefit is that we could try to suggest limiting the metadata to the default 255 characters (set as a param) and keep this data on-chain instead of off-chain on IPFS as is currently what we're planning to recommend for gov & group proposals and group metadata.

For individual Votes I suggest we keep a very simple schema (if any), and keep this on-chain, again limited to 255 characters.

{
  "reason": "",
}

And lastly, do we need to define the schema like this? https://json-schema.org/learn/getting-started-step-by-step.html

@hxrts
Copy link
Contributor

hxrts commented Jul 12, 2022

would make the following changes:

vote metadata field from "reason" -> "justification"

and this is what I would use for the proposal metadata

{
  "title": "",
  "authors": "",
  "summary": "",
  "details": "",
  "forumURL": "",
  “voteOptionContext”: "",
}

@robert-zaremba
Copy link
Collaborator

@nooomski , so you don't want that groupURL will reference to a JSON document? I think we should require it from start, and keep a minimum amount of data on chain.

@hxrts
Copy link
Contributor

hxrts commented Jul 15, 2022

groupURL refers to the group's regular website

@robert-zaremba
Copy link
Collaborator

It could be groupURL -> metadata JSON.website -> regular website.

@hxrts
Copy link
Contributor

hxrts commented Jul 15, 2022

I was imagining all these things were json blobs linked by IPFS content addresses

@nooomski
Copy link
Contributor

groupURL was just meant to be a link to the website. Maybe the naming is confusing. Perhaps we should just use groupWebsite.

@hxrts
Copy link
Contributor

hxrts commented Aug 24, 2022

Proposal (both gov and group)

off-chain

{
  "title": "",
  "authors": "",
  "summary": "",
  "details": "",
  "proposalForumURL": "",
  "voteOptionContext": "",
}

Group

off-chain

{
  "name": "",
  "description": "",
  "groupWebsiteURL": "",
  "groupForumURL": "",
}

Decision policy

on-chain 255 character default
note: we debated whether to include description and whether that would force us to use an off-chain resource. I'd say let's keep it and people will just be forced to keep name and description pretty concise.

{
  "name": "",
  "description": "",
}

Vote (both gov and group)

on-chain 255 character default

{
  "justification": "",
}

@hxrts
Copy link
Contributor

hxrts commented Aug 30, 2022

ok I think the metadata above is good to go. where's the best place to add to the documentation? I can make a PR for that.

@amaury1093
Copy link
Contributor

Maybe in a new .md file in https://github.com/cosmos/cosmos-sdk/tree/main/x/group/spec? This way it will also show up on docs.cosmos.network

@hxrts
Copy link
Contributor

hxrts commented Aug 30, 2022

There are items that refer to gov module metadata as well. Should I make 2 files, the other in the equivalent gov module location?

@amaury1093
Copy link
Contributor

amaury1093 commented Aug 30, 2022

Yes, that could work. Maybe the gov one can link to the group one (or vice versa, whichever you prefer) for the shared spec.

@tac0turtle tac0turtle removed this from Cosmos-SDK Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

8 participants