Skip to content

Commit

Permalink
removed duplicates of similar triples
Browse files Browse the repository at this point in the history
  • Loading branch information
NishC committed Jun 7, 2018
1 parent a2515ff commit c1484a7
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions TripleDataProcessor/src/main/webapp/js/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 191,17 @@ function createGraph(json) {
triple["source"] = sourceIndex;

triple["target"] = UniversalN.findIndex(function(x) { return x.uri === key.object.value });
UniversalL.push(triple);
var exists = UniversalL.filter( link => (link.source == triple["source"] && link.target == triple["target"]));
if(exists.length > 0)
console.log("exists", exists);
if(exists.length > 0){
if(!(exists[0]["predicate"].includes(triple["predicate"]))){
exists[0]["predicate"] = exists[0]["predicate"] "/" triple["predicate"];
}
} else {
UniversalL.push(triple);
}

}
});
});
Expand Down Expand Up @@ -252,7 262,7 @@ function ajaxSuccess(json, type, data) {
if (graphRender) {
remove(ajaxCalls, data);
console.log("POST successful");
document.getElementById("status_text").textContent = "Done.";
document.getElementById("status_text").textContent = "Updating Graph...";
if (type === "reconciler") {
if (json.length < 1) {
console.log("Reconciler: Found Nothing");
Expand Down Expand Up @@ -337,7 347,7 @@ function requery() {
// console.log("RQreps = " RQreps " | MAXRQ = " MAXRQ);
}
} else {
document.getElementById("status_text").textContent = "Updating...";
document.getElementById("status_text").textContent = "Done";
}
}

Expand Down Expand Up @@ -515,7 525,7 @@ function update() {
.style("font-size", "0.7em")
.text(function(d) { return d.id; });

d3.selectAll(".ndtext")
d3.selectAll(".ndtext")
.text(function(d) { return d.id; })
.call(wrap, 200);

Expand Down

0 comments on commit c1484a7

Please sign in to comment.