bbop-graph-noctua
Advanced tools
Comparing version 0.0.10 to 0.0.11
@@ -47,4 +47,4 @@ /** | ||
if( kv_set['key'] && kv_set['value'] ){ | ||
var key = kv_set['key']; | ||
var val = kv_set['value']; | ||
// var key = kv_set['key']; | ||
// var val = kv_set['value']; | ||
// var adj_set = {}; | ||
@@ -992,2 +992,3 @@ // adj_set[key] = val; | ||
// Function to check if two annotations are the same. | ||
function _is_same_ann(a1, a2){ | ||
@@ -1101,4 +1102,3 @@ var ret = false; | ||
// Find the evidence singletons and remove them from the | ||
// graph. | ||
// Find the evidence singletons for future lookup. | ||
var singletons = {}; | ||
@@ -1108,9 +1108,8 @@ each(anchor.get_singleton_nodes(), function(singleton){ | ||
singletons[sid] = singleton; | ||
anchor.remove_node(sid); | ||
}); | ||
//console.log('singletons'); | ||
//console.log(singletons); | ||
console.log('singletons'); | ||
console.log(us.keys(singletons).length); | ||
// Add the evidence singletons back into the structure by | ||
// Add the evidence singletons into the structure by | ||
// scanning through the nodes and adding them as referenced | ||
@@ -1125,10 +1124,16 @@ // individuals. | ||
if( ann.key() == 'evidence' && ann.value_type() == 'IRI' ){ | ||
// If so, add it in. | ||
// If so, and the individual in question is a | ||
// singleton (if not, we don't fold it). | ||
var ev_ref = ann.value(); | ||
if( singletons[ev_ref] ){ | ||
// Remove | ||
anchor.remove_node(ev_ref); | ||
// Add as referenced individual. | ||
var ev_indiv = singletons[ev_ref]; | ||
var c1 = node.add_referenced_individual(ev_indiv); | ||
// console.log('<<' + node.id() + '>1>', c1.length); | ||
var c2 = node.referenced_individuals(); | ||
// console.log('<<' + node.id() + '>2>', c2.length); | ||
//console.log('<<' + node.id() + '>1>', c1.length); | ||
//var c2 = node.referenced_individuals(); | ||
//console.log('<<' + node.id() + '>2>', c2.length); | ||
// console.log(node) | ||
@@ -1150,2 +1155,6 @@ } | ||
if( singletons[ev_ref] ){ | ||
// Remove | ||
anchor.remove_node(ev_ref); | ||
// Add as referenced individual. | ||
var ev_indiv = singletons[ev_ref]; | ||
@@ -1643,3 +1652,3 @@ edge.add_referenced_individual(ev_indiv); | ||
constructr.prototype.get_referenced_individuals_by_filter = | ||
_get_annotations_by_filter; | ||
_get_referenced_individuals_by_filter; | ||
constructr.prototype.get_referenced_individual_by_id = | ||
@@ -1646,0 +1655,0 @@ _get_referenced_individual_by_id; |
{ | ||
"name": "bbop-graph-noctua", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"license": "BSD-3-Clause", | ||
@@ -5,0 +5,0 @@ "description": "A subclass of bbop-graph that layers on a complete annotation and graph editing model for the Noctua set of tools.", |
6328125
26959