Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

chore: Update JSON schema to allow text and URL in publications #145

Merged
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
29 changes: 27 additions & 2 deletions docs/services/metadata/schema-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@
"VIAF",
"Grid",
"ORCID",
"Creative Commons"
"Creative Commons",
"DOI",
"ARK"
],
"default": "URL"
},
Expand Down Expand Up @@ -264,7 +266,8 @@
"type": "array",
"items": {
"description": "Citation form of a publication.",
"type": "string"
"type": "object",
"$ref": "#/definitions/publication"
}
},
"grants": {
Expand Down Expand Up @@ -304,6 +307,28 @@
],
"additionalProperties": false
},
"publication": {
"type": "object",
"description": "A publication.",
"properties": {
"text": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The url type already contains an optional text property....

The way you have defined the properties structure these are valid examples of a publication object:

{
  "text" : "Only text is mandatory"
}
{
  "text" : "Only text is mandatory",
  "url" : [
       {
          "url" : "https://example.com/1",
          "text" : "Url may contain a text, the publication url is a list"
       },
        {
          "url" : "https://example.com/@"
       }
  ]
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intended like so?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this is intended:
for URLs the text is what is supposed to be displayed within the <a> tag.
for publications, we do not intend to make the entire publication text the <a> tag, only parts of it.
This is conventional in citing in humanities.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Random example I got from the internet:

Alonso, Alvaro, and Julio A. Camargo. "Toxicity of Nitrite to Three Species of Freshwater Invertebrates." Environmental Toxicology, vol. 21, no. 1, 3 Feb. 2006, pp. 90-94. Wiley Online Library, doi: 10.1002/tox.20155.

Alonso, Alvaro, and Julio A. Camargo. "Toxicity of Nitrite to Three Species of Freshwater Invertebrates." Environmental Toxicology, vol. 21, no. 1, 3 Feb. 2006, pp. 90-94. Wiley Online Library, doi: [10.1002/tox.20155](https://doi.org/10.1002/tox.20155).

This would roughly map to

"publications": [
    {
        "text": "Alonso, Alvaro, and Julio A. Camargo. \"Toxicity of Nitrite to Three Species of Freshwater Invertebrates.\" Environmental Toxicology, vol. 21, no. 1, 3 Feb. 2006, pp. 90-94. Wiley Online Library, doi:"
        "url": [
            "text": "10.1002/tox.20155"
            "url": "https://doi.org/10.1002/tox.20155"
        ]
    }
]

Does that make sense now?

"type": "string",
"description": "The citation form of the publication."
},
"url": {
"description": "The URLs of the publication, preferably PIDs like DOI or ARK.",
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/url"
}
}
},
"required": [
"text"
],
"additionalProperties": false
},
"grant": {
"type": "object",
"description": "A financial grant.",
Expand Down
Loading