MurmurationsNetwork / MurmurationsProtocol

Murmurations is a distributed data sharing protocol
https://murmurations.network
GNU General Public License v3.0
10 stars 1 forks source link

Add metadata to field definitions #20

Closed geoffturk closed 3 years ago

geoffturk commented 3 years ago

Add metadata object to field definitions so they are consistent with schemas.

Also, move all non-JSON Schema properties (e.g., context) into metadata.

{
  "$schema": "https://json-schema.org/draft-04/schema#",
  "id": "https://raw.githubusercontent.com/MurmurationsNetwork/MurmurationsLibrary/master/schemas/demo-v1.json",
  "title": "Demo Schema",
  "description": "A demo schema that is to be used only for testing purposes.",
  "type": "object",
  "properties": {
    "linked_schemas": {
      "$ref": "../fields/linked_schemas-v1.json"
    },
    "name": {
      "$ref": "../fields/name-v1.json"
    },
    "url": {
      "$ref": "../fields/url-v1.json"
    },
    "mission": {
      "$ref": "../fields/mission-v1.json"
    },
    "geolocation": {
      "$ref": "../fields/geolocation-v1.json"
    },
    "keywords": {
      "$ref": "../fields/keywords-v1.json"
    }
  },
  "required": [
    "linked_schemas",
    "name",
    "url"
  ],
  "metadata": {
    "creator": {
      "name": "Murmurations Network",
      "url": "https://murmurations.network"
    },
    "schema": {
      "name": "demo-v1",
      "version": 1,
      "url": "https://murmurations.network/schemas/demo.html"
    }
  }
}
{
  "title": "Mission Statement",
  "description": "A short statement of why the entity exists, what its overall goal is: what kind of product or service it provides, its primary customers or market, and its geographical region of operation.",
  "type": "string",
  "minLength": 1,
  "maxLength": 1000,
  "metadata": {
    "creator": {
      "name": "Murmurations Network",
      "url": "https://murmurations.network"
    },
    "schema": {
      "name": "mission-v1",
      "version": 1
    },
    "context": "https://en.wikipedia.org/wiki/Mission_statement"
  }
}
geoffturk commented 3 years ago

https://github.com/MurmurationsNetwork/MurmurationsLibrary/commit/0fe0ace3b2973a7da9effc8b9316d3b2ba4e8416