-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature/restore mex-model sphinx docs (#163)
### PR Context - this PR will restore the autogenerated sphinx documentation for github pages: https://robert-koch-institut.github.io/mex-model - to try locally: run `pdm doc` and open `docs/dist/index.html` in a browser ### Added - add "$$target" property to model, to help with de-referencing ### Changes - setup json-schema rendering for sphinx docs - fix cruft diffs in README, pyproject and requirements --------- Co-authored-by: RKIMetadataExchange <[email protected]>
- Loading branch information
1 parent
4a622e2
commit 75fb2a0
Showing
27 changed files
with
435 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,65 @@ | ||
# sphinx configuration | ||
|
||
extensions = ["myst_parser"] | ||
import importlib | ||
|
||
extensions = ["sphinx-jsonschema"] | ||
html_theme = "alabaster" | ||
html_theme_options = { | ||
"extra_nav_links": { | ||
"Fields": "#fields", | ||
"• Identifier": "#identifier", | ||
"• Link": "#link", | ||
"• Text": "#text", | ||
"Entities": "#entities", | ||
"• AccessPlatform": "#accessplatform", | ||
"• Activity": "#activity", | ||
"• BibliographicResource": "#bibliographicresource", | ||
"• Consent": "#consent", | ||
"• ContactPoint": "#contactpoint", | ||
"• Distribution": "#distribution", | ||
"• Organization": "#organization", | ||
"• OrganizationalUnit": "#organizationalunit", | ||
"• Person": "#person", | ||
"• PrimarySource": "#primarysource", | ||
"• Resource": "#resource", | ||
"• VariableGroup": "#variablegroup", | ||
"• Variable": "#variable", | ||
"Concepts": "#concepts", | ||
"• ConceptScheme": "#conceptscheme", | ||
"• Concept": "#concept", | ||
}, | ||
"page_width": "100%", | ||
"fixed_sidebar": "true", | ||
} | ||
project = "mex-model" | ||
source_suffix = {".md": "markdown"} | ||
templates_path = ["."] | ||
|
||
|
||
# Customizing json-schema conversion | ||
# see https://sphinx-jsonschema.readthedocs.io/en/latest/extensions.html | ||
|
||
|
||
def _patched_sphinx_jsonschema_simpletype(self, schema): | ||
"""Render the `useScheme` schema properties for every vocabulary type.""" | ||
rows = _original_sphinx_jsonschema_simpletype(self, schema) | ||
if "useScheme" in schema: | ||
scheme = schema.pop("useScheme") | ||
rows.append(self._line(self._cell("useScheme"), self._cell(scheme))) | ||
return rows | ||
|
||
|
||
def _patched_sphinx_jsonschema_kvpairs(self, schema, keys): | ||
"""Render `default` and `pattern` schema properties as inline code-blocks.""" | ||
for k in keys: | ||
if k in schema: | ||
value = schema[k] | ||
if k in ("default", "pattern"): | ||
schema[k] = f"``{value}``" | ||
return _original_sphinx_jsonschema_kvpairs(self, schema, keys) | ||
|
||
|
||
sjs_wide_format = importlib.import_module("sphinx-jsonschema.wide_format") | ||
_original_sphinx_jsonschema_simpletype = sjs_wide_format.WideFormat._simpletype | ||
sjs_wide_format.WideFormat._simpletype = _patched_sphinx_jsonschema_simpletype | ||
_original_sphinx_jsonschema_kvpairs = sjs_wide_format.WideFormat._kvpairs | ||
sjs_wide_format.WideFormat._kvpairs = _patched_sphinx_jsonschema_kvpairs |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
MEx Metadata Schema | ||
=================== | ||
|
||
The MEx metadata schema is used to catalog Public Health data, resources and activities | ||
of the `Robert Koch Institute (RKI) <https://www.rki.de>`_ - the federal Public Health | ||
institute of Germany - with the goal of making them findable and accessible via a web | ||
application. | ||
|
||
The MEx metadata schema enables the description of data and resources derived from the | ||
research and other activities of the RKI. In most cases, the RKI's public health data | ||
are protected by data protection laws. Instead of publishing the data itself, MEx | ||
provides descriptions about the data. The MEx metadata model is designed to provide | ||
comprehensive descriptions for RKI's public health data. MEx users can both find and | ||
assess whether the data matches their interests and needs. To achieve this, we provide | ||
detailed information about the data in the form of variables. Variables describe how the | ||
actual data is specified and form the basis for a data-based evaluation of studies, for | ||
example. | ||
|
||
To collect information, MEx uses a mixed approach: In addition to manually compiling, we | ||
also automatically extract information from various primary sources managed by the RKI | ||
departments. To model this, we rely on the W3C recommendations | ||
`DCAT <https://www.w3.org/TR/vocab-dcat-2/>`_ and | ||
`PROV-O <http://www.w3.org/TR/prov-o/>`_. | ||
|
||
Fields | ||
------ | ||
|
||
.. jsonschema:: ../mex/model/fields/identifier.json | ||
.. jsonschema:: ../mex/model/fields/link.json | ||
.. jsonschema:: ../mex/model/fields/text.json | ||
|
||
Entities | ||
-------- | ||
|
||
.. jsonschema:: ../mex/model/entities/access-platform.json | ||
.. jsonschema:: ../mex/model/entities/activity.json | ||
.. jsonschema:: ../mex/model/entities/bibliographic-resource.json | ||
.. jsonschema:: ../mex/model/entities/consent.json | ||
.. jsonschema:: ../mex/model/entities/contact-point.json | ||
.. jsonschema:: ../mex/model/entities/distribution.json | ||
.. jsonschema:: ../mex/model/entities/organization.json | ||
.. jsonschema:: ../mex/model/entities/organizational-unit.json | ||
.. jsonschema:: ../mex/model/entities/person.json | ||
:encoding: utf8 | ||
.. jsonschema:: ../mex/model/entities/primary-source.json | ||
.. jsonschema:: ../mex/model/entities/resource.json | ||
.. jsonschema:: ../mex/model/entities/variable-group.json | ||
.. jsonschema:: ../mex/model/entities/variable.json | ||
|
||
Concepts | ||
-------- | ||
|
||
.. jsonschema:: ../mex/model/entities/concept-scheme.json | ||
.. jsonschema:: ../mex/model/entities/concept.json | ||
|
||
Available concepts (aka vocabularies) soon. In the meantime, see | ||
https://github.com/robert-koch-institut/mex-model/tree/main/mex/model/vocabularies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.