Comparing version 1.0.5 to 1.1.0
@@ -854,2 +854,18 @@ 'use strict'; | ||
// returns hash of namespaces mapped to corresponding node entities | ||
$namespaces: { | ||
value: function value() { | ||
// prep return hash | ||
var h_ns_map = {}; | ||
// each prefix in context | ||
for (var s_prefix in h_prefixes) { | ||
h_ns_map[s_prefix] = network_node(h_node, h_prefixes[s_prefix]); | ||
} | ||
// return ns map | ||
return h_ns_map; | ||
} | ||
}, | ||
// generate n3 representation of this node as string | ||
@@ -856,0 +872,0 @@ $n3: { |
{ | ||
"name": "graphy", | ||
"version": "1.0.5", | ||
"version": "1.1.0", | ||
"description": "Query linked-data graphs by abstracting away traditional JSON-LD interaction", | ||
@@ -20,10 +20,10 @@ "author": { | ||
"devDependencies": { | ||
"babel-core": "^6.4.5", | ||
"babel-node-debug": "^1.3.0", | ||
"babel-core": "^6.5.1", | ||
"babel-node-debug": "^2.0.0", | ||
"babel-plugin-array-includes": "^2.0.3", | ||
"babel-plugin-transform-runtime": "^6.4.3", | ||
"babel-preset-es2015": "^6.3.13", | ||
"babel-plugin-transform-runtime": "^6.5.0", | ||
"babel-preset-es2015": "^6.5.0", | ||
"del": "^2.2.0", | ||
"gulp": "^3.9.0", | ||
"gulp-babel": "^6.1.1", | ||
"gulp": "^3.9.1", | ||
"gulp-babel": "^6.1.2", | ||
"gulp-coveralls": "^0.1.4", | ||
@@ -35,3 +35,3 @@ "gulp-eslint": "^1.1.1", | ||
"gulp-nsp": "^2.3.0", | ||
"gulp-plumber": "^1.0.1", | ||
"gulp-plumber": "^1.1.0", | ||
"isparta": "^4.0.0" | ||
@@ -45,3 +45,3 @@ }, | ||
"arginfo": "^1.1.2", | ||
"classer": "^0.1.5", | ||
"classer": "^0.3.0", | ||
"jsonld": "^0.4.5", | ||
@@ -48,0 +48,0 @@ "rmprop": "^1.1.1", |
@@ -1,3 +0,3 @@ | ||
# graphy [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url] | ||
> Query linked-data graphs by abstracting away traditional JSON-LD interaction | ||
# graphy [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] | ||
> Abstracts JSON-LD objects with an API for easy traversal and exploration of an RDF graph programatically. It emphasizes the use of iterators and namespaces to access entities by their suffix. | ||
@@ -326,2 +326,16 @@ | ||
<a name="e.$namespaces" /> | ||
### entity.$namespaces() | ||
Returns a hash whose values are entities of this node under different namespace accessors; one for each IRI prefix in the JSON-LD document's context (which is the key of each key-value pair). | ||
```js | ||
// destructuring assignment | ||
let {rdfs, owl, other} = banana.$namespaces(); | ||
rdfs.label; // 'Banana' | ||
other.ns.tastes(); // 'good' | ||
``` | ||
### entity.$() | ||
This no-args version of the namespace method will instead return the full IRI of the current accessor namespace. | ||
<a name="e.$n3" /> | ||
@@ -407,3 +421,2 @@ ### entity.$n3() | ||
[daviddm-url]: https://david-dm.org/blake-regalia/graphy.js | ||
[coveralls-image]: https://coveralls.io/repos/blake-regalia/graphy.js/badge.svg | ||
[coveralls-url]: https://coveralls.io/r/blake-regalia/graphy.js | ||
49887
958
421
+ Addedansi-regex@2.1.1(transitive)
+ Addedclasser@0.3.2(transitive)
+ Addedcli-color@1.4.0(transitive)
+ Addedd@1.0.2(transitive)
+ Addedes5-ext@0.10.64(transitive)
+ Addedes6-iterator@2.0.3(transitive)
+ Addedes6-symbol@3.1.4(transitive)
+ Addedes6-weak-map@2.0.3(transitive)
+ Addedesniff@2.0.1(transitive)
+ Addedevent-emitter@0.3.5(transitive)
+ Addedext@1.7.0(transitive)
+ Addedis-promise@2.2.2(transitive)
+ Addedlru-queue@0.1.0(transitive)
+ Addedmemoizee@0.4.17(transitive)
+ Addednext-tick@1.1.0(transitive)
+ Addedtimers-ext@0.1.8(transitive)
+ Addedtype@2.7.3(transitive)
- Removedclasser@0.1.5(transitive)
Updatedclasser@^0.3.0