clnsmth / soso

For creating Science On Schema.Org (SOSO) markup in dataset landing pages to improve data discovery through search engines.
https://soso.readthedocs.io/
MIT License
1 stars 0 forks source link

Implement `@id` support for Dataset type #206

Closed clnsmth closed 3 weeks ago

clnsmth commented 3 weeks ago

Description

The @id property is an important element for datasets as it enables unique identification, referencing, and linking with other datasets. The current implementation lacks support for this functionality.

Proposed Solution

Incorporate support for the @id property within the Dataset type by implementing the following changes:

  1. src/soso/interface.py: Introduce a new get_id method to the existing strategy interface, which all metadata conversion strategies will implement.
  2. src/soso/strategies.py: Within existing conversion strategies, implement the newly added get_id method to fetch the @id value from a metadata record, if possible.
  3. src/soso/main.py: Include a new @id key within the graph dictionary of the main.convert function, to which the value returned by strategy.get_id will be assigned. Additionally, ensure the option to override this value through keyword arguments (kwargs).
  4. tests/test_strategies.py: Implement a test case to verify @id values are of schema:URL type.

Additional Information