From 5ee2bd81273ee0a3d58f7869607438f0fdc04258 Mon Sep 17 00:00:00 2001 From: Yibei Chen Date: Sat, 15 Jun 2024 19:31:10 +0000 Subject: [PATCH 01/25] create release folder --- releases/1.0.0/base | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 releases/1.0.0/base diff --git a/releases/1.0.0/base b/releases/1.0.0/base new file mode 100644 index 0000000000..ac6fb734d8 --- /dev/null +++ b/releases/1.0.0/base @@ -0,0 +1,18 @@ +{ + "@context": { + "@version": 1.1, + "dct": "http://purl.org/dc/terms/", + "owl": "http://www.w3.org/2002/07/owl#", + "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + "rdfa": "http://www.w3.org/ns/rdfa#", + "rdfs": "http://www.w3.org/2000/01/rdf-schema#", + "schema": "http://schema.org/", + "xsd": "http://www.w3.org/2001/XMLSchema#", + "skos": "http://www.w3.org/2004/02/skos/core#", + "prov": "http://www.w3.org/ns/prov#", + "pav": "http://purl.org/pav/", + "nidm": "http://purl.org/nidash/nidm#", + "uuid": "http://uuid.repronim.org/", + "reproschema": "http://schema.repronim.org/" + } +} From 7dfd659048f4afb9a79ba2fb2caa30455bfb76f7 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Sun, 16 Jun 2024 09:31:02 -0400 Subject: [PATCH 02/25] temp: adding another branch to the workflow --- .github/workflows/publishdocs.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publishdocs.yaml b/.github/workflows/publishdocs.yaml index 45459add27..9062e28afe 100644 --- a/.github/workflows/publishdocs.yaml +++ b/.github/workflows/publishdocs.yaml @@ -3,6 +3,7 @@ on: push: branches: - main + - doc/addlinkml jobs: build: From 2dde37685c239afca63aa41721fcb3ed3d259e0e Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Mon, 17 Jun 2024 10:00:18 -0400 Subject: [PATCH 03/25] removing creator slot that is not used --- linkml-schema/reproschema.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/linkml-schema/reproschema.yaml b/linkml-schema/reproschema.yaml index 8afcaf3fd9..0eedfc1527 100644 --- a/linkml-schema/reproschema.yaml +++ b/linkml-schema/reproschema.yaml @@ -101,9 +101,6 @@ slots: contentUrl: slot_uri: schema:contentUrl range: uriorcurie - creator: - slot_uri: schema:creator - range: Person cronTable: title: cronTable description: TODO not described in reproschema From 70379b1d09a9ff4a6140fe8b3933ad609b0f5004 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Mon, 17 Jun 2024 10:00:34 -0400 Subject: [PATCH 04/25] adding doc generation to ga --- .github/workflows/publishdocs.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/publishdocs.yaml b/.github/workflows/publishdocs.yaml index 9062e28afe..6682d5a97e 100644 --- a/.github/workflows/publishdocs.yaml +++ b/.github/workflows/publishdocs.yaml @@ -13,6 +13,23 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.9 + + - name: Install the required python packages + run: python -m pip install linkml mkdocs-material mkdocs-mermaid2-plugin + + - name: Other installations + run: | + sudo apt-get update + sudo apt-get install -y build-essential git wget curl + + - name: Generating docs + run: | + gen-doc -d docs linkml-schema/library_generation.yaml + - name: Deploy docs uses: mhausenblas/mkdocs-deploy-gh-pages@master env: From daf15b6e77068ae2d3ffb036438339b5ca9fce1a Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Mon, 17 Jun 2024 10:04:07 -0400 Subject: [PATCH 05/25] fixing ga --- .github/workflows/publishdocs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publishdocs.yaml b/.github/workflows/publishdocs.yaml index 6682d5a97e..88c78eaf5e 100644 --- a/.github/workflows/publishdocs.yaml +++ b/.github/workflows/publishdocs.yaml @@ -28,7 +28,7 @@ jobs: - name: Generating docs run: | - gen-doc -d docs linkml-schema/library_generation.yaml + gen-doc -d docs/model linkml-schema/reproschema.yaml - name: Deploy docs uses: mhausenblas/mkdocs-deploy-gh-pages@master From a02304c35c54577343548e052297254d2134cd35 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Mon, 17 Jun 2024 10:12:06 -0400 Subject: [PATCH 06/25] adding model to the menu --- mkdocs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/mkdocs.yml b/mkdocs.yml index 5721e4d33d..426428e847 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -40,6 +40,7 @@ nav: - Introduction: "introduction.md" - Project structure: "project-structure.md" - Schema: "schema.md" + - Model: "model/index.md" - User Guide: - Create a research protocol: "user-guide/create-new-protocol.md" - Adopt assessments from the library: "user-guide/adopt-assessments.md" From a04ba3f74f129eb0b8cd3f853f9e8d56106399dd Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Mon, 17 Jun 2024 11:10:26 -0400 Subject: [PATCH 07/25] adding model index to the schema section --- .github/workflows/publishdocs.yaml | 1 + docs/schema.md | 235 +---------------------------- mkdocs.yml | 1 - 3 files changed, 3 insertions(+), 234 deletions(-) diff --git a/.github/workflows/publishdocs.yaml b/.github/workflows/publishdocs.yaml index 88c78eaf5e..8d90da84f5 100644 --- a/.github/workflows/publishdocs.yaml +++ b/.github/workflows/publishdocs.yaml @@ -29,6 +29,7 @@ jobs: - name: Generating docs run: | gen-doc -d docs/model linkml-schema/reproschema.yaml + gen-erdiagram linkml-schema/reproschema.yaml > docs/model/erdiagram.md - name: Deploy docs uses: mhausenblas/mkdocs-deploy-gh-pages@master diff --git a/docs/schema.md b/docs/schema.md index b66d0744ed..b0b3c8d384 100644 --- a/docs/schema.md +++ b/docs/schema.md @@ -82,236 +82,5 @@ different elements of the schema. ## Properties of ReproSchema objects -This section lists the core ReproSchema objects and their allowed properties. - - - - -### Protocol -A representation of a study which comprises one or more assessments. - -**URI:** [http://schema.repronim.org/Protocol](http://schema.repronim.org/Protocol) - -| Name | Description | URI | -| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| addProperties | An array of objects to describe the various properties added to assessments and fields. | [http://schema.repronim.org/addProperties](http://schema.repronim.org/addProperties) | -| allow | An array of items indicating properties allowed on an activity or protocol | [http://schema.repronim.org/allow](http://schema.repronim.org/allow) | -| compute | An array of objects indicating computations in an activity or protocol and maps it to the corresponding Field item. scoring logic is a subset of all computations that could be performed and not all computations will be scoring. For example, one may want to do conversion from one unit to another. | [http://schema.repronim.org/compute](http://schema.repronim.org/compute) | -| landingPage | An element (by URL) to point to the protocol readme or landing page. | [http://schema.repronim.org/landingPage](http://schema.repronim.org/landingPage) | -| messages | An array of objects to define conditional messages in an activity or protocol. | [http://schema.repronim.org/messages](http://schema.repronim.org/messages) | -| order | An ordered list to describe the order in which the items of an assessment or protocol appear in the user interface. | [http://schema.repronim.org/order](http://schema.repronim.org/order) | -| overrideProperties | An array of objects to override the various properties added to assessments and fields. | [http://schema.repronim.org/overrideProperties](http://schema.repronim.org/overrideProperties) | -| preamble | The preamble for an assessment | [http://schema.repronim.org/preamble](http://schema.repronim.org/preamble) | -| shuffle | An element (bool) to determine if the list of items is shuffled or in order. | [http://schema.repronim.org/shuffle](http://schema.repronim.org/shuffle) | -| about | The subject matter of the Field. | [http://schema.org/about](http://schema.org/about) | -| audio | An embedded audio object. | [http://schema.org/audio](http://schema.org/audio) | -| description | A description of the item. | [http://schema.org/description](http://schema.org/description) | -| image | An image of the item. This can be a URL or a fully described ImageObject. | [http://schema.org/image](http://schema.org/image) | -| schemaVersion | Indicates (by URL or string) a particular version of a schema used in some CreativeWork. For example, a document could declare a schemaVersion using an URL such as http://schema.org/version/2.0/ if precise indication of schema version was required by some application. | [http://schema.org/schemaVersion](http://schema.org/schemaVersion) | -| version | The version of the CreativeWork embodied by a specified resource. | [http://schema.org/version](http://schema.org/version) | -| video | An embedded video object. | [http://schema.org/video](http://schema.org/video) | -| altLabel | The alternate label. | [http://www.w3.org/2004/02/skos/core#altLabel](http://www.w3.org/2004/02/skos/core#altLabel) | -| prefLabel | The preferred label. | [http://www.w3.org/2004/02/skos/core#prefLabel](http://www.w3.org/2004/02/skos/core#prefLabel) | - -### Activity -An assessment in a protocol. - -**URI:** [http://schema.repronim.org/Activity](http://schema.repronim.org/Activity) - -| Name | Description | URI | -| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| addProperties | An array of objects to describe the various properties added to assessments and fields. | [http://schema.repronim.org/addProperties](http://schema.repronim.org/addProperties) | -| allow | An array of items indicating properties allowed on an activity or protocol | [http://schema.repronim.org/allow](http://schema.repronim.org/allow) | -| compute | An array of objects indicating computations in an activity or protocol and maps it to the corresponding Field item. scoring logic is a subset of all computations that could be performed and not all computations will be scoring. For example, one may want to do conversion from one unit to another. | [http://schema.repronim.org/compute](http://schema.repronim.org/compute) | -| cronTable | None | [http://schema.repronim.org/cronTable](http://schema.repronim.org/cronTable) | -| messages | An array of objects to define conditional messages in an activity or protocol. | [http://schema.repronim.org/messages](http://schema.repronim.org/messages) | -| order | An ordered list to describe the order in which the items of an assessment or protocol appear in the user interface. | [http://schema.repronim.org/order](http://schema.repronim.org/order) | -| overrideProperties | An array of objects to override the various properties added to assessments and fields. | [http://schema.repronim.org/overrideProperties](http://schema.repronim.org/overrideProperties) | -| preamble | The preamble for an assessment | [http://schema.repronim.org/preamble](http://schema.repronim.org/preamble) | -| shuffle | An element (bool) to determine if the list of items is shuffled or in order. | [http://schema.repronim.org/shuffle](http://schema.repronim.org/shuffle) | -| about | The subject matter of the Field. | [http://schema.org/about](http://schema.org/about) | -| audio | An embedded audio object. | [http://schema.org/audio](http://schema.org/audio) | -| citation | A citation or reference to another creative work, such as another publication, web page, scholarly article, etc. | [http://schema.org/citation](http://schema.org/citation) | -| description | A description of the item. | [http://schema.org/description](http://schema.org/description) | -| image | An image of the item. This can be a URL or a fully described ImageObject. | [http://schema.org/image](http://schema.org/image) | -| schemaVersion | Indicates (by URL or string) a particular version of a schema used in some CreativeWork. For example, a document could declare a schemaVersion using an URL such as http://schema.org/version/2.0/ if precise indication of schema version was required by some application. | [http://schema.org/schemaVersion](http://schema.org/schemaVersion) | -| version | The version of the CreativeWork embodied by a specified resource. | [http://schema.org/version](http://schema.org/version) | -| video | An embedded video object. | [http://schema.org/video](http://schema.org/video) | -| altLabel | The alternate label. | [http://www.w3.org/2004/02/skos/core#altLabel](http://www.w3.org/2004/02/skos/core#altLabel) | -| prefLabel | The preferred label. | [http://www.w3.org/2004/02/skos/core#prefLabel](http://www.w3.org/2004/02/skos/core#prefLabel) | - -### Field -An item in an assessment. - -**URI:** [http://schema.repronim.org/Field](http://schema.repronim.org/Field) - -| Name | Description | URI | -| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| additionalNotesObj | A set of objects to define notes in a field. For example, most Redcap and NDA data dictionaries have notes for each item which needs to be captured in reproschema. | [http://schema.repronim.org/additionalNotesObj](http://schema.repronim.org/additionalNotesObj) | -| inputType | An element to describe the input type of a Field item. | [http://schema.repronim.org/inputType](http://schema.repronim.org/inputType) | -| preamble | The preamble for an assessment | [http://schema.repronim.org/preamble](http://schema.repronim.org/preamble) | -| responseOptions | An element (object or by URL)to describe the properties of response of the Field item. | [http://schema.repronim.org/responseOptions](http://schema.repronim.org/responseOptions) | -| about | The subject matter of the Field. | [http://schema.org/about](http://schema.org/about) | -| audio | An embedded audio object. | [http://schema.org/audio](http://schema.org/audio) | -| description | A description of the item. | [http://schema.org/description](http://schema.org/description) | -| image | An image of the item. This can be a URL or a fully described ImageObject. | [http://schema.org/image](http://schema.org/image) | -| isPartOf | Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of. | [http://schema.org/isPartOf](http://schema.org/isPartOf) | -| question | A sub property of object. A question. | [http://schema.org/question](http://schema.org/question) | -| readonlyValue | Whether or not a property is mutable. Default is false. Specifying this for a property that also has a value makes it act similar to a "hidden" input in an HTML form. | [http://schema.org/readonlyValue](http://schema.org/readonlyValue) | -| schemaVersion | Indicates (by URL or string) a particular version of a schema used in some CreativeWork. For example, a document could declare a schemaVersion using an URL such as http://schema.org/version/2.0/ if precise indication of schema version was required by some application. | [http://schema.org/schemaVersion](http://schema.org/schemaVersion) | -| version | The version of the CreativeWork embodied by a specified resource. | [http://schema.org/version](http://schema.org/version) | -| video | An embedded video object. | [http://schema.org/video](http://schema.org/video) | -| altLabel | The alternate label. | [http://www.w3.org/2004/02/skos/core#altLabel](http://www.w3.org/2004/02/skos/core#altLabel) | -| prefLabel | The preferred label. | [http://www.w3.org/2004/02/skos/core#prefLabel](http://www.w3.org/2004/02/skos/core#prefLabel) | - -### AdditionalProperty -An object to describe the various properties added to assessments and fields. - -**URI:** [http://schema.repronim.org/AdditionalProperty](http://schema.repronim.org/AdditionalProperty) - -| Name | Description | URI | -| -------------- | -------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| allow | An array of items indicating properties allowed on an activity or protocol | [http://schema.repronim.org/allow](http://schema.repronim.org/allow) | -| isAbout | A pointer to the node describing the item. | [http://schema.repronim.org/isAbout](http://schema.repronim.org/isAbout) | -| isVis | An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment. | [http://schema.repronim.org/isVis](http://schema.repronim.org/isVis) | -| limit | An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available. | [http://schema.repronim.org/limit](http://schema.repronim.org/limit) | -| maxRetakes | Defines number of times the item is allowed to be redone. | [http://schema.repronim.org/maxRetakes](http://schema.repronim.org/maxRetakes) | -| randomMaxDelay | Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration | [http://schema.repronim.org/randomMaxDelay](http://schema.repronim.org/randomMaxDelay) | -| schedule | An element to set make activity available/repeat info using ISO 8601 repeating interval format. | [http://schema.repronim.org/schedule](http://schema.repronim.org/schedule) | -| variableName | The name used to represent an item. | [http://schema.repronim.org/variableName](http://schema.repronim.org/variableName) | -| valueRequired | Whether the property must be filled in to complete the action. Default is false. | [http://schema.org/valueRequired](http://schema.org/valueRequired) | -| prefLabel | The preferred label. | [http://www.w3.org/2004/02/skos/core#prefLabel](http://www.w3.org/2004/02/skos/core#prefLabel) | - -### OverrideProperty -An object to override the various properties added to assessments and fields. - -**URI:** [http://schema.repronim.org/OverrideProperty](http://schema.repronim.org/OverrideProperty) - -| Name | Description | URI | -| -------------- | -------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| isAbout | A pointer to the node describing the item. | [http://schema.repronim.org/isAbout](http://schema.repronim.org/isAbout) | -| isVis | An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment. | [http://schema.repronim.org/isVis](http://schema.repronim.org/isVis) | -| limit | An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available. | [http://schema.repronim.org/limit](http://schema.repronim.org/limit) | -| maxRetakes | Defines number of times the item is allowed to be redone. | [http://schema.repronim.org/maxRetakes](http://schema.repronim.org/maxRetakes) | -| randomMaxDelay | Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration | [http://schema.repronim.org/randomMaxDelay](http://schema.repronim.org/randomMaxDelay) | -| schedule | An element to set make activity available/repeat info using ISO 8601 repeating interval format. | [http://schema.repronim.org/schedule](http://schema.repronim.org/schedule) | -| variableName | The name used to represent an item. | [http://schema.repronim.org/variableName](http://schema.repronim.org/variableName) | -| valueRequired | Whether the property must be filled in to complete the action. Default is false. | [http://schema.org/valueRequired](http://schema.org/valueRequired) | -| prefLabel | The preferred label. | [http://www.w3.org/2004/02/skos/core#prefLabel](http://www.w3.org/2004/02/skos/core#prefLabel) | - -### UnitOption -An object to represent a human displayable name alongside the more formal value for units. - -**URI:** [http://schema.repronim.org/UnitOption](http://schema.repronim.org/UnitOption) - -| Name | Description | URI | -| --------- | ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| value | The value for each option in choices or in additionalNotesObj | [http://schema.repronim.org/value](http://schema.repronim.org/value) | -| prefLabel | The preferred label. | [http://www.w3.org/2004/02/skos/core#prefLabel](http://www.w3.org/2004/02/skos/core#prefLabel) | - -### ResponseOption -An element (object or by URL)to describe the properties of response of the Field item. - -**URI:** [http://schema.repronim.org/ResponseOption](http://schema.repronim.org/ResponseOption) - -| Name | Description | URI | -| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| choices | An array to list the available options for response of the Field item. | [http://schema.repronim.org/choices](http://schema.repronim.org/choices) | -| datumType | Indicates what type of datum the response is (e.g. range,count,scalar etc.) for the Field item. | [http://schema.repronim.org/datumType](http://schema.repronim.org/datumType) | -| multipleChoice | Indicates (by bool) if response for the Field item has one or more answer. | [http://schema.repronim.org/multipleChoice](http://schema.repronim.org/multipleChoice) | -| unitOptions | A list of objects to represent a human displayable name alongside the more formal value for units. | [http://schema.repronim.org/unitOptions](http://schema.repronim.org/unitOptions) | -| valueType | The type of the response of an item. For example, string, integer, etc. | [http://schema.repronim.org/valueType](http://schema.repronim.org/valueType) | -| maxValue | The upper value of some characteristic or property. | [http://schema.org/maxValue](http://schema.org/maxValue) | -| minValue | The lower value of some characteristic or property. | [http://schema.org/minValue](http://schema.org/minValue) | -| unitCode | The unit of measurement given using the UN/CEFACT Common Code (3 characters) or a URL. Other codes than the UN/CEFACT Common Code may be used with a prefix followed by a colon. | [http://schema.org/unitCode](http://schema.org/unitCode) | - -### Choice -An object to describe a response option. - -**URI:** [http://schema.repronim.org/Choice](http://schema.repronim.org/Choice) - -| Name | Description | URI | -| ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | -| value | The value for each option in choices or in additionalNotesObj | [http://schema.repronim.org/value](http://schema.repronim.org/value) | -| image | An image of the item. This can be a URL or a fully described ImageObject. | [http://schema.org/image](http://schema.org/image) | -| name | The name of the item. | [http://schema.org/name](http://schema.org/name) | - -### ComputeSpecification -An object to define computations in an activity or protocol. - -**URI:** [http://schema.repronim.org/ComputeSpecification](http://schema.repronim.org/ComputeSpecification) - -| Name | Description | URI | -| ------------ | ---------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| jsExpression | A JavaScript expression to compute a score from other variables. | [http://schema.repronim.org/jsExpression](http://schema.repronim.org/jsExpression) | -| variableName | The name used to represent an item. | [http://schema.repronim.org/variableName](http://schema.repronim.org/variableName) | - -### MessageSpecification -An object to define messages in an activity or protocol. - -**URI:** [http://schema.repronim.org/MessageSpecification](http://schema.repronim.org/MessageSpecification) - -| Name | Description | URI | -| ------------ | ---------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| jsExpression | A JavaScript expression to compute a score from other variables. | [http://schema.repronim.org/jsExpression](http://schema.repronim.org/jsExpression) | -| message | The message to be conditionally displayed for an item. | [http://schema.repronim.org/message](http://schema.repronim.org/message) | - -### AdditionalNoteObj -A set of objects to define notes in a field. For example, most Redcap and NDA data dictionaries have notes for each item which needs to be captured in reproschema - -**URI:** [http://schema.repronim.org/AdditionalNoteObj](http://schema.repronim.org/AdditionalNoteObj) - -| Name | Description | URI | -| ------ | -------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| column | An element to define the column name where the note was taken from. | [http://schema.repronim.org/column](http://schema.repronim.org/column) | -| source | An element to define the source (eg. RedCap, NDA) where the note was taken from. | [http://schema.repronim.org/source](http://schema.repronim.org/source) | -| value | The value for each option in choices or in additionalNotesObj | [http://schema.repronim.org/value](http://schema.repronim.org/value) | - -### ResponseActivity -Captures information about some action that took place. It also links to information (entities) that were used during the activity - -**URI:** [http://schema.repronim.org/ResponseActivity](http://schema.repronim.org/ResponseActivity) - -| Name | Description | URI | -| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | -| endedAtTime | None | [http://www.w3.org/ns/prov#endedAtTime](http://www.w3.org/ns/prov#endedAtTime) | -| generated | None | [http://www.w3.org/ns/prov#generated](http://www.w3.org/ns/prov#generated) | -| startedAtTime | None | [http://www.w3.org/ns/prov#startedAtTime](http://www.w3.org/ns/prov#startedAtTime) | -| used | None | [http://www.w3.org/ns/prov#used](http://www.w3.org/ns/prov#used) | -| wasAssociatedWith | None | [http://www.w3.org/ns/prov#wasAssociatedWith](http://www.w3.org/ns/prov#wasAssociatedWith) | -| inLanguage | The language of the content or performance or used in an action. Please use one of the language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also [[availableLanguage]]. | [http://schema.org/inLanguage](http://schema.org/inLanguage) | - -### Response -Describes the response of an item. - -**URI:** [http://schema.repronim.org/Response](http://schema.repronim.org/Response) - -| Name | Description | URI | -| --------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| wasAttributedTo | None | [http://www.w3.org/ns/prov#wasAttributedTo](http://www.w3.org/ns/prov#wasAttributedTo) | -| isAbout | A pointer to the node describing the item. | [http://schema.repronim.org/isAbout](http://schema.repronim.org/isAbout) | -| value | The value for each option in choices or in additionalNotesObj | [http://schema.repronim.org/value](http://schema.repronim.org/value) | - -### Participant -An Agent describing characteristics associated with a participant. - -**URI:** [http://schema.repronim.org/Participant](http://schema.repronim.org/Participant) - -| Name | Description | URI | -| ---------- | ------------------------------- | -------------------------------------------------------------------------------- | -| subject_id | The identifier of a participant | [http://purl.org/nidash/nidm#subject_id](http://purl.org/nidash/nidm#subject_id) | - -### SoftwareAgent -Captures information about some action that took place. It also links to information (entities) that were used during the activity - -**URI:** [http://schema.repronim.org/SoftwareAgent](http://schema.repronim.org/SoftwareAgent) - -| Name | Description | URI | -| ------- | ----------------------------------------------------------------- | ------------------------------------------------------ | -| url | URL of the item. | [http://schema.org/url](http://schema.org/url) | -| version | The version of the CreativeWork embodied by a specified resource. | [http://schema.org/version](http://schema.org/version) | +- Description of the model automatically generated by LinkML tools is [here](./model/index.md) +- ER diagram to visualize the model is [here](./model/erdiagram.md) diff --git a/mkdocs.yml b/mkdocs.yml index 426428e847..5721e4d33d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -40,7 +40,6 @@ nav: - Introduction: "introduction.md" - Project structure: "project-structure.md" - Schema: "schema.md" - - Model: "model/index.md" - User Guide: - Create a research protocol: "user-guide/create-new-protocol.md" - Adopt assessments from the library: "user-guide/adopt-assessments.md" From 7c4532debb6700ba0605fd3076853ab23c6c9f6b Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Mon, 17 Jun 2024 11:18:56 -0400 Subject: [PATCH 08/25] testing GA --- .github/workflows/publishdocs.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publishdocs.yaml b/.github/workflows/publishdocs.yaml index 8d90da84f5..4aa6a79e77 100644 --- a/.github/workflows/publishdocs.yaml +++ b/.github/workflows/publishdocs.yaml @@ -2,7 +2,6 @@ name: Publish docs via GitHub Pages on: push: branches: - - main - doc/addlinkml jobs: From 3994df79d06497a16ad7340ecddc619a416af6d7 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Mon, 17 Jun 2024 12:09:15 -0400 Subject: [PATCH 09/25] schenging directory structure for schema, adding mermaid --- .github/workflows/publishdocs.yaml | 4 ++-- docs/{ => schema}/schema.md | 13 ++++++++++--- mkdocs.yml | 3 ++- 3 files changed, 14 insertions(+), 6 deletions(-) rename docs/{ => schema}/schema.md (86%) diff --git a/.github/workflows/publishdocs.yaml b/.github/workflows/publishdocs.yaml index 4aa6a79e77..3c7bdbcca9 100644 --- a/.github/workflows/publishdocs.yaml +++ b/.github/workflows/publishdocs.yaml @@ -27,8 +27,8 @@ jobs: - name: Generating docs run: | - gen-doc -d docs/model linkml-schema/reproschema.yaml - gen-erdiagram linkml-schema/reproschema.yaml > docs/model/erdiagram.md + gen-doc -d docs/schema/doc-linkml-autogen linkml-schema/reproschema.yaml + gen-erdiagram linkml-schema/reproschema.yaml > docs/schema/erdiagram-autogen.md - name: Deploy docs uses: mhausenblas/mkdocs-deploy-gh-pages@master diff --git a/docs/schema.md b/docs/schema/schema.md similarity index 86% rename from docs/schema.md rename to docs/schema/schema.md index b0b3c8d384..568c0b1319 100644 --- a/docs/schema.md +++ b/docs/schema/schema.md @@ -80,7 +80,14 @@ Protocol The [ReproSchema-UI](https://repronim.org/reproschema-ui) is a prototype implementation of an UI that leverages these different elements of the schema. -## Properties of ReproSchema objects +## ReproSchema Model -- Description of the model automatically generated by LinkML tools is [here](./model/index.md) -- ER diagram to visualize the model is [here](./model/erdiagram.md) +The model was written using a linked data modeling language [LinkML](https://linkml.io/linkml/). + +There are multiple ways of accessing the content +- [The LinkML YAML file that defines the model](https://github.com/ReproNim/reproschema/blob/main/linkml-schema/reproschema.yaml) +- [Automatically generated documentation](./doc-linkml-autogen/index.md) using LinkML tools +- [Automatically generated Entity-Relationship (ER) Diagrams](./erdiagram-autogen.md)) to visualize the model. + +The context was created semi-automatically: the initial version was generated using LinkML tools, +but manual curation was necessary to support all Reeproschema features. diff --git a/mkdocs.yml b/mkdocs.yml index 5721e4d33d..b28ca2d0a8 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -39,7 +39,7 @@ nav: - Welcome: "index.md" - Introduction: "introduction.md" - Project structure: "project-structure.md" - - Schema: "schema.md" + - Schema: "schema/schema.md" - User Guide: - Create a research protocol: "user-guide/create-new-protocol.md" - Adopt assessments from the library: "user-guide/adopt-assessments.md" @@ -84,3 +84,4 @@ watch: plugins: - search - tags + - mermaid2 From 9c3868f1cf047778a5b27d0e48c460bd66520938 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Mon, 17 Jun 2024 12:18:04 -0400 Subject: [PATCH 10/25] moving mermaid to the requirements.txt --- .github/workflows/publishdocs.yaml | 2 +- requirements.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publishdocs.yaml b/.github/workflows/publishdocs.yaml index 3c7bdbcca9..52884b13bc 100644 --- a/.github/workflows/publishdocs.yaml +++ b/.github/workflows/publishdocs.yaml @@ -18,7 +18,7 @@ jobs: python-version: 3.9 - name: Install the required python packages - run: python -m pip install linkml mkdocs-material mkdocs-mermaid2-plugin + run: python -m pip install linkml - name: Other installations run: | diff --git a/requirements.txt b/requirements.txt index a9afbecb6e..ea2a6fdce2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ rdflib==5.0.0 mkdocs-material pymdown-extensions +mkdocs-mermaid2-plugin From 44282363d8c1e6dac1d4611e54a781f80f8f3790 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Mon, 17 Jun 2024 12:27:25 -0400 Subject: [PATCH 11/25] testing mermaid --- .github/workflows/publishdocs.yaml | 5 ++++- mkdocs.yml | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publishdocs.yaml b/.github/workflows/publishdocs.yaml index 52884b13bc..efe7444659 100644 --- a/.github/workflows/publishdocs.yaml +++ b/.github/workflows/publishdocs.yaml @@ -18,7 +18,7 @@ jobs: python-version: 3.9 - name: Install the required python packages - run: python -m pip install linkml + run: python -m pip install linkml mkdocs-material mkdocs-mermaid2-plugin - name: Other installations run: | @@ -30,6 +30,9 @@ jobs: gen-doc -d docs/schema/doc-linkml-autogen linkml-schema/reproschema.yaml gen-erdiagram linkml-schema/reproschema.yaml > docs/schema/erdiagram-autogen.md + - name: Build MkDocs site + run: mkdocs build + - name: Deploy docs uses: mhausenblas/mkdocs-deploy-gh-pages@master env: diff --git a/mkdocs.yml b/mkdocs.yml index b28ca2d0a8..902b057d08 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -39,7 +39,9 @@ nav: - Welcome: "index.md" - Introduction: "introduction.md" - Project structure: "project-structure.md" - - Schema: "schema/schema.md" + - Schema: + - Schema overview: "schema/schema.md" + - Schema documentation: "schema/doc-linkml-autogen/index.md" - User Guide: - Create a research protocol: "user-guide/create-new-protocol.md" - Adopt assessments from the library: "user-guide/adopt-assessments.md" From 7b1b9b974671ed6a22b7092c0a4299c96657f696 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Mon, 17 Jun 2024 12:39:47 -0400 Subject: [PATCH 12/25] fixing link --- docs/schema/schema.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/schema/schema.md b/docs/schema/schema.md index 568c0b1319..9bb6ef5202 100644 --- a/docs/schema/schema.md +++ b/docs/schema/schema.md @@ -19,7 +19,7 @@ A simplistic way to describe the Reprochema is to say it is organized in a hiera This schema is defined by the [Field schema](https://raw.githubusercontent.com/ReproNim/reproschema/master/terms/Field). reproschema @@ -84,10 +84,11 @@ different elements of the schema. The model was written using a linked data modeling language [LinkML](https://linkml.io/linkml/). -There are multiple ways of accessing the content -- [The LinkML YAML file that defines the model](https://github.com/ReproNim/reproschema/blob/main/linkml-schema/reproschema.yaml) -- [Automatically generated documentation](./doc-linkml-autogen/index.md) using LinkML tools -- [Automatically generated Entity-Relationship (ER) Diagrams](./erdiagram-autogen.md)) to visualize the model. +There are multiple ways of accessing the content: + +- [The LinkML YAML file that defines the model](https://github.com/ReproNim/reproschema/blob/main/linkml-schema/reproschema.yaml) +- [Automatically generated documentation](./doc-linkml-autogen/index.md) using LinkML tools +- [Automatically generated Entity-Relationship (ER) Diagrams](./erdiagram-autogen.md)) to visualize the model. The context was created semi-automatically: the initial version was generated using LinkML tools, but manual curation was necessary to support all Reeproschema features. From 0fb309ac9cf96b89f8fd9fbcd9fe1a542b4dffc9 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Mon, 17 Jun 2024 18:56:23 +0200 Subject: [PATCH 13/25] fix --- .github/workflows/publishdocs.yaml | 10 +--------- .gitignore | 6 +++++- .pre-commit-config.yaml | 5 +++++ docs/index.md | 2 +- docs/project-structure.md | 2 +- mkdocs.yml | 7 ++++++- 6 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/publishdocs.yaml b/.github/workflows/publishdocs.yaml index efe7444659..a84d50bd6c 100644 --- a/.github/workflows/publishdocs.yaml +++ b/.github/workflows/publishdocs.yaml @@ -18,21 +18,13 @@ jobs: python-version: 3.9 - name: Install the required python packages - run: python -m pip install linkml mkdocs-material mkdocs-mermaid2-plugin - - - name: Other installations - run: | - sudo apt-get update - sudo apt-get install -y build-essential git wget curl + run: python -m pip install linkml - name: Generating docs run: | gen-doc -d docs/schema/doc-linkml-autogen linkml-schema/reproschema.yaml gen-erdiagram linkml-schema/reproschema.yaml > docs/schema/erdiagram-autogen.md - - name: Build MkDocs site - run: mkdocs build - - name: Deploy docs uses: mhausenblas/mkdocs-deploy-gh-pages@master env: diff --git a/.gitignore b/.gitignore index 3046e3a30c..8ad8d3d1f6 100644 --- a/.gitignore +++ b/.gitignore @@ -4,8 +4,12 @@ protocols/.DS_Store .idea/ -node_modules local_data +# ignore linkml auto generated doc +docs/schema/doc-linkml-autogen +docs/schema/erdiagram-autogen.md + +node_modules package-lock.json package.json diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7e38b9c78d..3a1329f558 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,6 +7,11 @@ repos: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml + exclude: | + (?x)^( + docs/specification/.* + | mkdocs.yml + )$ - id: check-json - id: check-ast - id: check-added-large-files diff --git a/docs/index.md b/docs/index.md index f33964d600..464cfe3f25 100644 --- a/docs/index.md +++ b/docs/index.md @@ -17,7 +17,7 @@ things are to use the ReproSchema but some "big picture" conceptual understandin could save you from a lot of confusion. 😉 - Not sure how the project is organized? Check out the [project structure](./project-structure.md) page. -- Want more details on how the `Reproschema` itself is structured: check out our [schema page](./schema.md) +- Want more details on how the `Reproschema` itself is structured: check out our [schema page](./schema/schema.md) " - - -def edit_properties(version): - targetClasses = [ - "Protocol", - "Activity", - "Field", - "AdditionalProperty", - "OverrideProperty", - "UnitOption", - "ResponseOption", - "Choice", - "ComputeSpecification", - "MessageSpecification", - "AdditionalNoteObj", - "ResponseActivity", - "Response", - "Participant", - "SoftwareAgent", - ] - - with open("docs/schema.md") as fp: - doc = fp.readlines() - for idx, line in enumerate(doc): - if line.startswith(AUTO_LINE): - break - doc = doc[:idx] - doc.append(AUTO_LINE) - doc.append( - """\n -""" - ) - - # read all the terms - g = rl.Graph() - g.parse( - "https://raw.githubusercontent.com/schemaorg/schemaorg/main/data/releases/9.0/schema.ttl", - format="turtle", - ) - g.parse(f"releases/{version}/reproschema.ttl", format="turtle") - g.parse(f"releases/{version}/reproschema-shacl.ttl", format="turtle") - - query = """PREFIX sh: -SELECT ?obj ?prop ?desc ?objdesc -WHERE { - ?obj1 a sh:NodeShape; - sh:property [ sh:path ?prop ]; - sh:targetClass ?obj . - OPTIONAL { ?prop rdfs:comment ?desc .} - OPTIONAL { ?obj rdfs:comment ?objdesc . } -} -""" - results = list(g.query(query)) - - objects = {k: {} for k in targetClasses} - for res in results: - s = g.compute_qname(res[0]) - p = g.compute_qname(res[1]) - if s[2] not in objects: - raise ValueError(f"Unknown class: {s[2]}. Source: {res}") - objects[s[2]][p] = str(res[2]) - objects[s[2]]["klass_desc"] = str(res[3]) - for klass, props in objects.items(): - writer = MarkdownTableWriter() - writer.table_name = ( - f"{klass}\n" - f"{props['klass_desc']}\n\n" - f"**URI:** [http://schema.repronim.org/{klass}](http://schema.repronim.org/{klass})\n" - ) - writer.headers = ["Name", "Description", "URI"] - writer.value_matrix = [] - del props["klass_desc"] - for val, comment in sorted(props.items()): - property = [ - val[2], - comment, - f"[{val[1]}{val[2]}]({val[1]}{val[2]})", - ] - writer.value_matrix.append(property) - writer.margin = 1 # add a whitespace for both sides of each cell - doc.append("\n") - doc.append("##" + writer.dumps()) - with open("docs/30_schema.md", "wt") as fp: - fp.writelines(doc) - - -if __name__ == "__main__": - if len(sys.argv) < 2: - version = "master" - else: - version = sys.argv[1] - print(f"Generating classes and properties for version: {version}") - edit_properties(version) diff --git a/scripts/makeRelease.py b/scripts/makeRelease.py deleted file mode 100644 index f933d973a1..0000000000 --- a/scripts/makeRelease.py +++ /dev/null @@ -1,59 +0,0 @@ -import json -import os -import sys -from shutil import copyfile - -import rdflib as rl -from pyld import jsonld - -from reproschema.jsonldutils import to_newformat - - -def create_release(version): - # read all the terms - terms = [] - for root, _, files in os.walk("terms"): - for name in files: - terms.extend( - json.loads(to_newformat(os.path.join(root, name), "jsonld")) - ) - - kwargs = {"algorithm": "URDNA2015", "format": "application/n-quads"} - data = jsonld.normalize(terms, kwargs) - - os.makedirs(f"releases/{version}", exist_ok=True) - copyfile("contexts/base", f"releases/{version}/base") - copyfile("contexts/generic", f"releases/{version}/generic") - with open(f"releases/{version}/base") as fp: - base_context = json.load(fp) - compacted = jsonld.compact(terms, ctx=base_context) - - g = rl.Graph() - for key, val in base_context["@context"].items(): - if not key.startswith("@"): - g.namespace_manager.bind(key, val) - g.parse(data=data, format="nt") - - # write n-triples and turtle files - with open(f"releases/{version}/reproschema.jsonld", "w") as fp: - json.dump(compacted, fp, indent=2) - with open(f"releases/{version}/reproschema.nt", "w") as fp: - fp.write(data) - with open(f"releases/{version}/reproschema.ttl", "w") as fp: - fp.write(g.serialize(format="turtle")) - - g1 = rl.Graph() - g1.parse("validation/reproschema-shacl.ttl", format="turtle") - with open(f"releases/{version}/reproschema-shacl.ttl", "w") as fp: - fp.write(g1.serialize(format="turtle")) - - return g - - -if __name__ == "__main__": - if len(sys.argv) < 2: - version = "master" - else: - version = sys.argv[1] - print(f"Generating release for version: {version}") - create_release(version) From b68b2bef496e40ec42f34dd16f4d2b83420eb317 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Thu, 20 Jun 2024 13:27:37 -0400 Subject: [PATCH 25/25] adding pre-commit to readme --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 6ac5857148..d4ee7ccbc9 100644 --- a/README.md +++ b/README.md @@ -21,12 +21,21 @@ This repository contains: ## Developing ReproSchema +### Updating the schema + As of release 1.0.0, a linked data modeling language, [LinkML](https://linkml.io/linkml/), is used to create a [YAML file](linkml-schema/reproschema.yaml) with the schema. The [context file](contexts/reproschema) was automatically generated using LinkML, and then manually curated in order to support all the reproschema feature. +#### Style + +This repo uses pre-commit to check styling. +- Install pre-commit with pip: `pip install pre-commit` +- In order to use it with the repository, you have to run `run pre-commit install` in the root directory the first time you use it. + + ### Release Upon release, there are additional formats, `jsonsld`, `turtle`, `n-triples` and `pydantic` that are created using `LinkML` tools, `reproschema-py`,