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

Conversation

BalduinLandolt
Copy link
Collaborator

resolves DEV-3901

@BalduinLandolt BalduinLandolt self-assigned this Jul 19, 2024
Copy link

linear bot commented Jul 19, 2024

@seakayone seakayone self-requested a review July 22, 2024 07:34
@seakayone
Copy link
Contributor

It is an improvement but still does not solve all the invalid json problems:

Success: 33, Error: 23, Total: 56

VALID files:
_bilddatenbank.json
fagottino.json
roud.json
limc.json
posepi.json
olympic.json
dasch.json
igeoarchive.json
mfmps.json
digitalagenda.json
waldaucinema.json
operativetv.json
beol.json
lenzburg.json
_dssl.json
reforme-geneve.json
awg.json
religious-speech.json
cache.json
stardom.json
prom_know.json
mls.json
aura-effizienz.json
drawings.json
tdk.json
societesavoie.json
biz.json
big-data-in-agriculture.json
tds.json
_rosetta.json
mark16.json
hdm.json
globalgeschichte.json

INVALID files:
postkarten.json
wordweb.json
participation-social.json
commode.json
eHKKA.json
lhtt.json
Rome.json
beyondthetext.json
portraits-pou.json
kunsthalle.json
tanner.json
_test.json
bruno-manser.json
incunabula.json
vitrocentre.json
decoso.json
sgv.json
dokubib.json
prethero.json
locusludi.json
nietzsche.json
woposs.json
delille.json

I have ported the changes over to my branch in the Rust rewrite.

seakayone added a commit to dasch-swiss/dsp-meta that referenced this pull request Jul 22, 2024
"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?

@BalduinLandolt
Copy link
Collaborator Author

It is an improvement but still does not solve all the invalid json problems:

Success: 33, Error: 23, Total: 56

VALID files:
_bilddatenbank.json
fagottino.json
roud.json
limc.json
posepi.json
olympic.json
dasch.json
igeoarchive.json
mfmps.json
digitalagenda.json
waldaucinema.json
operativetv.json
beol.json
lenzburg.json
_dssl.json
reforme-geneve.json
awg.json
religious-speech.json
cache.json
stardom.json
prom_know.json
mls.json
aura-effizienz.json
drawings.json
tdk.json
societesavoie.json
biz.json
big-data-in-agriculture.json
tds.json
_rosetta.json
mark16.json
hdm.json
globalgeschichte.json

INVALID files:
postkarten.json
wordweb.json
participation-social.json
commode.json
eHKKA.json
lhtt.json
Rome.json
beyondthetext.json
portraits-pou.json
kunsthalle.json
tanner.json
_test.json
bruno-manser.json
incunabula.json
vitrocentre.json
decoso.json
sgv.json
dokubib.json
prethero.json
locusludi.json
nietzsche.json
woposs.json
delille.json

I have ported the changes over to my branch in the Rust rewrite.

I am aware of that, but I want to keep the PR to the point: Data changes and schema changes are different things. And as stated in other places, we will probably never have all validation issues resolved because not all projects can always deliver all data at the start. So the system must be able to handle this in some way or another.

seakayone added a commit to dasch-swiss/dsp-meta that referenced this pull request Jul 22, 2024
@BalduinLandolt BalduinLandolt merged commit 18a125a into main Jul 23, 2024
4 checks passed
@BalduinLandolt BalduinLandolt deleted the feature/dev-3901-update-json-schema-according-to-the-latest-model-of branch July 23, 2024 08:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants