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

Link to metaschema #1723

Open
wants to merge 13 commits into
base: 1.2-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
718 changes: 482 additions & 236 deletions .tx/config

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions babel_ocds_metaschema.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[ocds_schema: schema/metaschema/meta-schema-patch.json]
4 changes: 4 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ def setup(app):
headers = ["Title", "Description", "Extension"]
# The gettext domain for schema translations. Should match the domain in the `pybabel compile` command.
schema_domain = f"{gettext_domain_prefix}schema"
# The gettext domain for metaschema translations. Should match the domain in the `pybabel compile` command.
metaschema_domain = f"{gettext_domain_prefix}metaschema"
# The gettext domain for codelist translations. Should match the domain in the `pybabel compile` command.
codelists_domain = f"{gettext_domain_prefix}codelists"

Expand All @@ -158,6 +160,8 @@ def setup(app):
[
# The glob patterns in `babel_ocds_schema.cfg` should match these filenames.
(glob(str(standard_dir / "*-schema.json")), standard_build_dir, schema_domain),
# The glob patterns in `babel_ocds_metaschema.cfg` should match these filenames.
(glob(str(standard_dir / "metaschema" / "meta-schema-patch.json")), standard_build_dir, metaschema_domain),
# The glob patterns in `babel_ocds_codelist.cfg` should match these.
(glob(str(standard_dir / "codelists" / "*.csv")), standard_build_dir / "codelists", codelists_domain),
],
Expand Down
107 changes: 107 additions & 0 deletions docs/locale/es/LC_MESSAGES/metaschema.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Spanish translations for PROJECT.
# Copyright (C) 2024 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
#
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-12-05 17:36-0500\n"
"PO-Revision-Date: 2024-12-05 17:42-0500\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: es\n"
"Language-Team: es <[email protected]>\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"

#. /properties/$ref/title
#: schema/metaschema/meta-schema-patch.json:1
msgid "URI Reference"
msgstr ""

#. /properties/$ref/description
#: schema/metaschema/meta-schema-patch.json:1
msgid ""
"A reference to a statically identified schema. This keyword must be set "
"to an absolute URI or a relative reference as defined by [RFC "
"3986](https://www.rfc-editor.org/info/rfc3986), where its fragment (if "
"any) can consist of a JSON Pointer as defined by [RFC "
"6901](https://datatracker.ietf.org/doc/html/rfc6901)."
msgstr ""

#. /properties/omitWhenMerged/title
#: schema/metaschema/meta-schema-patch.json:1
msgid "Omit when merged"
msgstr ""

#. /properties/omitWhenMerged/description
#: schema/metaschema/meta-schema-patch.json:1
msgid "Whether the field must be discarded during merging."
msgstr ""

#. /properties/deprecated/title
#: schema/metaschema/meta-schema-patch.json:1
msgid "Deprecated"
msgstr ""

#. /properties/deprecated/description
#: schema/metaschema/meta-schema-patch.json:1
msgid "Information about the deprecation of this field."
msgstr ""

#. /properties/deprecated/properties/deprecatedVersion/title
#: schema/metaschema/meta-schema-patch.json:1
msgid "Deprecated version"
msgstr ""

#. /properties/deprecated/properties/deprecatedVersion/description
#: schema/metaschema/meta-schema-patch.json:1
msgid "The OCDS version in which this field was first deprecated."
msgstr ""

#. /properties/deprecated/properties/description/title
#: schema/metaschema/meta-schema-patch.json:1
msgid "Description"
msgstr ""

#. /properties/deprecated/properties/description/description
#: schema/metaschema/meta-schema-patch.json:1
msgid "A description of the reason for this field's deprecation."
msgstr ""

#. /properties/codelist/title
#: schema/metaschema/meta-schema-patch.json:1
msgid "Codelist"
msgstr ""

#. /properties/codelist/description
#: schema/metaschema/meta-schema-patch.json:1
msgid ""
"The CSV file that defines the codes in the codelist that this field "
"refers to."
msgstr ""

#. /properties/openCodelist/title
#: schema/metaschema/meta-schema-patch.json:1
msgid "Open codelist"
msgstr ""

#. /properties/openCodelist/description
#: schema/metaschema/meta-schema-patch.json:1
msgid "Whether the codelist that this field refers to is an open codelist."
msgstr ""

#. /properties/wholeListMerge/title
#: schema/metaschema/meta-schema-patch.json:1
msgid "Whole list merge"
msgstr ""

#. /properties/wholeListMerge/description
#: schema/metaschema/meta-schema-patch.json:1
msgid "Whether the field's value must be treated as a literal when merging."
msgstr ""

