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 Jul 9, 2014
1 parent 9d7d569 commit 3099c22
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 4 deletions.
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"
}
}
}
9 changes: 5 additions & 4 deletions validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ var fs = require('fs');
var path = require('path');
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) {
Expand All @@ -19,7 +18,9 @@ function validate(resumeJson, callback) {
callback(null, err);
})
}

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

0 comments on commit 3099c22

Please sign in to comment.