File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,15 @@ function collect (stream, cb) {
1717 stream . once ( 'end' , cb . bind ( null , null , res ) )
1818}
1919
20+ function namespaceBlankVariables ( triple ) {
21+ Object . keys ( triple ) . forEach ( ( key ) => {
22+ if ( triple [ key ] . startsWith && triple [ key ] . startsWith ( '_:' ) ) {
23+ triple [ key ] = triple [ key ] . replace ( / ^ _ : / , 'hypergraph:' )
24+ }
25+ } )
26+ return triple
27+ }
28+
2029function filterTriple ( triple ) {
2130 const filtered = { }
2231 defs . spo . forEach ( ( key ) => {
@@ -58,7 +67,7 @@ function genKeys (triple) {
5867function generateBatch ( triple , action ) {
5968 if ( ! action ) action = 'put'
6069 var data = ( action === 'put' )
61- ? JSON . stringify ( triple )
70+ ? JSON . stringify ( namespaceBlankVariables ( triple ) )
6271 : null
6372 return genKeys ( triple ) . map ( key => ( {
6473 type : 'put' , // no delete in hyperdb so just puting nulls
You can’t perform that action at this time.
0 commit comments