Skip to content

Commit

Permalink
Fixed bug affecting import when nodes with bindings are being looked-…
Browse files Browse the repository at this point in the history
…up. SPARQLgraph was saving json incorrectly. Mapping tab did not show lookup properly.
  • Loading branch information
Paul Cuddihy committed Dec 8, 2020
1 parent 82abd2f commit e775948
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions sparqlGraphWeb/sparqlGraph/js/importmapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ define([ // properly require.config'ed
getUriLookupIDs : function () {
var ret = [];
for (var i=0; i < this.uriLookupNodes.length; i++) {
ret.push(this.uriLookupNodes[i].getBindingOrSparqlID());
ret.push(this.uriLookupNodes[i].getSparqlID());
}
return ret;
},
Expand Down Expand Up @@ -201,7 +201,18 @@ define([ // properly require.config'ed
return ImportMapping.staticGenUniqueKey(this.getNodeSparqlId(), this.getPropUri());
},

// return ?SparqlID of node or keyname of propItem
// get the name that would match a URI LOOKUP
// e.g. nodes are looked up by sparqlID
getUriLookupName : function () {
if (this.isNode()) {
return this.node.getSparqlID();
} else {
return this.propItem.getKeyName();
}
},

// get the display name
// e.g. bindings are displayed where available
getName : function () {
if (this.isNode()) {
return this.node.getBindingOrSparqlID();
Expand Down
2 changes: 1 addition & 1 deletion sparqlGraphWeb/sparqlGraph/js/importspec.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ define([// properly require.config'ed

// get any mappings that have uriLookups containing this mapping
getLookupMappings : function(mapping) {
var mapName = mapping.getName();
var mapName = mapping.getUriLookupName();
var ret = [];
for (var i=0; i < this.mapList.length; i++) {
if (this.mapList[i].getUriLookupIDs().indexOf(mapName) > -1) {
Expand Down

0 comments on commit e775948

Please sign in to comment.