From 7263fc42afb3a4463da42b4363a3b6b9b54ec86f Mon Sep 17 00:00:00 2001 From: enridaga Date: Wed, 13 Jan 2016 10:00:35 +0000 Subject: [PATCH] Datasets: use UUIDs for linked data URIs --- mks-data-cataloguing/inc/linked-data.inc | 4 ++-- mks-data-cataloguing/inc/rdf-catalogue-notifier.inc | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mks-data-cataloguing/inc/linked-data.inc b/mks-data-cataloguing/inc/linked-data.inc index 5227cf1..7e7d8f8 100644 --- a/mks-data-cataloguing/inc/linked-data.inc +++ b/mks-data-cataloguing/inc/linked-data.inc @@ -111,11 +111,11 @@ END; if(!is_array($ds)){ $ds = $db->getDataset($ds); } - + $d = new stdClass(); $dp = $ds['post']; $d->{"@type"} = "dcat:Dataset"; - $d->{"@id"} = "dataset:" . $dp->post_name; + $d->{"@id"} = "dataset:" . @$ds['uuid'][0]; $d->{"title"} = $dp->post_title; $d->{"description"} = get_the_excerpt(); $d->{"landingPage"} = get_permalink($dp->ID); diff --git a/mks-data-cataloguing/inc/rdf-catalogue-notifier.inc b/mks-data-cataloguing/inc/rdf-catalogue-notifier.inc index b42f4d9..bcc9013 100644 --- a/mks-data-cataloguing/inc/rdf-catalogue-notifier.inc +++ b/mks-data-cataloguing/inc/rdf-catalogue-notifier.inc @@ -6,7 +6,8 @@ function mksdc_notify_rdf_catalogue($post_id, $type, $action){ $p = get_post($post_id); if($type == 'mksdc-datasets'){ $jsonld = MKSDC_JSONLD::dataset($p->post_name); - $graph = MKSDC_Plugin::getLinkedDataURI('dataset/' . $p->post_name); + $uuid = $jsonld->{"@id"}; + $graph = MKSDC_Plugin::getLinkedDataURI('dataset/' . $uuid); }else if($type == 'mksdc-policies'){ $jsonld = MKSDC_JSONLD::policy($p->post_name); $p = get_post($post_id);