107 changes: 107 additions & 0 deletions docs/locale/fr/LC_MESSAGES/metaschema.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# French translations for PROJECT.
# Copyright (C) 2024 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
#
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-12-05 17:36-0500\n"
"PO-Revision-Date: 2024-12-05 17:43-0500\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: fr\n"
"Language-Team: fr <[email protected]>\n"
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"

#. /properties/$ref/title
#: schema/metaschema/meta-schema-patch.json:1
msgid "URI Reference"
msgstr ""

#. /properties/$ref/description
#: schema/metaschema/meta-schema-patch.json:1
msgid ""
"A reference to a statically identified schema. This keyword must be set "
"to an absolute URI or a relative reference as defined by [RFC "
"3986](https://www.rfc-editor.org/info/rfc3986), where its fragment (if "
"any) can consist of a JSON Pointer as defined by [RFC "
"6901](https://datatracker.ietf.org/doc/html/rfc6901)."
msgstr ""

#. /properties/omitWhenMerged/title
#: schema/metaschema/meta-schema-patch.json:1
msgid "Omit when merged"
msgstr ""

#. /properties/omitWhenMerged/description
#: schema/metaschema/meta-schema-patch.json:1
msgid "Whether the field must be discarded during merging."
msgstr ""

#. /properties/deprecated/title
#: schema/metaschema/meta-schema-patch.json:1
msgid "Deprecated"
msgstr ""

#. /properties/deprecated/description
#: schema/metaschema/meta-schema-patch.json:1
msgid "Information about the deprecation of this field."
msgstr ""

#. /properties/deprecated/properties/deprecatedVersion/title
#: schema/metaschema/meta-schema-patch.json:1
msgid "Deprecated version"
msgstr ""

#. /properties/deprecated/properties/deprecatedVersion/description
#: schema/metaschema/meta-schema-patch.json:1
msgid "The OCDS version in which this field was first deprecated."
msgstr ""

#. /properties/deprecated/properties/description/title
#: schema/metaschema/meta-schema-patch.json:1
msgid "Description"
msgstr ""

#. /properties/deprecated/properties/description/description
#: schema/metaschema/meta-schema-patch.json:1
msgid "A description of the reason for this field's deprecation."
msgstr ""

#. /properties/codelist/title
#: schema/metaschema/meta-schema-patch.json:1
msgid "Codelist"
msgstr ""

#. /properties/codelist/description
#: schema/metaschema/meta-schema-patch.json:1
msgid ""
"The CSV file that defines the codes in the codelist that this field "
"refers to."
msgstr ""

#. /properties/openCodelist/title
#: schema/metaschema/meta-schema-patch.json:1
msgid "Open codelist"
msgstr ""

#. /properties/openCodelist/description
#: schema/metaschema/meta-schema-patch.json:1
msgid "Whether the codelist that this field refers to is an open codelist."
msgstr ""

#. /properties/wholeListMerge/title
#: schema/metaschema/meta-schema-patch.json:1
msgid "Whole list merge"
msgstr ""

#. /properties/wholeListMerge/description
#: schema/metaschema/meta-schema-patch.json:1
msgid "Whether the field's value must be treated as a literal when merging."
msgstr ""

