src/engine/property-paths.js
function transformPath (bgp, group, options) {
  let i = 0
  var queryChange = false
  var ret = [bgp, null, []]
  while (i < bgp.length && !queryChange) {
    var curr = bgp[i]
    if (typeof curr.predicate !== 'string' && curr.predicate.type === 'path') {
      switch (curr.predicate.pathType) {
        case '/':
          ret = pathSeq(bgp, curr, i, group, ret[2], options)
          if (ret[1] != null) {
            queryChange = true
          }
          break
        case '^':
          ret = pathInv(bgp, curr, i, group, ret[2], options)
          if (ret[1] != null) {
            queryChange = true
          }
          break
        case '|':
          ret = pathAlt(bgp, curr, i, group, ret[2], options)
          queryChange = true
          break
        case '!':
          ret = pathNeg(bgp, curr, i, group, ret[2], options)
          queryChange = true
          break
        default:
          break
      }
    }
    i++
  }
  return ret
}
function transformPath (bgp, group, options) {
  let i = 0
  var queryChange = false
  var ret = [bgp, null, []]
  while (i < bgp.length && !queryChange) {
    var curr = bgp[i]
    if (typeof curr.predicate !== 'string' && curr.predicate.type === 'path') {
      switch (curr.predicate.pathType) {
        case '/':
          ret = pathSeq(bgp, curr, i, group, ret[2], options)
          if (ret[1] != null) {
            queryChange = true
          }
          break
        case '^':
          ret = pathInv(bgp, curr, i, group, ret[2], options)
          if (ret[1] != null) {
            queryChange = true
          }
          break
        case '|':
          ret = pathAlt(bgp, curr, i, group, ret[2], options)
          queryChange = true
          break
        case '!':
          ret = pathNeg(bgp, curr, i, group, ret[2], options)
          queryChange = true
          break
        default:
          break
      }
    }
    i++
  }
  return ret
}
function transformPath ( bgp , group , options ) { let i = 0 var queryChange = false var ret = [ bgp , null , [ ] ] while ( i < bgp . length && ! queryChange ) { var curr = bgp [ i ] if ( typeof curr . predicate !== 'string' && curr . predicate . type === 'path' ) { switch ( curr . predicate . pathType ) { case '/' : ret = pathSeq ( bgp , curr , i , group , ret [ 2 ] , options ) if ( ret [ 1 ] != null ) { queryChange = true } break case '^' : ret = pathInv ( bgp , curr , i , group , ret [ 2 ] , options ) if ( ret [ 1 ] != null ) { queryChange = true } break case '|' : ret = pathAlt ( bgp , curr , i , group , ret [ 2 ] , options ) queryChange = true break case '!' : ret = pathNeg ( bgp , curr , i , group , ret [ 2 ] , options ) queryChange = true break default : break } } i ++ } return ret }
rewriting rules for property paths
rewriting rules for property paths