mirror of
https://github.com/dathere/ckan_geoconnex_bulk_runner.git
synced 2026-07-05 23:22:20 +00:00
feat: multi-CKAN-instance compatibility
This commit is contained in:
parent
59564c9de3
commit
7c8fac233e
6 changed files with 55 additions and 33 deletions
|
|
@ -3,6 +3,8 @@ use serde_json::json;
|
|||
|
||||
pub fn construct_dataset_jsonld_from_metadata(
|
||||
dataset_metadata: serde_json::Value,
|
||||
instance_url: String,
|
||||
namespace: String,
|
||||
) -> Result<serde_json::Value> {
|
||||
let dataset_id = dataset_metadata.get("id").unwrap().as_str().unwrap();
|
||||
eprintln!("Attempting to construct JSON-LD for dataset {dataset_id}");
|
||||
|
|
@ -60,14 +62,14 @@ pub fn construct_dataset_jsonld_from_metadata(
|
|||
},
|
||||
"@type": "Dataset",
|
||||
// TODO: Customize namespace based on CKAN instance being used
|
||||
"@id": format!("https://geoconnex.us/ckan/nmwdh/{dataset_id}"),
|
||||
"@id": format!("https://geoconnex.us/ckan/{namespace}/{dataset_id}"),
|
||||
"name": dataset_title,
|
||||
"provider": {
|
||||
"@type": "Organization",
|
||||
"name": organization_name
|
||||
},
|
||||
// TODO: Customize CKAN instance URL based on CKAN instance being used
|
||||
"url": format!("https://catalog.newmexicowaterdata.org/dataset/{dataset_id}")
|
||||
"url": format!("{instance_url}/dataset/{dataset_id}")
|
||||
});
|
||||
let jsonld_map = jsonld.as_object_mut().unwrap();
|
||||
if about.len() > 0 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue