Skip to content

Commit

Permalink
Fixed bug allowing spaces resulting in entity QNAMES
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom De Nies committed Aug 28, 2014
1 parent e7209bf commit 52c7a93
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/git2provConverter.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function getCommitObj(line) {
var commitObj = {};
var data = line.split(",");

commitObj.entity = "file-" + data[0];
commitObj.entity = "file-" + data[0].replace(/ /g, "-");
commitObj.id = "commit-" + data[1];
commitObj.parents = data[2] ? data[2].split(" ") : [];
commitObj.author = "user-" + data[3].replace(/ /g, "-");
Expand Down Expand Up @@ -196,8 +196,9 @@ function getLogCmds(provObject, fileList, urlprefix, options) {
var parentHash = options.shortHashes ? "%p" : "%P";

//console.log('Processing ' + file);
// Because all identifiers need to be QNames in PROV, and we need valid turtle as well, we need to get rid of the slashes and dots
var currentEntity = file.replace(/[\/.]/g, "-");
// Because all identifiers need to be QNames in PROV, and we need valid turtle as well, we need to get rid of the slashes, spaces and dots
var currentEntity = file.replace(/[\/. ]/g, "-");
console.log(currentEntity);
provObject.entities[urlprefix + ":file-" + currentEntity] = {"prov:label": file};
// Next, do a git log for each file to find out about all commits, authors, the commit parents, and the modification type
// This will output the following: Commit hash, Parent hash(es), Author name, Author date, Committer name, Committer date, Subject, name-status
Expand Down

0 comments on commit 52c7a93

Please sign in to comment.