public TransformPathFlattern() { this(new PathCompiler()) ; }
public PathBlock reduce(Node start, Path path, Node finish) { PathBlock x = new PathBlock() ; reduce(x, varAlloc, start, path, finish) ; return x ; }
public PathBlock reduce(Node start, Path path, Node finish) { PathBlock x = new PathBlock() ; reduce(x, varAlloc, start, path, finish) ; return x ; }
public TransformPathFlattern() { this(new PathCompiler()) ; }
/** Simplify : turns constructs in simple triples and simpler TriplePaths where possible */ public PathBlock reduce(PathBlock pathBlock) { PathBlock x = new PathBlock() ; // No context during algebra generation time. // VarAlloc varAlloc = VarAlloc.get(context, ARQConstants.sysVarAllocNamed) ; // if ( varAlloc == null ) // // Panic // throw new ARQInternalErrorException("No execution-scope allocator for variables") ; // Translate one into another. reduce(x, pathBlock, varAlloc) ; return x ; }
private PathCompiler pathCompiler = new PathCompiler() ; private int subQueryDepth = 0 ;
/** Simplify : turns constructs in simple triples and simpler TriplePaths where possible */ public PathBlock reduce(PathBlock pathBlock) { PathBlock x = new PathBlock() ; // No context during algebra generation time. // VarAlloc varAlloc = VarAlloc.get(context, ARQConstants.sysVarAllocNamed) ; // if ( varAlloc == null ) // // Panic // throw new ARQInternalErrorException("No execution-scope allocator for variables") ; // Translate one into another. reduce(x, pathBlock, varAlloc) ; return x ; }
@Override public Op transform(OpPath opPath) { // Flatten down to triples where possible. PathBlock pattern = pathCompiler.reduce(opPath.getTriplePath()) ; // Any generated paths of exactly one to triple; convert to Op. return PathLib.pathToTriples(pattern) ; } }
@Override public Op transform(OpPath opPath) { // Flatten down to triples where possible. PathBlock pattern = pathCompiler.reduce(opPath.getTriplePath()) ; // Any generated paths of exactly one to triple; convert to Op. return PathLib.pathToTriples(pattern) ; } }
public PathBlock reduce(TriplePath triplePath) { PathBlock x = new PathBlock() ; reduce(x, varAlloc, triplePath.getSubject(), triplePath.getPath(), triplePath.getObject()) ; return x ; }
public PathBlock reduce(TriplePath triplePath) { PathBlock x = new PathBlock() ; reduce(x, varAlloc, triplePath.getSubject(), triplePath.getPath(), triplePath.getObject()) ; return x ; }
void reduce(PathBlock x, PathBlock pathBlock, VarAlloc varAlloc ) { for ( TriplePath tp : pathBlock ) { if ( tp.isTriple() ) { x.add(tp) ; continue ; } reduce(x, varAlloc, tp.getSubject(), tp.getPath(), tp.getObject()) ; } }
void reduce(PathBlock x, PathBlock pathBlock, VarAlloc varAlloc ) { for ( TriplePath tp : pathBlock ) { if ( tp.isTriple() ) { x.add(tp) ; continue ; } reduce(x, varAlloc, tp.getSubject(), tp.getPath(), tp.getObject()) ; } }
reduce(x, varAlloc, startNode, ps.getLeft(), v) ; reduce(x, varAlloc, v, ps.getRight(), endNode) ; return ; reduce(x, varAlloc, endNode, ((P_Inverse)path).getSubPath(), startNode) ; return ; reduce(x, varAlloc, stepStart, pFixed.getSubPath(), v) ; stepStart = v ; reduce(x, varAlloc, stepStart, pFixed.getSubPath(), endNode) ; return ; reduce(x, varAlloc, stepStart, pMod.getSubPath(), v) ; stepStart = v ; reduce(x, varAlloc, stepStart, pMod.getSubPath(), endNode) ; return ; reduce(x, varAlloc, startNode, p1, v) ; reduce(x, varAlloc, v, p2, endNode) ; reduce(x, varAlloc, v, p2, endNode) ; reduce(x, varAlloc, startNode, p1, v) ;
reduce(x, varAlloc, startNode, ps.getLeft(), v) ; reduce(x, varAlloc, v, ps.getRight(), endNode) ; return ; reduce(x, varAlloc, endNode, ((P_Inverse)path).getSubPath(), startNode) ; return ; reduce(x, varAlloc, stepStart, pFixed.getSubPath(), v) ; stepStart = v ; reduce(x, varAlloc, stepStart, pFixed.getSubPath(), endNode) ; return ; reduce(x, varAlloc, stepStart, pMod.getSubPath(), v) ; stepStart = v ; reduce(x, varAlloc, stepStart, pMod.getSubPath(), endNode) ; return ; reduce(x, varAlloc, startNode, p1, v) ; reduce(x, varAlloc, v, p2, endNode) ; reduce(x, varAlloc, v, p2, endNode) ; reduce(x, varAlloc, startNode, p1, v) ;