Skip to content

Commit

Permalink
adding jsonld context, as per jsonresume#42
Browse files Browse the repository at this point in the history
  • Loading branch information
bollwyvl committed Jun 7, 2015
1 parent a6d1ae5 commit 7a2ea26
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
43 changes: 43 additions & 0 deletions resume.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"@context": {
"schema": "http://schema.org/",
"title": "schema:name",
"firstName": "schema:givenName",
"lastName": "schema:familyName",
"email": {
"@container": "@index",
"@id": "schema:email"
},
"phone": {
"@container": "@index",
"@id": "schema:telephone"
},
"summary": "schema:description",
"website": "schema:url",
"websites": {
"@container": "@index",
"@id": "schema:url"
},
"position": "schema:namedPosition",
"startDate": "schema:startDate",
"endDate": "schema:endDate",
"location": {
"@reverse": "schema:homeLocation"
},
"work": {
"@reverse": "schema:member"
},
"awards": {
"@reverse": "schema:winner"
},
"publications": {
"@reverse": "schema:contributor"
},
"references": {
"@reverse": "schema:reviewedBy"
},
"bio": {
"@reverse": "schema:sameAs"
}
}
}
5 changes: 4 additions & 1 deletion validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var resumeJson = require('./resume');

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

function validate(resumeJson, callback) {
ZSchema.validate(resumeJson, schema)
Expand All @@ -16,7 +17,9 @@ function validate(resumeJson, callback) {
callback(null, err);
})
}

module.exports = {
validate: validate,
resumeJson: resumeJson
}
context: context
};

0 comments on commit 7a2ea26

Please sign in to comment.