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

implement publication workflow to codes.wmo.int #6

Closed
3 tasks done
tomkralidis opened this issue Feb 1, 2024 · 25 comments
Closed
3 tasks done

implement publication workflow to codes.wmo.int #6

tomkralidis opened this issue Feb 1, 2024 · 25 comments
Assignees
Labels
enhancement New feature or request

Comments

@tomkralidis
Copy link
Collaborator

tomkralidis commented Feb 1, 2024

  • update tables (@tomkralidis)
    • add source column of a URL for values that are defined external to WMO
  • investigate workflow to convert CSVs to RDF/TTL (@antje-s @josusky)
  • update specification and examples to point to new/updated codelist values (@tomkralidis)

Examples:

@josusky
Copy link
Contributor

josusky commented Feb 5, 2024

I haven't fully figured out how the upload of TTL files to (ci).codes.wmo.int works, the script from "https://github.com/wmo-im/wmds" expects some JSON as input. On the other hand, I have figured out how to adjust makeWMDREntities.py to convert "our" CSVs. Problem is what parameters should we set in the TTL files. They are generated using a textual template that sets "identity", "notation", "label" and "description". So far I have used "Name" for all of them except "description", where I have used "Description" column. But I have no idea where to put our "Source" column.

@josusky
Copy link
Contributor

josusky commented Feb 5, 2024

Oh, only now have I noticed that @antje-s has created branch csv2registry, I am going to check what is new there.

@josusky
Copy link
Contributor

josusky commented Feb 5, 2024

OK, so she went further than me. Her version of the script puts "Source" into "skos:related" and she made custom versions of other WMDS scripts too.

@tomkralidis
Copy link
Collaborator Author

Great work here! Note that if the source column is not empty, this means that the codelist value is from an upstream controlled vocabulary. In which case we should use owl:sameAs instead.

@tomkralidis
Copy link
Collaborator Author

Notes from 2024-02-07 meeting with @antje-s / @josusky

  • TTL generation (@antje-s)
    • CSV sources "Source" column: empty means local definition, else upstream/remote
    • a non-empty "Source" column should produce a an owl:sameAs and skos:exactMatch or the URL in the concept template
    • generated TTLs should not go into main branch, but a branch called publication
  • Upload to WMO Codes Registry (@josusky)
    • determine interaction / payload specifics from registry API
  • @tomkralidis will review implementation thereafter

Next meeting is on 2024-02-09.

@antje-s
Copy link
Contributor

antje-s commented Feb 9, 2024

Updated after our meeting today:

  • only add entry for source column if not empty or None
  • use "wis" as directory name in branch publication for TTLs
  • delete branch publication if exists, use always an new branch publication
  • deleted publish script files from branch "csv2registry"

I think we need for PR from csv2registry branch:
1).github/workflows/generateTTLandCommit.yml
2)scripts/makeWCMP2Entities.py
3)codelists/wcmp2-tables.csv

Many thanks for all the support, I have learned a lot again
@josusky: if you want me to do anything further, please let me know

@tomkralidis
Copy link
Collaborator Author

Next steps:

  • consolidated PR with scripts to 1. generate TTLs and 2. publish to codes.wmo.int
  • clarify publication workflow
    • main branch: CI/CD to ci.codes.wmo.int
    • release: CI/CD or manual process? Needs discussion with @amilan17

josusky added a commit that referenced this issue Feb 9, 2024
The script has been simplified, and a bit of documentation was added.
It now uploads files from a directory, so it is not necessary to construct a JSON "uploads" dictionary.
@josusky josusky mentioned this issue Feb 9, 2024
josusky added a commit that referenced this issue Feb 9, 2024
The script has been simplified, and a bit of documentation was added.
It now uploads files from a directory, so it is not necessary to construct a JSON "uploads" dictionary.
josusky added a commit that referenced this issue Feb 9, 2024
The script has been simplified, and a bit of documentation was added.
It now uploads files from a directory, so it is not necessary to construct a JSON "uploads" dictionary.
tomkralidis pushed a commit that referenced this issue Feb 9, 2024
* Create generateTTLandCommit.yml

* Create makeWCMP2Entities.py

toDo
- adding column for soure

* Create wcmp2-tables.csv

* Update wcmp2-tables.csv

* Update wcmp2-tables.csv

* Create prodRegister

* Create testRegister

* Create check_urls.py

* Create test-gen.py

* Create __init__.py

* Create generator.py

* Create registry.py

toDo 
- publish - userid
- publish - post_file

* Create generate-readme.py

* Update makeWCMP2Entities.py

* Update makeWCMP2Entities.py

* Update check_urls.py

* Update makeWCMP2Entities.py

* Update makeWCMP2Entities.py

* Update makeWCMP2Entities.py

* Update contact-role.csv

* Update global-service-type.csv

* Update link-type.csv

* Update resource-type.csv

* Github Action Commit

* Update makeWCMP2Entities.py

skos:related for our Source links?

* Github Action Commit

* Update makeWCMP2Entities.py

* Github Action Commit

* first try to other branch

* Update generateTTLandCommit.yml

* Update makeWCMP2Entities.py

* Update generateTTLandCommit.yml

* Update makeWCMP2Entities.py

* Update generateTTLandCommit.yml

* Update generateTTLandCommit.yml

* Update generateTTLandCommit.yml

* Update generateTTLandCommit.yml

* Update generateTTLandCommit.yml

* Update generateTTLandCommit.yml

* Update generateTTLandCommit.yml

* Delete ttls_wcmp2 directory

* Update test-gen.py

read registry value from file

* Create uploadChanges.py

* Update generateTTLandCommit.yml

ignore diffs to main in publiacation branch

