Package com.hp.hpl.jena.sparql.core

Examples of com.hp.hpl.jena.sparql.core.BasicPattern


            // substituted as part of evaluation.
           
            if ( ! peek.hasNext() )
                throw new ARQInternalErrorException("Peek iterator is already empty") ;
            BasicPattern pattern2 = Substitute.substitute(pattern, peek.peek() ) ;
            // Calculate the reordering based on the substituted pattern.
            ReorderProc proc = transform.reorderIndexes(pattern2) ;
            // Then reorder original patten
            pattern = proc.reorder(pattern) ;
        }
View Full Code Here


        {
            Graph g = execCxt.getActiveGraph() ;
           
            if ( g instanceof GraphTDB )
            {
                BasicPattern bgp = opBGP.getPattern() ;
                Explain.explain("Execute", bgp, execCxt.getContext()) ;
                // Triple-backed (but may be named as explicit default graph).
                return SolverLib.execute((GraphTDB)g, bgp, input, filter, execCxt) ;
            }
            Log.warn(this, "Non-GraphTDB passed to OpExecutorPlainTDB") ;
View Full Code Here

           
            if ( execCxt.getDataset() instanceof DatasetGraphTDB )
            {
                DatasetGraphTDB ds = (DatasetGraphTDB)execCxt.getDataset() ;
                Explain.explain("Execute", opQuadPattern.getPattern(), execCxt.getContext()) ;
                BasicPattern bgp = opQuadPattern.getBasicPattern() ;
                return SolverLib.execute(ds, gn, bgp, input, filter, execCxt) ;
            }
            // Maybe a TDB named graph inside a non-TDB dataset.
            Graph g = execCxt.getActiveGraph() ;
            if ( g instanceof GraphTDB )
            {
                if ( g instanceof GraphTriplesTDB )
                {
                    // Triples graph from TDB (which is the default graph of the dataset),
                    // used a named graph in a composite dataset.
                    BasicPattern bgp = opQuadPattern.getBasicPattern() ;
                    Explain.explain("Execute", bgp, execCxt.getContext()) ;
                    return SolverLib.execute((GraphTDB)g, bgp, input, filter, execCxt) ;
                }
               
                if ( g instanceof GraphNamedTDB )
View Full Code Here

 
  static boolean rowContained(RowMatch rMatch, Row row) {
     
    boolean contained = equalNode(rMatch.getSubject(), row.getRowKey());
    if(contained){
      BasicPattern pattern =rMatch.getBasicPattern();
      for(Triple triple: pattern ){
        contained = equalNode(triple.getObject(), row.getValue( triple.getPredicate()) );
        if (! contained){
          break;
        }
View Full Code Here

            super(cxt) ;
            GraphPropertyTable graph = (GraphPropertyTable)cxt.getActiveGraph() ;
           
            this.pattern = substitute(pattern, binding);
            this.binding = binding ;
            BasicPattern pattern2 = tripleNode(pattern);
           
            ExtendedIterator<Row> iter = graph.propertyTableBaseFind( new RowMatch( pattern2) );
           
            if ( false )
            {
View Full Code Here

    HashMap<Node, BasicPattern> map = new HashMap<Node, BasicPattern>();
    for (Triple triple : pattern.getList()) {
      Node subject = triple.getSubject();
      if (!map.containsKey(subject)) {
        List<Triple> triples = new ArrayList<Triple>();
        BasicPattern p = BasicPattern.wrap(triples);
        map.put(subject, p);
        p.add(triple);
      } else {
        map.get(subject).add(triple);
      }
    }
    return map.values();
View Full Code Here

        return OpFilter.filter(exprList2, subOp) ;
    }       
   
    @Override public Op transform(OpBGP opBGP)
    {
        BasicPattern bgp2 = NodeTransformLib.transform(transform, opBGP.getPattern()) ;
        if ( bgp2 == opBGP.getPattern())
            return super.transform(opBGP) ;
        return new OpBGP(bgp2) ;
    }
View Full Code Here

    }
   
    @Override public Op transform(OpQuadPattern opQuadPattern)
    {
        // The internal representation is (graph, BGP)
        BasicPattern bgp2 = NodeTransformLib.transform(transform, opQuadPattern.getBasicPattern()) ;
        Node g2 = opQuadPattern.getGraphNode() ;
        g2 = transform.convert(g2) ;
       
        if ( g2 == opQuadPattern.getGraphNode() && bgp2 == opQuadPattern.getBasicPattern() )
            return super.transform(opQuadPattern) ;
View Full Code Here

        {
            // One expansion for each triple pattern.
            Op union = null ;
            for ( Node n : graphs )
            {
                BasicPattern bp = new BasicPattern() ;
                bp.add(t) ;
                Op pattern = new OpQuadPattern(n, bp) ;
                union = OpUnion.create(union, pattern) ;
            }
            opSeq.add(union) ;
        }
View Full Code Here

       
        private static boolean oneLine(Op op)
        {
            if ( OpBGP.isBGP(op) )
            {
                BasicPattern bgp = ((OpBGP)op).getPattern() ;
                if ( bgp.getList().size() <= 1 )
                    return true ;
            }
            return false ;
        }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sparql.core.BasicPattern

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.