Skip to content

Commit

Permalink
fix: Wrap IRIs in <> in Turtle Notification Templete
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
CxRes and csarven authored Nov 11, 2024
1 parent d6a992f commit d86d150
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/rdf-notification-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}" ;`
Expand All @@ -48,7 +48,7 @@ function generateTurtleNotification ({
@prefix xsd: <${CONTEXT_XML_SCHEMA}#> .
<urn:uuid:${uuid.v4()}> a as:${activity} ;
as:object ${object} ;${targetLine}${stateLine}
as:object <${object}> ;${targetLine}${stateLine}
as:published "${date}"^^xsd:dateTime .`.replaceAll('\n', '\r\n')
}

Expand Down

0 comments on commit d86d150

Please sign in to comment.