Skip to content

Commit c12c272

Browse files
NamedNode for fragment in profile doc
1 parent 38a84b0 commit c12c272

2 files changed

Lines changed: 17 additions & 25 deletions

File tree

src/trustedApplications/__snapshots__/trustedApplications.test.ts.snap

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ exports[`getStatementsToAdd should return all required statements to add the giv
88
"termType": "NamedNode",
99
"value": "https://profile.example",
1010
},
11-
"object": BlankNode {
12-
"classOrder": 6,
13-
"isBlank": 1,
14-
"isVar": 1,
15-
"termType": "BlankNode",
16-
"value": "bn_mock_app_id",
11+
"object": NamedNode {
12+
"classOrder": 5,
13+
"termType": "NamedNode",
14+
"value": "https://profile.example#mock_app_id",
1715
},
1816
"predicate": NamedNode {
1917
"classOrder": 5,
@@ -42,12 +40,10 @@ exports[`getStatementsToAdd should return all required statements to add the giv
4240
"termType": "NamedNode",
4341
"value": "http://www.w3.org/ns/auth/acl#origin",
4442
},
45-
"subject": BlankNode {
46-
"classOrder": 6,
47-
"isBlank": 1,
48-
"isVar": 1,
49-
"termType": "BlankNode",
50-
"value": "bn_mock_app_id",
43+
"subject": NamedNode {
44+
"classOrder": 5,
45+
"termType": "NamedNode",
46+
"value": "https://profile.example#mock_app_id",
5147
},
5248
},
5349
Statement {
@@ -66,12 +62,10 @@ exports[`getStatementsToAdd should return all required statements to add the giv
6662
"termType": "NamedNode",
6763
"value": "http://www.w3.org/ns/auth/acl#mode",
6864
},
69-
"subject": BlankNode {
70-
"classOrder": 6,
71-
"isBlank": 1,
72-
"isVar": 1,
73-
"termType": "BlankNode",
74-
"value": "bn_mock_app_id",
65+
"subject": NamedNode {
66+
"classOrder": 5,
67+
"termType": "NamedNode",
68+
"value": "https://profile.example#mock_app_id",
7569
},
7670
},
7771
Statement {
@@ -90,12 +84,10 @@ exports[`getStatementsToAdd should return all required statements to add the giv
9084
"termType": "NamedNode",
9185
"value": "http://www.w3.org/ns/auth/acl#mode",
9286
},
93-
"subject": BlankNode {
94-
"classOrder": 6,
95-
"isBlank": 1,
96-
"isVar": 1,
97-
"termType": "BlankNode",
98-
"value": "bn_mock_app_id",
87+
"subject": NamedNode {
88+
"classOrder": 5,
89+
"termType": "NamedNode",
90+
"value": "https://profile.example#mock_app_id",
9991
},
10092
},
10193
]

src/trustedApplications/trustedApplications.utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function getStatementsToAdd (
3636
person: NamedNode,
3737
ns: Namespaces
3838
): any {
39-
const application = new NamedNode(nodeName)
39+
const application = new NamedNode(`${person.doc().uri}#${nodeName}`)
4040
return [
4141
st(person, ns.acl('trustedApp'), application, person.doc()),
4242
st(application, ns.acl('origin'), origin, person.doc()),

0 commit comments

Comments
 (0)