contactsPane.js
function deleteThing (x) {
        console.log('deleteThing: ' + x)
        var ds = kb.statementsMatching(x).concat(kb.statementsMatching(undefined, undefined, x))
        var targets = {}
        ds.map(function (st) { targets[st.why.uri] = st })
        var agenda = [] // sets of statements of same dcoument to delete
        for (var target in targets) {
          agenda.push(ds.filter(function (st) { return st.why.uri === target }))
          console.log('   Deleting ' + agenda[agenda.length - 1].length + ' triples from ' + target)
        }
        function nextOne () {
          if (agenda.length > 0) {
            updater.update(agenda.shift(), [], function (uri, ok, body) {
              if (!ok) {
                complain('Error deleting all trace of: ' + x + ': ' + body)
                return
              }
              nextOne()
            })
          } else {
            console.log('Deleting resoure ' + x.doc())
            kb.fetcher.delete(x.doc())
              .then(function () {
                console.log('Delete thing ' + x + ': complete.')
              })
              .catch(function (e) {
                complain('Error deleting thing ' + x + ': ' + e)
              })
          }
        }
        nextOne()
      }
function deleteThing (x) {
        console.log('deleteThing: ' + x)
        var ds = kb.statementsMatching(x).concat(kb.statementsMatching(undefined, undefined, x))
        var targets = {}
        ds.map(function (st) { targets[st.why.uri] = st })
        var agenda = [] // sets of statements of same dcoument to delete
        for (var target in targets) {
          agenda.push(ds.filter(function (st) { return st.why.uri === target }))
          console.log('   Deleting ' + agenda[agenda.length - 1].length + ' triples from ' + target)
        }
        function nextOne () {
          if (agenda.length > 0) {
            updater.update(agenda.shift(), [], function (uri, ok, body) {
              if (!ok) {
                complain('Error deleting all trace of: ' + x + ': ' + body)
                return
              }
              nextOne()
            })
          } else {
            console.log('Deleting resoure ' + x.doc())
            kb.fetcher.delete(x.doc())
              .then(function () {
                console.log('Delete thing ' + x + ': complete.')
              })
              .catch(function (e) {
                complain('Error deleting thing ' + x + ': ' + e)
              })
          }
        }
        nextOne()
      }
function deleteThing ( x ) { console . log ( 'deleteThing: ' + x ) var ds = kb . statementsMatching ( x ) . concat ( kb . statementsMatching ( undefined , undefined , x ) ) var targets = { } ds . map ( function ( st ) { targets [ st . why . uri ] = st } ) var agenda = [ ] // sets of statements of same dcoument to delete for ( var target in targets ) { agenda . push ( ds . filter ( function ( st ) { return st . why . uri === target } ) ) console . log ( '   Deleting ' + agenda [ agenda . length - 1 ] . length + ' triples from ' + target ) } function nextOne ( ) { if ( agenda . length > 0 ) { updater . update ( agenda . shift ( ) , [ ] , function ( uri , ok , body ) { if ( ! ok ) { complain ( 'Error deleting all trace of: ' + x + ': ' + body ) return } nextOne ( ) } ) } else { console . log ( 'Deleting resoure ' + x . doc ( ) ) kb . fetcher . delete ( x . doc ( ) ) . then ( function ( ) { console . log ( 'Delete thing ' + x + ': complete.' ) } ) . catch ( function ( e ) { complain ( 'Error deleting thing ' + x + ': ' + e ) } ) } } nextOne ( ) }
In a LDP work, deletes the whole document describing a thing plus patch out ALL mentiosn of it!    Use with care! beware of other dta picked up from other places being smushed together and then deleted.
In a LDP work deletes the whole document describing a thing plus patch out ALL mentiosn of it! Use with care! beware of other dta picked up from other places being smushed together and then deleted .