* Update registry.py

wis2 - wis in registry-url

* Delete scripts/test-gen.py

* Delete scripts/registry_deployment directory

* Delete scripts/check_urls.py

* Delete scripts/generate-readme.py

* Update generateTTLandCommit.yml

* Update makeWCMP2Entities.py

* Delete scripts/uploadChanges.py

* Update makeWCMP2Entities.py

* Update makeWCMP2Entities.py

* Delete prodRegister

* Delete testRegister

* Add dry-run mode

* Add dry run mode to uploadChanges.py

* Refactor uploadChanges.py script #6

The script has been simplified, and a bit of documentation was added.
It now uploads files from a directory, so it is not necessary to construct a JSON "uploads" dictionary.

---------

Co-authored-by: antje-s <[email protected]>
Co-authored-by: Jan Osusky <[email protected]>
@tomkralidis
Copy link
Collaborator Author

Implemented in #8. Excellent work @antje-s and @josusky ! Thank you for landing this so quickly.

@amilan17
Copy link
Member

amilan17 commented Feb 9, 2024

The plan is to publish everything to the public codes.wmo.int registry with a status of experimental at the beginning of March. This will ensure that all of the links are active when members are reviewing the documents.

@tomkralidis
Copy link
Collaborator Author

PR update in #10 (see Notes section for required clarifications). Request for clarifications will be sent via email.

josusky added a commit that referenced this issue Feb 12, 2024
update codelist generator/publisher implementation (#6)
@tomkralidis
Copy link
Collaborator Author

Copying notes here for next steps:

  • GitHub Secrets for WMO Codes Registry publishing from GitHub Actions have not been set yet and need clarification/discussion
  • we need clarification on what/how to publish the "root" wis register. Doing so manually or automatically yields an "invalid" status

josusky added a commit that referenced this issue Feb 12, 2024
The codelists2ttl.py no longer generates wis.ttl - we are not going to change this top-level register once the WIS specification is published, so it can remain a manual process.
Fixed checking of sub-register existence and a few other minor issues in upload_changes.py.
josusky added a commit that referenced this issue Feb 12, 2024
tomkralidis pushed a commit that referenced this issue Feb 12, 2024
* fix status handling and a few typos

* Fix codelists2ttl.py and upload_changes.py #6

The codelists2ttl.py no longer generates wis.ttl - we are not going to change this top-level register once the WIS specification is published, so it can remain a manual process.
Fixed checking of sub-register existence and a few other minor issues in upload_changes.py.

* fix merging issue

* Update scripts/README.md #6
josusky added a commit that referenced this issue Feb 12, 2024
josusky added a commit that referenced this issue Feb 12, 2024
@amilan17
Copy link
Member

amilan17 commented Mar 6, 2024

@tomkralidis

@david-i-berry suggests using something different than owl:sameAs when the code and definition are copied from another source.
two ideas:
https://www.w3.org/TR/rdf-schema/#ch_isdefinedby
or
https://www.dublincore.org/specifications/dublin-core/dcmi-terms/elements11/source/

@tomkralidis
Copy link
Collaborator Author

2024-03-11

  • implement category to enable visibility of codelists on codes.wmo.int homepage (UI)
  • CI to update ci.codes.wmo.int (status=experimental)
  • WMO to update codes.wmo.int (status=approved)

Actions:

@tomkralidis
Copy link
Collaborator Author

Update: this should be ready for publication to codes.wmo.int proper. @amilan17 let us know if this is successful, at which point we can close this issue.

@david-i-berry
Copy link
Member

david-i-berry commented Mar 28, 2024

Note that the authenticate part of upload_changes needs to be modified to use port 443 at:

url = f'{base_url}/system/security/apilogin'

i.e.

url = f'{base_url}:443/system/security/apilogin'

@tomkralidis
Copy link
Collaborator Author

Thanks @david-i-berry. The result is the same whether 443 is explicitly set or not.

@josusky
Copy link
Contributor

josusky commented Mar 28, 2024

I agree with @tomkralidis, port 443 is default for HTTPS. Only if a non-standard port, let say 8181 is used, it needs to be explicitly set.

@amilan17
Copy link
Member

I was able to upload AFTER removing the global-service-type TTLs. For some reason, the software does not accept those, but the TTLS are identical to the accepted TTLS accept for the content referring to global-service-type... ?!

@josusky
Copy link
Contributor

josusky commented Mar 28, 2024 via email

@amilan17
Copy link
Member

Yes, I get the same error when trying to upload

ValueError: Cannot upload to https://ci.codes.wmo.int/wis/global-service-type: 500 : Cannot invoke "com.epimorphics.registry.core.Description.getRoot()" because the return value of "com.epimorphics.registry.store.StoreAPI.getCurrentVersion(String)" is null

@josusky
Copy link
Contributor

josusky commented Mar 28, 2024 via email

@josusky
Copy link
Contributor

josusky commented Apr 2, 2024

The error message changed a bit over the weekend, now it reveals less of the internal information, but it is still an "Internal Server Error". I don't think we can fix this from our side. @amilan17 could you please contact the server administrator and request help?

BTW, I have created a register "wis2" (https://ci.codes.wmo.int/wis2) and successfully uploaded all codes to it.

@amilan17
Copy link
Member

amilan17 commented Apr 3, 2024

@josusky how did you manage to successfully upload all codes? The error didn't prevent that on the wis2 registry?

@josusky
Copy link
Contributor

josusky commented Apr 3, 2024

It seems that the problem somehow related to the wis register.

@amilan17
Copy link
Member

amilan17 commented Apr 5, 2024

Codelists are now published to https://codes.wmo.int/ with the status of Experimental.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants