Skip to content

Commit 3099c22

Browse files
committed
adding jsonld context, as per jsonresume#42
1 parent 9d7d569 commit 3099c22

File tree

2 files changed

+48
-4
lines changed

2 files changed

+48
-4
lines changed

resume.jsonld

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"@context": {
3+
"schema": "http://schema.org/",
4+
"title": "schema:name",
5+
"firstName": "schema:givenName",
6+
"lastName": "schema:familyName",
7+
"email": {
8+
"@container": "@index",
9+
"@id": "schema:email"
10+
},
11+
"phone": {
12+
"@container": "@index",
13+
"@id": "schema:telephone"
14+
},
15+
"summary": "schema:description",
16+
"website": "schema:url",
17+
"websites": {
18+
"@container": "@index",
19+
"@id": "schema:url"
20+
},
21+
"position": "schema:namedPosition",
22+
"startDate": "schema:startDate",
23+
"endDate": "schema:endDate",
24+
"location": {
25+
"@reverse": "schema:homeLocation"
26+
},
27+
"work": {
28+
"@reverse": "schema:member"
29+
},
30+
"awards": {
31+
"@reverse": "schema:winner"
32+
},
33+
"publications": {
34+
"@reverse": "schema:contributor"
35+
},
36+
"references": {
37+
"@reverse": "schema:reviewedBy"
38+
},
39+
"bio": {
40+
"@reverse": "schema:sameAs"
41+
}
42+
}
43+
}

validator.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ var fs = require('fs');
33
var path = require('path');
44
var resumeJson = require('./resume');
55

6-
76
// TODO - Remove this sync call
87
var schema = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'schema.json'), 'utf8'));
9-
8+
var context = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'resume.jsonld'), 'utf8'));
109

1110

1211
function validate(resumeJson, callback) {
@@ -19,7 +18,9 @@ function validate(resumeJson, callback) {
1918
callback(null, err);
2019
})
2120
}
21+
2222
module.exports = {
2323
validate: validate,
24-
resumeJson: resumeJson
25-
}
24+
resumeJson: resumeJson,
25+
context: context
26+
};

0 commit comments

Comments
 (0)