From d86d15034e30138631f8bb5b6a6e017b5e4c79f2 Mon Sep 17 00:00:00 2001 From: Rahul Gupta Date: Tue, 12 Nov 2024 02:26:44 +0530 Subject: [PATCH] fix: Wrap IRIs in <> in Turtle Notification Templete Values for `as:object`, `as:target` and `as:origin` predicates in the Turtle PREP-Notification template are IRI's, so they must be wrapped in angle brackets. Co-authored-by: Sarven Capadisli --- lib/rdf-notification-template.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/rdf-notification-template.js b/lib/rdf-notification-template.js index 8ad94cca..77fb4332 100644 --- a/lib/rdf-notification-template.js +++ b/lib/rdf-notification-template.js @@ -34,10 +34,10 @@ function generateTurtleNotification ({ let stateLine = '' if (activity === 'Add') { - targetLine = `\n as:target ${target} ;` + targetLine = `\n as:target <${target}> ;` } if (activity === 'Remove') { - targetLine = `\n as:origin ${target} ;` + targetLine = `\n as:origin <${target}> ;` } if (eventID) { stateLine = `\n notify:state "${eventID}" ;` @@ -48,7 +48,7 @@ function generateTurtleNotification ({ @prefix xsd: <${CONTEXT_XML_SCHEMA}#> . a as:${activity} ; - as:object ${object} ;${targetLine}${stateLine} + as:object <${object}> ;${targetLine}${stateLine} as:published "${date}"^^xsd:dateTime .`.replaceAll('\n', '\r\n') }