bbop-graph-noctua
Advanced tools
Comparing version 0.0.26 to 0.0.27
@@ -904,2 +904,3 @@ /** | ||
var pid = fact['property']; | ||
var plbl = fact['property-label']; | ||
var anns = fact['annotations'] || []; | ||
@@ -918,2 +919,6 @@ if( sid && oid && pid ){ | ||
} | ||
// Add edge if possible. | ||
if( plbl ){ | ||
new_edge.label(plbl); | ||
} | ||
@@ -2202,2 +2207,3 @@ // Add and ready to return edge. | ||
this._id = bbop.uuid(); | ||
this._predicate_label = null; | ||
@@ -2224,2 +2230,3 @@ this._annotations = []; | ||
new_clone._id = anchor._id; | ||
new_clone._predicate_label = anchor._predicate_label; | ||
@@ -2243,3 +2250,3 @@ // Base class stuff. | ||
/** | ||
* Access to the "id". | ||
* Access to the immutable "id". | ||
* | ||
@@ -2288,2 +2295,16 @@ * @returns {String} string | ||
/** | ||
* Access to the mutable "label" for the edge. | ||
* | ||
* @param {String} [value] - lbl | ||
* @returns {String|null} string | ||
*/ | ||
noctua_edge.prototype.label = function(lbl){ | ||
if( lbl === null || typeof(lbl) === 'string' ){ | ||
this._predicate_label = lbl; | ||
} | ||
return this._predicate_label; | ||
}; | ||
// Add generic bulk annotation operations to: graph, edge, and node. | ||
@@ -2290,0 +2311,0 @@ each([noctua_graph, noctua_node, noctua_edge], function(constructr){ |
{ | ||
"name": "bbop-graph-noctua", | ||
"version": "0.0.26", | ||
"version": "0.0.27", | ||
"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.", |
@@ -866,2 +866,19 @@ //// | ||
describe("try looking at edge labels in minerva wire protocol", function(){ | ||
it('edge labels during creation', function(){ | ||
var raw_resp = require('./minerva-07.json'); | ||
var g = new model.graph(); | ||
g.load_data_basic(raw_resp['data']); | ||
//g.report_state(); console.log(''); | ||
// Make sure we're starting at a sane point... | ||
var an_edge = g.all_edges()[0]; | ||
assert.isNotNull(an_edge.label(), "label is there"); | ||
assert.notEqual(an_edge.id(), an_edge.label(), "label != id"); | ||
}); | ||
}); | ||
// var assert = require('chai').assert; | ||
@@ -868,0 +885,0 @@ // var model = new require('..'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6558355
22
33480