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

Draft v2.0.0 - Error in new build system prevents correct schema generation #152

Open
1 task
jh-RLI opened this issue Oct 4, 2024 · 7 comments · Fixed by #177 · May be fixed by #180
Open
1 task

Draft v2.0.0 - Error in new build system prevents correct schema generation #152

jh-RLI opened this issue Oct 4, 2024 · 7 comments · Fixed by #177 · May be fixed by #180
Assignees
Labels
bug Something isn't working

Comments

@jh-RLI
Copy link
Contributor

jh-RLI commented Oct 4, 2024

Description of the issue

The new build system to generate the full chain of: schema.json -> template.json / example.json is currently broken. There is an error that occurs during the schema resolve step. In this step the structure is read and the $refs are resolved. Based on the structure, the resources list element is generated. This element contains n objects. The jsonschema property is missing some properties:

type": "object",
properties": {

This leads to a malformed jsonschema.

Additionally, the group keys from the structure files are copied to the the generated schema.json. This is not expected as they are only used to better group the $ref elements. Thy should be replaced with the content form the reference file.

Steps to Reproduce

  1. Start the schema generation script
  2. Validate the resulting schema.json
  3. try to generate an example or template json file

Ideas of solution

Fix the scripts to properly resolve the refs and replace the ref group field names in the resulting schema.json.

Workflow checklist

@jh-RLI jh-RLI added the bug Something isn't working label Oct 4, 2024
@jh-RLI jh-RLI self-assigned this Oct 4, 2024
@Ludee
Copy link
Member

Ludee commented Oct 10, 2024

Running the scripts doesn't work for me (Windows 10).
FileNotFoundError: [Errno 2] No such file or directory: 'metadata\\v200_draft\\schema.json'

@jh-RLI
Copy link
Contributor Author

jh-RLI commented Oct 10, 2024

Okay, will adapt this to run on Windows. I run everything using Linux in WSL (on Windows).

@jh-RLI
Copy link
Contributor Author

jh-RLI commented Oct 11, 2024

Another thing the "metaMetadata" field is not added to the example metadata.

@Ludee
Copy link
Member

Ludee commented Oct 15, 2024

There is a duplication of the table name in the general keys and resource keys.

resource/Name: A resource MUST contain a name unique to amongst all resources in this data package. To comply with the data package standard it must consist of only lowercase alphanumeric character plus ".", "-" and "_". It may not start with a number. In a database this will be the name of the table within its containing schema. It would be usual for the name to correspond to the file name (minus the file-extension) of the data file the resource describes. Example:
general/Name: A filename or database conform table name.

resource/path: A URL that should be a permanent http(s) address or other path directly linking to the resource.
general/id: A unique identifier (URI/UUID/DOI) for the table or file.

Ludee added a commit that referenced this issue Oct 15, 2024
Ludee added a commit that referenced this issue Oct 15, 2024
Ludee added a commit that referenced this issue Oct 15, 2024
jh-RLI added a commit that referenced this issue Oct 16, 2024
@jh-RLI
Copy link
Contributor Author

jh-RLI commented Oct 16, 2024

The restriction of the table name when creating tables on the oep is slightly different. Only alphanumeric characters plus “_” are permitted. But since there is no field to save the schema name, this is fine.
Off-topic: Now that I think about it ... maybe we should introduce a field for the data tpics? At some point in the future we will resolve the physical database schemas that are currently associated with the data themes. Once this is done, it is only important to know whether the data is published or not. Storing the table type tobic as part of the table name would then no longer make sense.

@Ludee
Copy link
Member

Ludee commented Oct 16, 2024

Yes, that is good and sustainable solution. It is somehow duplicate to the subject field.

@jh-RLI
Copy link
Contributor Author

jh-RLI commented Oct 16, 2024

Subject IMO is also or maybe more duplicated with keywords. It is meant for ontological annotation for specific topics like "co2 emission"but more detailed than the data topics on the oep. But keywords are harmonized with OEP Tags ...

jh-RLI added a commit that referenced this issue Oct 22, 2024
jh-RLI added a commit that referenced this issue Oct 22, 2024
jh-RLI added a commit that referenced this issue Oct 22, 2024
jh-RLI added a commit that referenced this issue Oct 22, 2024
jh-RLI added a commit that referenced this issue Oct 22, 2024
Ludee added a commit that referenced this issue Oct 22, 2024
Ludee added a commit that referenced this issue Oct 22, 2024
@jh-RLI jh-RLI reopened this Oct 22, 2024
jh-RLI added a commit that referenced this issue Oct 22, 2024
jh-RLI added a commit that referenced this issue Oct 22, 2024
jh-RLI added a commit that referenced this issue Oct 22, 2024
jh-RLI added a commit that referenced this issue Oct 22, 2024
jh-RLI added a commit that referenced this issue Oct 22, 2024
jh-RLI added a commit that referenced this issue Oct 22, 2024
…ild system prevents correct schema generation #152
@jh-RLI jh-RLI linked a pull request Oct 22, 2024 that will close this issue
5 tasks
jh-RLI added a commit that referenced this issue Oct 22, 2024
jh-RLI added a commit that referenced this issue Oct 22, 2024
jh-RLI added a commit that referenced this issue Oct 22, 2024
jh-RLI added a commit that referenced this issue Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In progress
2 participants