ternaustralia / linkeddata-api

TERN's Linked Data Services API
https://linkeddata.tern.org.au/api
0 stars 1 forks source link

Modularise method profile for resource endpoint #39

Closed edmondchuc closed 1 year ago

edmondchuc commented 2 years ago

Currently the method's profile is in a profiles module with its implementation in its own function.

https://github.com/ternaustralia/linkeddata-api/blob/cbea718713a3c9c02dbe2749b8f489f7f074ca31/src/linkeddata_api/domain/viewer/resource/json/profiles.py#L26-L51

This function is then used in the domain function for describing resources in our JSON format.

https://github.com/ternaustralia/linkeddata-api/blob/cbea718713a3c9c02dbe2749b8f489f7f074ca31/src/linkeddata_api/domain/viewer/resource/json/__init__.py#L119-L144

Refactor the code in a way so that when we add new profiles in the future, we don't have to change or update the code in the resource json package and instead have it do a plugins-like look up to use the correct profile handler by a key (URI of profile/type).

edmondchuc commented 1 year ago

Fixed in https://github.com/ternaustralia/linkeddata-api/pull/49