13 changes: 13 additions & 0 deletions docs/schema/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,16 @@ identifiers
codelists
conformance_and_extensions
```

## Metaschema

The schemas are described by the metaschema, which is an extended version of [JSON Schema Draft 4](https://json-schema.org/specification-links#draft-4). The metaschema adds keywords related to [codelists](codelists), [deprecation](../governance/deprecation) and [merging](merging). You can [download the metaschema in JSON format](../../build/current_lang/meta-schema.json).

````{dropdown} View the metaschema

The metaschema adds the following keywords:

```{jsonschema} ../../build/current_lang/meta-schema-patch.json
```

````
6 changes: 5 additions & 1 deletion include/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ extract_codelists: $(POT_DIR)
extract_schema: $(POT_DIR)
pybabel extract -F babel_ocds_schema.cfg . -o $(POT_DIR)/$(DOMAIN_PREFIX)schema.pot

.PHONY: extract_metaschema
extract_metaschema: $(POT_DIR)
pybabel extract -F babel_ocds_metaschema.cfg . -o $(POT_DIR)/$(DOMAIN_PREFIX)metaschema.pot

# The codelist CSV files and JSON Schema files must be present for the `csv-table-no-translate` and `jsonschema`
# directives to succeed, but the contents of the files have no effect on the generated .pot files.
# See https://www.sphinx-doc.org/en/master/usage/builders/index.html#sphinx.builders.gettext.MessageCatalogBuilder
Expand All @@ -51,7 +55,7 @@ extract_markdown: current_lang.en
sphinx-build -nW --keep-going -q -b gettext $(DOCS_DIR) $(POT_DIR)

.PHONY: extract
extract: extract_theme extract_codelists extract_schema $(EXTRACT_TARGETS) extract_markdown clean_current_lang
extract: extract_theme extract_codelists extract_schema extract_metaschema $(EXTRACT_TARGETS) extract_markdown clean_current_lang

$(TRANSLATIONS:.%=docs/locale/%): docs/locale/%: FORCE
sphinx-intl update -p $(POT_DIR) -d $(LOCALE_DIR) -l "$*"
Expand Down
1 change: 1 addition & 0 deletions include/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ PDF_DELAY=20000
.PHONY: compile
compile:
pybabel compile --use-fuzzy -d $(LOCALE_DIR) -D $(DOMAIN_PREFIX)schema
pybabel compile --use-fuzzy -d $(LOCALE_DIR) -D $(DOMAIN_PREFIX)metaschema
pybabel compile --use-fuzzy -d $(LOCALE_DIR) -D $(DOMAIN_PREFIX)codelists

# Put local targets below.
2 changes: 1 addition & 1 deletion schema/dereferenced-release-schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "https://standard.open-contracting.org/schema/1__1__5/release-schema.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"$schema": "https://standard.open-contracting.org/schema/1__2__0/meta-schema.json",
"title": "Schema for an Open Contracting Release",
"description": "OCDS is used for contracts in public procurement (including design contests), concessions, public-private partnerships, government asset sales and other contexts. A \"release\" describes a single contracting or planning process at a particular point in time. One process may be described by many releases. A release may repeat or update the information provided in previous releases about the process.\\n\\nA \"compiled release\" follows the same structure as a release, but combines information about a contracting or planning process from multiple points in time into a single summary.\\n\\nOCDS defines a \"contracting process\" as: \"All the actions aimed at implementing one or more contracts. This covers tendering, awarding, contracting and implementation. It does not include actions linked to planning, as these are often less structured and may be linked to multiple contracting processes. In multi-stage procedures (e.g. framework agreements with reopening of competition), each round of competition is treated as a separate contracting process.\\n\\nProcedures that failed and were restarted are considered new processes.\\n\\nBoundaries between processes (e.g. whether two contracts result from a single process or from two processes) are set by buyers depending on their needs (e.g. efficient division of labor, clear communication with the market) and legislation (e.g. rules on using procedures and lots).\"\\n\\nOCDS defines a \"planning process\" as: \"All the actions aimed at planning one or more contracting processes. This covers, for example, need identification, budget planning, and market research.\\n\\nPlanning processes are often less structured than contracting processes, so one or more planning processes may lead to one or more contracting processes.\"",
"type": "object",
Expand Down
18 changes: 17 additions & 1 deletion schema/meta-schema.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "http://json-schema.org/draft-04/schema#",
"id": "https://standard.open-contracting.org/schema/1__2__0/meta-schema.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Core schema meta-schema",
"definitions": {
Expand Down Expand Up @@ -210,13 +210,19 @@
"$ref": "#"
},
"$ref": {
"title": "URI Reference",
"description": "A reference to a statically identified schema. This keyword must be set to an absolute URI or a relative reference as defined by [RFC 3986](https://www.rfc-editor.org/info/rfc3986), where its fragment (if any) can consist of a JSON Pointer as defined by [RFC 6901](https://datatracker.ietf.org/doc/html/rfc6901).",
"type": "string"
},
"omitWhenMerged": {
"title": "Omit when merged",
"description": "Whether the field must be discarded during merging.",
"type": "boolean",
"default": false
},
"deprecated": {
"title": "Deprecated",
"description": "Information about the deprecation of the field.",
"type": "object",
"additionalProperties": false,
"required": [
Expand All @@ -225,21 +231,31 @@
],
"properties": {
"deprecatedVersion": {
"title": "Deprecated version",
"description": "The OCDS version in which the field was first deprecated.",
"type": "string"
},
"description": {
"title": "Description",
"description": "A description of the reason for the field's deprecation.",
"type": "string"
}
}
},
"codelist": {
"title": "Codelist",
"description": "The CSV file that defines the codes in the codelist that the field refers to.",
"type": "string"
},
"openCodelist": {
"title": "Open codelist",
"description": "Whether the codelist that the field refers to is an open codelist.",
"type": "boolean",
"default": false
},
"wholeListMerge": {
"title": "Whole list merge",
"description": "Whether the field's value must be treated as a literal when merging.",
"type": "boolean",
"default": false
}
Expand Down
Loading
Loading