You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To enable the integration of the Pleiades dataset as LOD, I propose introducing a model-based solution within XRONOS. By implementing a matching method directly within either the Site model or the PleiadesItem model, we can establish an efficient way to link XRONOS site names with Pleiades data.
Proposed Enhancement:
1. Introduce a PleiadesItem Model
Add a model named PleiadesItem to store Pleiades site names and their corresponding IDs. This will provide the necessary structure for matching with the Site model.
Implement a rake task to populate and update the PleiadesItem model with the latest data from the Pleiades name_index.json. This ensures the data remains current.
Example task:
namespace:pleiadesdodesc"Sync Pleiades data with XRONOS"tasksync: :environmentdorequire'open-uri'require'json'url='https://raw.githubusercontent.com/ryanfb/pleiades-geojson/gh-pages/name_index.json'pleiades_data=JSON.parse(URI.open(url).read)pleiades_data.eachdo |name,id|
PleiadesItem.find_or_create_by(name: name.strip.downcase,pleiades_id: id)endendend
3. Match Logic in Model
a) Method in the Site Model
Add a method in the Site model to find a corresponding PleiadesItem for a site by comparing names:
site=Site.find(1)match=site.match_to_pleiadesifmatchputs"Site '#{site.name}' matches PleiadesItem '#{match.name}' with ID #{match.pleiades_id}"elseputs"No match found for site '#{site.name}'"end
b) Method in the PleiadesItem Model
Alternatively, add a method in the PleiadesItem model to find all Site entries matching a specific Pleiades name:
Description:
To enable the integration of the Pleiades dataset as LOD, I propose introducing a model-based solution within XRONOS. By implementing a matching method directly within either the
Site
model or thePleiadesItem
model, we can establish an efficient way to link XRONOS site names with Pleiades data.Proposed Enhancement:
1. Introduce a
PleiadesItem
ModelAdd a model named
PleiadesItem
to store Pleiades site names and their corresponding IDs. This will provide the necessary structure for matching with theSite
model.Example model schema:
2. Periodic Synchronization of Pleiades Data
Implement a rake task to populate and update the PleiadesItem model with the latest data from the Pleiades name_index.json. This ensures the data remains current.
Example task:
3. Match Logic in Model
a) Method in the Site Model
Add a method in the Site model to find a corresponding PleiadesItem for a site by comparing names:
Example:
Usage:
b) Method in the PleiadesItem Model
Alternatively, add a method in the PleiadesItem model to find all Site entries matching a specific Pleiades name:
Example:
Usage:
4. Further Task
Benefits:
Potential Issues:
I look forward to feedback on this proposal!
The text was updated successfully, but these errors were encountered: