Proposal: Create a ‘Document’ collection for cross-app data sharing

Edit: Updated based on feedback

I’d like to make a proposal for adding a Collections schema for notes. We have multiple note taking apps, as well as several apps using notes as part of a larger set of data that they use. This collection would serve to provide a base-level for data portability within the Blockstack ecosystem, and any other platforms that may choose to adopt this model. App developers would still be able to add additional fields that are important for their own users, use cases, and/or differentiation.

{
  "@type": "https://schema.org/DigitalDocument",
  "headline": Text,
  "text": Text,
  "keywords": Array <Text>, // Tags
  "dateCreated": Date or DateTIme,
  "dateModified": Date or DateTime,
  "encodingFormat": Text, // MIME format  (text/plain, text/html, text/markdown, application/json),
  "references": Array <URL> // URL to a DigitalDocument type audio, image, video, etc
  "favorite": Boolean // indicate favorites
  "archive": Boolean // indicate trash bin/archive
}
6 Likes

Opinions:

  • add format - could be md,html,txt, etc.
  • Timestamps should be a number - i.e. Unix timestamp. Less issues with standards, easier sorting.
  • favorite instead of fave
1 Like

A good idea! For the actual structure of the data, I’d recommend following the existing Schema.org DigitalDocument (or maybe the more specific NoteDigitalDocument or TextDigitalDocument) attribute naming. That would look something like:

{
  "@type": "https://schema.org/DigitalDocument",
  "headline": Text,
  "text": Text,
  "keywords": Text, // Tags
  "dateCreated": Date or DateTIme,
  "dateModified": Date or DateTime,
  "encodingFormat" Text or URL, // MIME format
}

The concept of “favorite”, and “archived”/“trashed” aren’t in the Schema.org class, but working with an RDF class like that, they could be added in. Or, those could be implemented as specific tags added to the keywords attribute.

4 Likes

Thanks for bringing this up, we definitely want to try and stay in line with schema.org when possible. I like keywords, and think we should also add tags/favorite.

Awesome thank you!

I would like to see version too please https://schema.org/version

1 Like

I presume a note can be shared between multiple users. In that case, each user should be able to have their own favorite notes, so favorite should not be a property of the note but rather be associated with the person or considered a relation between the person and the note.

1 Like

Properties of shared documents should be managed in something like Radiks.

Radiks is just an indexer without a state. The state (properties of shared documents) should not be in the indexer.

1 Like

Updates:
@type - reference should be to Blockstack collections schemas
schemaVersion - allow apps to handle schema updates
version - add document version per @yukan

{
      "@type": "https://github.com/blockstack/blockstack-collections",
      "schemaVersion": "Text" // version of document collection schema
      "headline": Text,
      "text": Text,
      "keywords": Array <Text>, // Tags
      "dateCreated": Date or DateTime,
      "dateModified": Date or DateTime,
      "encodingFormat": Text, // MIME format  (text/plain, text/html, text/markdown, application/json),
      "references": Array <URL> // URL to a DigitalDocument type audio, image, video, etc
      "favorite": Boolean // indicate favorites
      "archive": Boolean // indicate trash bin/archive
      "version": Text // document version
    }
1 Like

Thanks for updating, this is very helpful!