src/test/resources/shexTest/bin/genJSON.js
/** expandCollection - N3.js utility to return an rdf collection's elements.
*/
N3.js utility to return an rdf collection's elements.
N3 . js utility to return an rdf collection ' s elements .
function expandCollection (h) {
  if (store.find(h.object, "rdf:first", null).length) {
    var ret = [];
    while (h.object !== "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil") {
      ret.push(store.find(h.object, "rdf:first", null)[0].object);
      h = store.find(h.object, "rdf:rest", null)[0];
    }
    return ret;
  } else {
    return h.object
  }
}
function expandCollection ( h ) { if ( store . find ( h . object , "rdf:first" , null ) . length ) { var ret = [ ] ; while ( h . object !== "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil" ) { ret . push ( store . find ( h . object , "rdf:first" , null ) [ 0 ] . object ) ; h = store . find ( h . object , "rdf:rest" , null ) [ 0 ] ; } return ret ; } else { return h . object } }
expandCollection - N3.js utility to return an rdf collection's elements.
expandCollection - N3 . js utility to return an rdf collection ' s elements .