javascript-solid-server 0.0.146 → 0.0.147
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/webid/profile.js +3 -2
- package/test/webid.test.js +11 -2
package/package.json
CHANGED
package/src/webid/profile.js
CHANGED
|
@@ -24,7 +24,6 @@ const PIM = 'http://www.w3.org/ns/pim/space#';
|
|
|
24
24
|
*/
|
|
25
25
|
export function generateProfileJsonLd({ webId, name, podUri, issuer }) {
|
|
26
26
|
const pod = podUri.endsWith('/') ? podUri : podUri + '/';
|
|
27
|
-
const profileDoc = webId.split('#')[0];
|
|
28
27
|
|
|
29
28
|
return {
|
|
30
29
|
'@context': {
|
|
@@ -39,12 +38,14 @@ export function generateProfileJsonLd({ webId, name, podUri, issuer }) {
|
|
|
39
38
|
'preferencesFile': { '@id': 'pim:preferencesFile', '@type': '@id' },
|
|
40
39
|
'publicTypeIndex': { '@id': 'solid:publicTypeIndex', '@type': '@id' },
|
|
41
40
|
'privateTypeIndex': { '@id': 'solid:privateTypeIndex', '@type': '@id' },
|
|
41
|
+
'isPrimaryTopicOf': { '@id': 'foaf:isPrimaryTopicOf', '@type': '@id' },
|
|
42
42
|
'mainEntityOfPage': { '@id': 'schema:mainEntityOfPage', '@type': '@id' }
|
|
43
43
|
},
|
|
44
44
|
'@id': webId,
|
|
45
45
|
'@type': ['foaf:Person', 'schema:Person'],
|
|
46
46
|
'foaf:name': name,
|
|
47
|
-
'
|
|
47
|
+
'isPrimaryTopicOf': '',
|
|
48
|
+
'mainEntityOfPage': '',
|
|
48
49
|
'inbox': `${pod}inbox/`,
|
|
49
50
|
'storage': pod,
|
|
50
51
|
'oidcIssuer': issuer,
|
package/test/webid.test.js
CHANGED
|
@@ -83,11 +83,20 @@ describe('WebID Profile', () => {
|
|
|
83
83
|
assert.ok(jsonLd['inbox'].endsWith('/webidtest/inbox/'), 'Should have inbox');
|
|
84
84
|
});
|
|
85
85
|
|
|
86
|
-
it('should have mainEntityOfPage', async () => {
|
|
86
|
+
it('should have mainEntityOfPage pointing to the document', async () => {
|
|
87
87
|
const res = await request(profilePath);
|
|
88
88
|
const jsonLd = await res.json();
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
// Empty string is a relative URI reference to the document itself (JSON-LD)
|
|
91
|
+
assert.strictEqual(jsonLd['mainEntityOfPage'], '', 'mainEntityOfPage should be "" (self)');
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it('should have isPrimaryTopicOf pointing to the document', async () => {
|
|
95
|
+
const res = await request(profilePath);
|
|
96
|
+
const jsonLd = await res.json();
|
|
97
|
+
|
|
98
|
+
// Empty string is a relative URI reference to the document itself (JSON-LD)
|
|
99
|
+
assert.strictEqual(jsonLd['isPrimaryTopicOf'], '', 'isPrimaryTopicOf should be "" (self)');
|
|
91
100
|
});
|
|
92
101
|
});
|
|
93
102
|
|