Skip to content

Commit d86d150

Browse files
CxRescsarven
andauthored
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 <[email protected]>
1 parent d6a992f commit d86d150

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/rdf-notification-template.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ function generateTurtleNotification ({
3434
let stateLine = ''
3535

3636
if (activity === 'Add') {
37-
targetLine = `\n as:target ${target} ;`
37+
targetLine = `\n as:target <${target}> ;`
3838
}
3939
if (activity === 'Remove') {
40-
targetLine = `\n as:origin ${target} ;`
40+
targetLine = `\n as:origin <${target}> ;`
4141
}
4242
if (eventID) {
4343
stateLine = `\n notify:state "${eventID}" ;`
@@ -48,7 +48,7 @@ function generateTurtleNotification ({
4848
@prefix xsd: <${CONTEXT_XML_SCHEMA}#> .
4949
5050
<urn:uuid:${uuid.v4()}> a as:${activity} ;
51-
as:object ${object} ;${targetLine}${stateLine}
51+
as:object <${object}> ;${targetLine}${stateLine}
5252
as:published "${date}"^^xsd:dateTime .`.replaceAll('\n', '\r\n')
5353
}
5454

0 commit comments

Comments
 (0)