jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [36/51] [partial] jena git commit: Rename com.hp.hpl.jena.* as org.apache.jena.*
Date Thu, 23 Apr 2015 19:56:52 GMT
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/Var.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/Var.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/Var.java
deleted file mode 100644
index b0b3640..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/Var.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.sparql.core ;
-
-import java.util.ArrayList ;
-import java.util.Collection ;
-import java.util.List ;
-
-import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.graph.Node_Variable ;
-import com.hp.hpl.jena.sparql.ARQConstants ;
-import com.hp.hpl.jena.sparql.ARQInternalErrorException ;
-import com.hp.hpl.jena.sparql.engine.binding.Binding ;
-import com.hp.hpl.jena.sparql.expr.ExprVar ;
-
-/** A SPARQL variable */
-
-public class Var extends Node_Variable
-{
-    /* Variable used to indicate "don't bind"
-     * Each use is unique.
-     */
-    
-    // Legal SPARQL variable name but note it must be exactly this
-    // object, not just the same name, to be anonymous.
-    public static Var ANON = new Var("?_") ; 
-    
-    public static Var alloc(String varName)
-    {
-//        if ( varName.equals("_") )
-//            return ANON ;
-        return new Var(varName) ;
-    }
-    
-    public static Var alloc(Node_Variable v)    // asVar?
-    { 
-        if ( v instanceof Var )
-            return (Var)v ;
-        return new Var(v) ;
-    }
-    
-    public static Var alloc(Node v)
-    { 
-        if ( v instanceof Var )
-            return (Var)v ;
-        if ( v instanceof Node_Variable )
-            return new Var((Node_Variable)v) ;
-        throw new NotAVariableException("Node: "+v) ;
-    }
-    
-    public static Var alloc(Var v)
-    {
-        return v ;
-    }
-    
-    public static Var alloc(ExprVar nv)         { return new Var(nv) ; }
-    
-    public static Node lookup(Binding binding, Node node)
-    {
-        if ( ! Var.isVar(node) )
-            return node ;
-        Var var = Var.alloc(node) ;
-        return lookup(binding, var) ;
-    }
-    
-    public static Node lookup(Binding binding, Var var)
-    {
-        Node n = binding.get(var) ;
-        if ( n != null )
-            return n ;
-        return var ;
-    }
-    
-    // Precalulated the hash code because hashCode() is used so heavily with Var's
-    private final int hashCodeValue ;  
-    
-    private Var(String varName)      { super(varName) ; hashCodeValue = super.hashCode() ; }
-    
-    private Var(Node_Variable v)     { this( v.getName() ) ; }
-    
-    private Var(ExprVar v)           { this(v.getVarName()) ; }
-    
-    // Not needed
-    public Node asNode() { return this ; }
-    
-    public String getVarName() { return getName() ; }
-    
-    static class NotAVariableException extends ARQInternalErrorException
-    {
-        NotAVariableException(String msg) { super(msg) ; }
-    }
-    
-    @Override
-    public final int hashCode() { return hashCodeValue ; }
-
-    @Override
-    public final boolean equals(Object other)
-    { 
-        if ( this == other ) return true ;
-        if ( ! ( other instanceof Var ) ) return false ;
-        return super.equals(other) ;
-    }
-    
-//    @Override
-//    public String toString() { return node.toString() ; }
-
-    public boolean isNamedVar() { return isNamedVarName(getName()) ; }
-    
-    public boolean isBlankNodeVar() { return isBlankNodeVarName(getName()) ; }
-    
-    public boolean isAllocVar() { return isAllocVarName(getName()) ; }
-    
-    public boolean isAnonVar() { return isAnonVar(this) ; }
-    
-    // -------
-    
-    public static String canonical(String x)
-    {
-        if ( x.startsWith("?") )
-            return x.substring(1) ;
-        if ( x.startsWith("$") )
-            return x.substring(1) ;
-        return x ;
-    }
-
-    public static boolean isVar(Node node)
-    {
-        if ( node instanceof Var ) return true ;
-        if ( node != null && node.isVariable() )
-            throw new NotAVariableException("Node_variable (not a Var) found") ;
-        return false ;
-    }
-    
-    public static boolean isRenamedVar(Node node)
-    { return node.isVariable() && isRenamedVar(node.getName()) ; }
-    
-    public static boolean isRenamedVar(String x)
-    { return x.startsWith(ARQConstants.allocVarScopeHiding) ; }
-    
-    public static boolean isNamedVar(Node node)
-    { return node.isVariable() && isNamedVarName(node.getName()) ; }
-
-    public static boolean isNamedVarName(String x)
-    { return ! isBlankNodeVarName(x) && ! isAllocVarName(x) ; }
-
-    public static boolean isBlankNodeVar(Node node)
-    { return node.isVariable() && isBlankNodeVarName(node.getName()) ; }
-
-    public static boolean isBlankNodeVarName(String x)
-    { return x.startsWith(ARQConstants.allocVarAnonMarker) ; }
-
-    public static boolean isAllocVar(Node node)
-    { return node.isVariable() && isAllocVarName(node.getName()) ; }
-    
-    public static boolean isAllocVarName(String x)
-    { return x.startsWith(ARQConstants.allocVarMarker) ; }
-    
-    /** Convert a collection of variable names to variables */ 
-    public static List<Var> varList(Collection<String> varNames)
-    {
-        List<Var> x = new ArrayList<>() ;
-        for (String obj : varNames)
-            x.add(Var.alloc(obj)) ;
-        return x ;
-    }
-    
-    public static boolean isAnonVar(Var var)
-    {
-        return var == ANON ;
-    }
-    
-    /** Return a list of String names from a collection of variables */ 
-    public static List<String> varNames(Collection<Var> vars)
-    {
-        List<String> x = new ArrayList<>() ;
-        for (Var var : vars)
-            x.add(var.getVarName()) ;
-        return x ;
-    }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/VarAlloc.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/VarAlloc.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/VarAlloc.java
deleted file mode 100644
index 022a273..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/VarAlloc.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.sparql.core;
-
-import com.hp.hpl.jena.sparql.ARQConstants ;
-import com.hp.hpl.jena.sparql.util.Context ;
-import com.hp.hpl.jena.sparql.util.Symbol ;
-
-/** Allocate variables */
-
-public class VarAlloc
-{
-    private String baseMarker ;
-    private long counter = 0 ;
-
-    // Globals
-    // Try to avoid their use because of clashes/vry large allocated names.
-    //private static VarAlloc varAnonAllocator  = new VarAlloc(ARQConstants.allocGlobalVarAnonMarker) ;
-    //public static VarAlloc getVarAnonAllocator() { return bNodeAllocator ; }
-
-    private static VarAlloc varAllocator    = new VarAlloc(ARQConstants.allocGlobalVarMarker) ;
-    public static VarAlloc getVarAllocator() { return varAllocator ; }
-    
-    public static VarAlloc get(Context context, Symbol name)
-    { 
-        return (VarAlloc)context.get(name) ;
-    }
-    
-    public VarAlloc(String baseMarker)
-    {
-        this.baseMarker = baseMarker ;
-    }
-    
-    
-    
-    public Var allocVar()
-    { return alloc(baseMarker, counter ++) ; }
-    
-    static private Var alloc(String base, long number)
-    { return Var.alloc(base+number) ; }
-    
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/VarExprList.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/VarExprList.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/VarExprList.java
deleted file mode 100644
index c6c9a35..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/VarExprList.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.sparql.core;
-
-import java.util.ArrayList ;
-import java.util.HashMap ;
-import java.util.List ;
-import java.util.Map ;
-
-import org.apache.jena.atlas.lib.Lib ;
-
-import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.sparql.ARQInternalErrorException ;
-import com.hp.hpl.jena.sparql.engine.binding.Binding ;
-import com.hp.hpl.jena.sparql.expr.Expr ;
-import com.hp.hpl.jena.sparql.expr.ExprEvalException ;
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-import com.hp.hpl.jena.sparql.function.FunctionEnv ;
-
-public class VarExprList
-{
-    private List<Var> vars  ;
-    private Map<Var, Expr> exprs  ;
-    
-    public VarExprList(List<Var> vars)
-    {
-        this.vars = vars ;
-        this.exprs = new HashMap<>() ;
-    }
-    
-    public VarExprList(VarExprList other)
-    {
-        this.vars = new ArrayList<>(other.vars) ;
-        this.exprs = new HashMap<>(other.exprs) ;
-    }
-
-    public VarExprList()
-    {
-        this.vars = new ArrayList<>() ;
-        this.exprs = new HashMap<>() ;
-    }
-    
-    public VarExprList(Var var, Expr expr)
-    {
-        this() ;
-        add(var, expr) ;
-    }
-
-    public List<Var> getVars() { return vars ; }
-    public Map<Var, Expr> getExprs() { return exprs ; }
-    
-    public boolean contains(Var var) { return vars.contains(var) ; }
-    public boolean hasExpr(Var var) { return exprs.containsKey(var) ; }
-    
-    public Expr getExpr(Var var) { return exprs.get(var) ; }
-    
-    // Or Binding.get(var, NamedExprList)
-    public Node get(Var var, Binding binding, FunctionEnv funcEnv)
-    {
-        Expr expr = exprs.get(var) ; 
-        if ( expr == null )
-            return binding.get(var) ; 
-        
-        try {
-            NodeValue nv = expr.eval(binding, funcEnv) ;
-            if ( nv == null )
-                return null ;
-            return nv.asNode() ;
-        } catch (ExprEvalException ex)
-        //{ Log.warn(this, "Eval failure "+expr+": "+ex.getMessage()) ; }
-        { }
-        return null ;
-    }
-    
-    public void add(Var var)
-    {
-        // Checking here controls whether duplicate variables are allowed.
-        // Duplicates with expressions are not allowed (add(Var, Expr))
-        // See ARQ.allowDuplicateSelectColumns
-
-        // Every should work either way round if this is enabled.
-        // Checking is done in Query for adding result vars, and group vars.
-        // if ( vars.contains(var) )
-            vars.add(var) ;
-    }
-
-    public void add(Var var, Expr expr)
-    {
-        if ( expr == null )
-        {
-            add(var) ;
-            return ;
-        }
-
-        if ( var == null )
-            throw new ARQInternalErrorException("Attempt to add a named expression with a null variable") ;
-        if ( exprs.containsKey(var) )
-            throw new ARQInternalErrorException("Attempt to assign an expression again") ;
-        add(var) ; 
-        exprs.put(var, expr) ;
-    }
-    
-    public void addAll(VarExprList other)
-    {
-        for ( Var v : other.vars )
-        {
-            Expr e = other.getExpr( v );
-            add( v, e );
-        }
-    }
-
-    public int size() { return vars.size() ; }
-    public boolean isEmpty() { return vars.isEmpty() ; } 
-    
-    @Override
-    public int hashCode()
-    { 
-        int x = vars.hashCode() ^ exprs.hashCode() ;
-        return x ;
-    }
-    
-    @Override
-    public boolean equals(Object other)
-    {
-        if ( this == other) return true ;
-        if ( ! ( other instanceof VarExprList ) )
-            return false ;
-        VarExprList x = (VarExprList)other ;
-        return Lib.equal(vars, x.vars) && Lib.equal(exprs, x.exprs) ;
-    }
-    
-    @Override
-    public String toString()
-    {
-        return vars.toString() + " // "+exprs.toString();
-    }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/Vars.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/Vars.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/Vars.java
deleted file mode 100644
index 7ee5c56..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/Vars.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.sparql.core;
-
-import java.util.Collection ;
-
-import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.graph.Triple ;
-
-/** Useful operations involving Var */
-public class Vars {
-    
-    public static void addVarsFromTriple(Collection<Var> acc, Triple t) {
-        addVar(acc, t.getSubject()) ;
-        addVar(acc, t.getPredicate()) ;
-        addVar(acc, t.getObject()) ;
-    }
-
-    public static void addVarsFromQuad(Collection<Var> acc, Quad q) {
-        addVar(acc, q.getSubject()) ;
-        addVar(acc, q.getPredicate()) ;
-        addVar(acc, q.getObject()) ;
-        addVar(acc, q.getGraph()) ;
-    }
-
-    public static void addVar(Collection<Var> acc, Node n) {
-        if (n == null)
-            return ;
-
-        if (n.isVariable())
-            acc.add(Var.alloc(n)) ;
-    }
-
-}
-

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/AssemblerUtils.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/AssemblerUtils.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/AssemblerUtils.java
deleted file mode 100644
index 681af4a..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/AssemblerUtils.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.sparql.core.assembler;
-
-import org.apache.jena.riot.RDFDataMgr ;
-
-import com.hp.hpl.jena.assembler.Assembler ;
-import com.hp.hpl.jena.assembler.JA ;
-import com.hp.hpl.jena.assembler.assemblers.AssemblerGroup ;
-import com.hp.hpl.jena.query.* ;
-import com.hp.hpl.jena.rdf.model.Model ;
-import com.hp.hpl.jena.rdf.model.Resource ;
-import com.hp.hpl.jena.rdf.model.ResourceFactory ;
-import com.hp.hpl.jena.shared.PrefixMapping ;
-import com.hp.hpl.jena.sparql.ARQException ;
-import com.hp.hpl.jena.sparql.util.Context ;
-import com.hp.hpl.jena.sparql.util.MappingRegistry ;
-import com.hp.hpl.jena.sparql.util.Symbol ;
-import com.hp.hpl.jena.sparql.util.TypeNotUniqueException ;
-import com.hp.hpl.jena.sparql.util.graph.GraphUtils ;
-
-public class AssemblerUtils
-{
-    // Wrappers for reading things form a file - assumes one of the thing per file. 
-    public static PrefixMapping readPrefixMapping(String file)
-    {
-        PrefixMapping pm = (PrefixMapping)AssemblerUtils.build(file, JA.PrefixMapping) ;
-        return pm ;
-    }
-    
-    private static boolean initialized = false ; 
-    
-    static { ARQ.init(); init() ; } 
-    
-    static public void init()
-    {
-        if ( initialized )
-            return ;
-        initialized = true ;
-        // Wire in the extension assemblers (extensions relative to the Jena assembler framework)
-        registerWith(Assembler.general) ;
-    }
-    
-    static public void registerWith(AssemblerGroup g)
-    {
-        // Wire in the extension assemblers (extensions relative to the Jena assembler framework)
-        g.implementWith(DatasetAssembler.getType(), new DatasetAssembler()) ;
-        g.implementWith(GraphStoreAssembler.getType(), new GraphStoreAssembler()) ;
-        g.implementWith(DatasetNullAssembler.getType(), new DatasetNullAssembler()) ;
-    }
-    
-    private static void assemblerClass(AssemblerGroup g, Resource r, Assembler a)
-    {
-        g.implementWith(r, a) ;
-    }
-    
-    public static Object build(String assemblerFile, String typeURI)
-    {
-        Resource type = ResourceFactory.createResource(typeURI) ;
-        return build(assemblerFile, type) ; 
-    }
-    
-    public static Object build(String assemblerFile, Resource type)
-    {
-        if ( assemblerFile == null )
-            throw new ARQException("No assembler file") ;
-        Model spec = null ;
-        try {
-            spec = RDFDataMgr.loadModel(assemblerFile) ;
-        } catch (Exception ex)
-        { throw new ARQException("Failed reading assembler description: "+ex.getMessage()) ; }
-
-        Resource root = null ;
-        try {
-            root = GraphUtils.findRootByType(spec, type) ;
-            if ( root == null )
-                return null ;
-            
-        } catch (TypeNotUniqueException ex)
-        { throw new ARQException("Multiple types for: "+DatasetAssemblerVocab.tDataset) ; }
-        return Assembler.general.open(root) ;
-    }
-    
-    /** Look for and set context declarations. 
-     * e.g.
-     * <pre>
-     * root ... ;
-     *   ja:context [ ja:cxtName "arq:queryTimeout" ;  ja:cxtValue "10000" ] ;
-     *   ...
-     * </pre>
-     * Short name forms of context parameters can be used.  
-     * Setting as string "undef" will remove the context setting.
-     */
-    public static void setContext(Resource r, Context context)
-    {
-        String qs = "PREFIX ja: <"+JA.getURI()+">\nSELECT * { ?x ja:context [ ja:cxtName ?name ; ja:cxtValue ?value ] }" ;
-        QuerySolutionMap qsm = new QuerySolutionMap() ;
-        qsm.add("x", r) ;
-        QueryExecution qExec = QueryExecutionFactory.create(qs, r.getModel(), qsm) ;
-        ResultSet rs = qExec.execSelect() ;
-        while ( rs.hasNext() )
-        {
-            QuerySolution soln = rs.next() ;
-            String name = soln.getLiteral("name").getLexicalForm() ;
-            String value = soln.getLiteral("value").getLexicalForm() ;  // Works for numbers as well!
-            name = MappingRegistry.mapPrefixName(name) ;
-            Symbol symbol = Symbol.create(name) ;
-            if ( "undef".equalsIgnoreCase(value) )
-                context.remove(symbol) ;
-            else
-                context.set(symbol, value) ;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/DatasetAssembler.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/DatasetAssembler.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/DatasetAssembler.java
deleted file mode 100644
index 155f5fd..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/DatasetAssembler.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.sparql.core.assembler ;
-
-import java.util.List ;
-
-import org.apache.jena.atlas.logging.Log ;
-
-import com.hp.hpl.jena.assembler.Assembler ;
-import com.hp.hpl.jena.assembler.Mode ;
-import com.hp.hpl.jena.assembler.assemblers.AssemblerBase ;
-import com.hp.hpl.jena.query.Dataset ;
-import com.hp.hpl.jena.query.DatasetFactory ;
-import com.hp.hpl.jena.rdf.model.Model ;
-import com.hp.hpl.jena.rdf.model.RDFNode ;
-import com.hp.hpl.jena.rdf.model.Resource ;
-import com.hp.hpl.jena.sparql.core.DatasetGraph ;
-import com.hp.hpl.jena.sparql.core.DatasetGraphFactory ;
-import com.hp.hpl.jena.sparql.graph.GraphFactory ;
-import com.hp.hpl.jena.sparql.util.FmtUtils ;
-import com.hp.hpl.jena.sparql.util.graph.GraphUtils ;
-
-public class DatasetAssembler extends AssemblerBase implements Assembler {
-    public static Resource getType() {
-        return DatasetAssemblerVocab.tDataset ;
-    }
-
-    @Override
-    public Object open(Assembler a, Resource root, Mode mode) {
-        Dataset ds = createDataset(a, root, mode) ;
-        return ds ;
-    }
-
-    public Dataset createDataset(Assembler a, Resource root, Mode mode) {
-        // Expanding version.
-        DatasetGraph dsg = DatasetGraphFactory.createMem() ;
-        AssemblerUtils.setContext(root, dsg.getContext()) ;
-
-        Dataset ds = DatasetFactory.create(dsg) ;
-
-        // -------- Default graph
-        // Can use ja:graph or ja:defaultGraph
-        Resource dftGraph = GraphUtils.getResourceValue(root, DatasetAssemblerVocab.pDefaultGraph) ;
-        if ( dftGraph == null )
-            dftGraph = GraphUtils.getResourceValue(root, DatasetAssemblerVocab.pGraph) ;
-
-        Model dftModel = null ;
-        if ( dftGraph != null )
-            dftModel = a.openModel(dftGraph) ;
-        else
-            // Assembler description did not define one - make a dummy.
-            dftModel = GraphFactory.makePlainModel() ;
-
-        ds.setDefaultModel(dftModel) ;
-
-        // -------- Named graphs
-        List<RDFNode> nodes = GraphUtils.multiValue(root, DatasetAssemblerVocab.pNamedGraph) ;
-
-        for ( RDFNode n : nodes )
-        {
-            if ( !( n instanceof Resource ) )
-            {
-                throw new DatasetAssemblerException( root, "Not a resource: " + FmtUtils.stringForRDFNode( n ) );
-            }
-            Resource r = (Resource) n;
-
-            String gName = GraphUtils.getAsStringValue( r, DatasetAssemblerVocab.pGraphName );
-            Resource g = GraphUtils.getResourceValue( r, DatasetAssemblerVocab.pGraph );
-            if ( g == null )
-            {
-                g = GraphUtils.getResourceValue( r, DatasetAssemblerVocab.pGraphAlt );
-                if ( g != null )
-                {
-                    Log.warn( this, "Use of old vocabulary: use :graph not :graphData" );
-                }
-                else
-                {
-                    throw new DatasetAssemblerException( root, "no graph for: " + gName );
-                }
-            }
-
-            Model m = a.openModel( g );
-            ds.addNamedModel( gName, m );
-        }
-
-        AssemblerUtils.setContext(root, ds.getContext()) ;
-        return ds ;
-    }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/DatasetAssemblerException.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/DatasetAssemblerException.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/DatasetAssemblerException.java
deleted file mode 100644
index ecb1c3a..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/DatasetAssemblerException.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.sparql.core.assembler;
-
-import com.hp.hpl.jena.assembler.exceptions.AssemblerException ;
-import com.hp.hpl.jena.rdf.model.Resource ;
-
-
-public class DatasetAssemblerException extends AssemblerException
-{
-    public DatasetAssemblerException(Resource cmd, String string)
-    {
-        super(cmd, string) ;
-    }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/DatasetAssemblerVocab.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/DatasetAssemblerVocab.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/DatasetAssemblerVocab.java
deleted file mode 100644
index cd5ca50..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/DatasetAssemblerVocab.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.sparql.core.assembler;
-
-import com.hp.hpl.jena.assembler.JA ;
-import com.hp.hpl.jena.rdf.model.Property ;
-import com.hp.hpl.jena.rdf.model.Resource ;
-import com.hp.hpl.jena.rdf.model.ResourceFactory ;
-
-public class DatasetAssemblerVocab
-{
-    public static final String NS = JA.getURI() ;
-    public static String getURI() { return NS ; }
-    
-    public static final Resource tDataset            = ResourceFactory.createResource(NS+"RDFDataset") ;
-    public static final Resource tGraphStore         = ResourceFactory.createResource(NS+"GraphStore") ;
-    public static final Resource tDatasetNull        = ResourceFactory.createResource(NS+"DatasetNull") ;
-    public static final Property pDefaultGraph       = ResourceFactory.createProperty(NS, "defaultGraph") ;
-    public static final Property pNamedGraph         = ResourceFactory.createProperty(NS, "namedGraph") ;
-    
-    public static final Property pGraphName          = ResourceFactory.createProperty(NS, "graphName") ;
-    public static final Property pGraph              = ResourceFactory.createProperty(NS, "graph") ;
-    public static final Property pGraphAlt           = ResourceFactory.createProperty(NS, "graphData") ;
-
-    public static final Property pIndex              = ResourceFactory.createProperty(NS, "textIndex") ;
-    
-    public static final Property pTransactional      = ResourceFactory.createProperty(NS, "transactional") ;
-    
-    public static final Property pContext            = ResourceFactory.createProperty(NS, "context") ;
-    public static final Property pCxtName            = ResourceFactory.createProperty(NS, "cxtName") ;
-    public static final Property pCxtValue           = ResourceFactory.createProperty(NS, "cxtValue") ;
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/DatasetDescriptionAssembler.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/DatasetDescriptionAssembler.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/DatasetDescriptionAssembler.java
deleted file mode 100644
index d427421..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/DatasetDescriptionAssembler.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.sparql.core.assembler;
-
-import java.util.List ;
-
-import com.hp.hpl.jena.assembler.Assembler ;
-import com.hp.hpl.jena.assembler.Mode ;
-import com.hp.hpl.jena.assembler.assemblers.AssemblerBase ;
-import com.hp.hpl.jena.rdf.model.Resource ;
-import com.hp.hpl.jena.sparql.core.DatasetDescription ;
-import com.hp.hpl.jena.sparql.util.graph.GraphUtils ;
-
-public class DatasetDescriptionAssembler extends AssemblerBase implements Assembler
-{
-    public DatasetDescriptionAssembler()       {}
-    
-    public static Resource getType()    { return DatasetAssemblerVocab.tDataset ; }
-    
-    @Override
-    public Object open(Assembler a, Resource root, Mode mode)
-    {
-        DatasetDescription ds = new DatasetDescription() ;
-
-        // -------- Default graph
-        // Can use ja:graph or ja:defaultGraph
-        List<String> dftGraphs1 = GraphUtils.multiValueString(root, DatasetAssemblerVocab.pDefaultGraph) ;
-        List<String> dftGraphs2 = GraphUtils.multiValueString(root, DatasetAssemblerVocab.pGraph) ;
-        ds.getDefaultGraphURIs().addAll(dftGraphs1) ;
-        ds.getDefaultGraphURIs().addAll(dftGraphs2) ;
-
-        // -------- Named graphs
-        List<String> namedGraphURIs = GraphUtils.multiValueString(root, DatasetAssemblerVocab.pNamedGraph) ; 
-        ds.getNamedGraphURIs().addAll(namedGraphURIs) ;
-        
-        return ds ;
-    }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/DatasetNullAssembler.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/DatasetNullAssembler.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/DatasetNullAssembler.java
deleted file mode 100644
index c7167c5..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/DatasetNullAssembler.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.sparql.core.assembler;
-
-import org.apache.jena.atlas.logging.Log ;
-
-import com.hp.hpl.jena.assembler.Assembler ;
-import com.hp.hpl.jena.assembler.Mode ;
-import com.hp.hpl.jena.assembler.assemblers.AssemblerBase ;
-import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.query.DatasetFactory ;
-import com.hp.hpl.jena.rdf.model.Resource ;
-import com.hp.hpl.jena.sparql.core.DatasetGraph ;
-import com.hp.hpl.jena.sparql.expr.NodeValue ;
-import com.hp.hpl.jena.sparql.modify.GraphStoreNull ;
-import com.hp.hpl.jena.sparql.modify.GraphStoreNullTransactional ;
-
-public class DatasetNullAssembler extends AssemblerBase implements Assembler
-{
-    public static Resource getType() { return DatasetAssemblerVocab.tDatasetNull ; }
-    
-    @Override
-    public Object open(Assembler a, Resource root, Mode mode)
-    {
-        boolean transactional = true;
-        
-        if (root.hasProperty(DatasetAssemblerVocab.pTransactional))
-        {
-            Node b = root.getProperty(DatasetAssemblerVocab.pTransactional).getObject().asNode();
-            NodeValue nv = NodeValue.makeNode(b);
-            if (nv.isBoolean())
-            {
-                transactional = nv.getBoolean();
-            }
-            else
-            {
-                Log.warn(DatasetNullAssembler.class,
-                         "Failed to recognize value for transactional setting (ignored): " + b);
-            }
-        }
-        
-        DatasetGraph dsg = transactional ? new GraphStoreNullTransactional() : new GraphStoreNull();
-        
-        return DatasetFactory.create(dsg) ;
-    }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/GraphStoreAssembler.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/GraphStoreAssembler.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/GraphStoreAssembler.java
deleted file mode 100644
index 2f1e1d3..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/assembler/GraphStoreAssembler.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.sparql.core.assembler;
-
-import com.hp.hpl.jena.assembler.Assembler ;
-import com.hp.hpl.jena.assembler.Mode ;
-import com.hp.hpl.jena.query.Dataset ;
-import com.hp.hpl.jena.rdf.model.Resource ;
-import com.hp.hpl.jena.update.GraphStore ;
-import com.hp.hpl.jena.update.GraphStoreFactory ;
-
-public class GraphStoreAssembler extends DatasetAssembler
-{
-    public static Resource getType() { return DatasetAssemblerVocab.tGraphStore ; }
-    
-    @Override
-    public Object open(Assembler a, Resource root, Mode mode)
-    {
-        // Same vocabulary as datasets.
-        // Have dispatched on type by now so can just call the dataset code to build a Dataset.
-        
-        GraphStore gs = null ;
-        Object ds = super.open(a, root, mode) ;
-        if ( ds instanceof Dataset )
-            gs = GraphStoreFactory.create((Dataset)ds) ;
-        else
-            throw new DatasetAssemblerException(root, "Not a graph store") ;
-            
-        return gs ; 
-    }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/describe/DescribeBNodeClosure.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/describe/DescribeBNodeClosure.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/describe/DescribeBNodeClosure.java
deleted file mode 100644
index 1642396..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/describe/DescribeBNodeClosure.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.sparql.core.describe;
-
-import com.hp.hpl.jena.query.* ;
-import com.hp.hpl.jena.rdf.model.Model ;
-import com.hp.hpl.jena.rdf.model.Resource ;
-import com.hp.hpl.jena.sparql.ARQConstants ;
-import com.hp.hpl.jena.sparql.util.Closure ;
-import com.hp.hpl.jena.sparql.util.Context ;
-
-/** DescribeHandler that calculates the bNode closure.
- *  Takes all the statements of this resource, and for every object that is
- *  a bNode, it recursively includes its statements. */
-
-public class DescribeBNodeClosure implements DescribeHandler
-{
-    Model acc ;
-    Dataset dataset ;
-    
-    public DescribeBNodeClosure() {}
-    
-    @Override
-    public void start(Model accumulateResultModel, Context cxt)
-    {
-        acc = accumulateResultModel ;
-        this.dataset = (Dataset)cxt.get(ARQConstants.sysCurrentDataset) ;
-    }
-
-    // DISTINCT - we only need each ?g once. 
-    private static Query query = QueryFactory.create("SELECT DISTINCT ?g { GRAPH ?g { ?s ?p ?o } }") ; 
-    
-    // Check all named graphs
-    @Override
-    public void describe(Resource r)
-    {
-        // Default model.
-        Closure.closure(otherModel(r, dataset.getDefaultModel()), false, acc) ;
-
-        // Find all the named graphs in which this resource
-        // occurs as a subject.  Faster than iterating in the
-        // names of graphs in the case of very large numbers
-        // of graphs, few of which contain the resource, in
-        // some kind of persistent storage.
-        
-        QuerySolutionMap qsm = new QuerySolutionMap() ;
-        qsm.add("s", r) ;
-        QueryExecution qExec = QueryExecutionFactory.create(query, dataset, qsm) ;
-        ResultSet rs = qExec.execSelect() ;
-        for ( ; rs.hasNext() ; )
-        {
-            QuerySolution qs = rs.next() ;
-            String gName = qs.getResource("g").getURI() ;
-            Model model =  dataset.getNamedModel(gName) ;
-            Resource r2 = otherModel(r, model) ;
-            Closure.closure(r2, false, acc) ;
-        }
-        
-//        // Named graphs
-//        for ( Iterator<String> iter = dataset.listNames() ; iter.hasNext() ; )
-//        {
-//            String name = iter.next();
-//            Model model =  dataset.getNamedModel(name) ;
-//            Resource r2 = otherModel(r, model) ;
-//            Closure.closure(r2, false, acc) ;
-//        }
-        
-        Closure.closure(r, false, acc) ;
-    }
-
-    private static Resource otherModel(Resource r, Model model)
-    {
-        if ( r.isURIResource() )
-            return model.createResource(r.getURI()) ;
-        if ( r.isAnon() )
-            return model.createResource(r.getId()) ;
-        // Literals do not need converting.
-        return r ;
-    }
-
-    @Override
-    public void finish()
-    { }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/describe/DescribeBNodeClosureFactory.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/describe/DescribeBNodeClosureFactory.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/describe/DescribeBNodeClosureFactory.java
deleted file mode 100644
index 0c05509..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/describe/DescribeBNodeClosureFactory.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.sparql.core.describe;
-
-public class DescribeBNodeClosureFactory implements DescribeHandlerFactory
-{
-    @Override
-    public DescribeHandler create()
-    {
-        return new DescribeBNodeClosure() ;
-    }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/describe/DescribeHandler.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/describe/DescribeHandler.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/describe/DescribeHandler.java
deleted file mode 100644
index d9b79bc..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/describe/DescribeHandler.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.sparql.core.describe;
-
-import com.hp.hpl.jena.rdf.model.Model ;
-import com.hp.hpl.jena.rdf.model.Resource ;
-import com.hp.hpl.jena.sparql.util.Context ;
-
-/** A DescribeHandler provides the description of a resource.
- *  DESCRIBE queries return RDF that describes the resource found, either
- *  from the query pattern or explicitly named in the DESCRIBE clause.
- *  For each resource, any handlers are called to builds the RDF model
- *  that is to be the result of the query. */
-
-public interface DescribeHandler
-{
-    /**
-     * Start the describe process, passing in the result model.
-     * @param accumulateResultModel
-     * @param qContext Query execution context
-     */
-    public void start(Model accumulateResultModel, Context qContext) ;
-    
-    /** Called on everything resource found by a query.
-     *  Can add more RDF to the model provided.  May choose to add nothing.
-     * 
-     * @param resource               resource to describe
-     */
-    
-    public void describe(Resource resource) ;
-
-    /** Finish the description process for thsis query execution
-     */
-    public void finish() ;
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/describe/DescribeHandlerFactory.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/describe/DescribeHandlerFactory.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/describe/DescribeHandlerFactory.java
deleted file mode 100644
index a36f958..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/describe/DescribeHandlerFactory.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.sparql.core.describe;
-
-
-/** Factory for describe handlers */
-
-public interface DescribeHandlerFactory
-{
-    public DescribeHandler create() ;
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/describe/DescribeHandlerRegistry.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/describe/DescribeHandlerRegistry.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/describe/DescribeHandlerRegistry.java
deleted file mode 100644
index 40f6d5b..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/describe/DescribeHandlerRegistry.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.sparql.core.describe;
-
-import java.util.ArrayList ;
-import java.util.Iterator ;
-import java.util.List ;
-
-import com.hp.hpl.jena.query.ARQ ;
-import com.hp.hpl.jena.sparql.ARQConstants ;
-import com.hp.hpl.jena.sparql.util.Context ;
-
-/** Registry of DescribeHandlers. */
-
-public class DescribeHandlerRegistry
-{
-    static private DescribeHandlerRegistry globalRegistry = null ;
-    
-    private List<DescribeHandlerFactory> registry = new ArrayList<>() ;
-
-    private DescribeHandlerRegistry() { }
-    
-    private static synchronized DescribeHandlerRegistry standardRegistry()
-    {
-        DescribeHandlerRegistry reg = new DescribeHandlerRegistry() ;
-        reg.add(new DescribeBNodeClosureFactory()) ;
-        return reg ;
-    }
-    
-    public static DescribeHandlerRegistry get(Context context)
-    {
-        if ( context == null )
-            return null ;
-        return (DescribeHandlerRegistry)ARQ.getContext().get(ARQConstants.registryDescribeHandlers) ;
-    }
-    
-    public static void set(Context context, DescribeHandlerRegistry reg)
-    {
-        context.set(ARQConstants.registryDescribeHandlers, reg) ;
-    }
-    
-    public static DescribeHandlerRegistry get()
-    {
-        // Intialize if there is no registry already set 
-        DescribeHandlerRegistry reg = get(ARQ.getContext()) ;
-        if ( reg == null )
-        {
-            reg = standardRegistry() ;
-            set(ARQ.getContext(), reg) ;
-        }
-        return reg ;
-    }
-    
-    public void add(DescribeHandlerFactory handlerFactory )
-    {
-        registry.add(0, handlerFactory) ; 
-    }
-    
-    public void remove(DescribeHandlerFactory handlerFactory)
-    {
-        registry.remove(handlerFactory) ; 
-    }
-    
-    public void clear()
-    {
-        registry.clear() ;
-    }
-    
-    public List<DescribeHandler> newHandlerList()
-    {
-        List<DescribeHandler> a = new ArrayList<>(registry.size()) ;
-        for ( Iterator<DescribeHandlerFactory> iter = handlers() ; iter.hasNext() ; )
-        {
-            DescribeHandlerFactory f = iter.next();
-            a.add(f.create()) ;
-        }
-        return a ;
-    }
-    
-    
-    public Iterator<DescribeHandlerFactory> handlers()
-    {
-        return registry.iterator() ;
-    }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/ExecutionContext.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/ExecutionContext.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/ExecutionContext.java
deleted file mode 100644
index f31c49f..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/ExecutionContext.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.sparql.engine;
-
-import java.util.ArrayList ;
-import java.util.Collection ;
-import java.util.Iterator ;
-
-import com.hp.hpl.jena.graph.Graph ;
-import com.hp.hpl.jena.sparql.core.DatasetGraph ;
-import com.hp.hpl.jena.sparql.engine.main.OpExecutorFactory ;
-import com.hp.hpl.jena.sparql.function.FunctionEnv ;
-import com.hp.hpl.jena.sparql.util.Context ;
-
-public class ExecutionContext implements FunctionEnv
-{
-    private static boolean TrackAllIterators = false ;
-
-    private Context context       = null ;
-    private DatasetGraph dataset  = null ;
-    
-    // Iterator tracking
-    private Collection<QueryIterator> openIterators    = null ;
-    // Tracking all iterators leads to a build up of state,
-    private Collection<QueryIterator> allIterators     = null ; 
-    private Graph activeGraph           = null ;
-    private OpExecutorFactory executor  = null ;
-
-    /** Clone */
-    public ExecutionContext(ExecutionContext other) 
-    {
-        this.context = other.context ;
-        this.dataset = other.dataset ;
-        this.openIterators = other.openIterators ;
-        this.allIterators = other.allIterators ;
-        this.activeGraph = other.activeGraph ;
-        this.executor = other.executor ;
-    }
-    
-    /** Clone and change active graph - shares tracking */
-    public ExecutionContext(ExecutionContext other, Graph activeGraph) 
-    {
-        this(other) ; 
-        this.activeGraph = activeGraph ; 
-    }
-
-    public ExecutionContext(Context params, Graph activeGraph, DatasetGraph dataset, OpExecutorFactory factory)
-    {
-        this.context = params ;
-        this.dataset = dataset ;
-        this.openIterators = new ArrayList<>() ;
-        if ( TrackAllIterators )
-            this.allIterators  = new ArrayList<>() ;
-        this.activeGraph = activeGraph ;
-        this.executor = factory ;
-    }
-
-    @Override
-    public Context getContext()       { return context ; }
-
-//    public ExecutionContext getExecutionContext()       { return this ; }
-
-    
-    public void openIterator(QueryIterator qIter)
-    {
-        openIterators.add(qIter) ;
-        if ( allIterators != null )
-            allIterators.add(qIter) ;
-    }
-
-    public void closedIterator(QueryIterator qIter)
-    {
-        openIterators.remove(qIter) ;
-    }
-
-    public Iterator<QueryIterator> listOpenIterators()  { return openIterators.iterator() ; }
-    public Iterator<QueryIterator> listAllIterators()
-    { 
-        if ( allIterators == null ) return null ;
-        return allIterators.iterator() ;
-    }
-    
-    public OpExecutorFactory getExecutor()
-    {
-        return executor ;
-    }
-    
-    /** Setter for the policy for algebra expression evaluation - use with care */
-    public void setExecutor(OpExecutorFactory executor)
-    {
-        this.executor = executor ;
-    }
-
-    @Override
-    public DatasetGraph getDataset()  { return dataset ; }
-
-//    /** Setter for the dataset - use with care */
-//    public void setDataset(DatasetGraph dataset)
-//    {
-//        this.dataset = dataset ;
-//    }
-
-    /** Return the active graph (the one matching is against at this point in the query.
-     * May be null if unknown or not applicable - for example, doing quad store access or
-     * when sorting  
-     */ 
-    @Override
-    public Graph getActiveGraph()     { return activeGraph ; }
-
-//    /** Setter for the active graph - use with care */
-//    public void setActiveGraph(Graph activeGraph)
-//    {
-//        this.activeGraph = activeGraph ;
-//    }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/OpEval.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/OpEval.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/OpEval.java
deleted file mode 100644
index 395a853..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/OpEval.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.sparql.engine;
-
-import com.hp.hpl.jena.sparql.algebra.Op ;
-import com.hp.hpl.jena.sparql.core.DatasetGraph ;
-import com.hp.hpl.jena.sparql.engine.binding.Binding ;
-import com.hp.hpl.jena.sparql.util.Context ;
-
-public interface OpEval
-{
-    //public QueryIterator evaluate(Op op, Graph graph) ;
-    //public QueryIterator evaluate(Op op, DatasetGraph dsg, Context context) ;
-    public QueryIterator evaluate(Op op, DatasetGraph dsg, Binding binding, Context context) ;
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/Plan.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/Plan.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/Plan.java
deleted file mode 100644
index e9164d4..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/Plan.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.sparql.engine;
-
-import org.apache.jena.atlas.lib.Closeable ;
-
-import com.hp.hpl.jena.sparql.algebra.Op ;
-import com.hp.hpl.jena.sparql.util.PrintSerializable ;
-
-public interface Plan extends PrintSerializable, Closeable
-{
-    // General markers, especially structural elements
-    public static final String startMarker = "(" ;
-    public static final String finishMarker = ")" ;
-
-    // Used for small things.
-    public static final String startMarker2 = "(" ;
-    public static final String finishMarker2 = ")" ;
-    
-    public Op getOp() ;
-    public QueryIterator iterator() ;
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/PlanBase.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/PlanBase.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/PlanBase.java
deleted file mode 100644
index 9326ed0..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/PlanBase.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.sparql.engine;
-
-import org.apache.jena.atlas.io.IndentedWriter ;
-import org.apache.jena.atlas.lib.Closeable ;
-
-import com.hp.hpl.jena.sparql.ARQConstants ;
-import com.hp.hpl.jena.sparql.ARQInternalErrorException ;
-import com.hp.hpl.jena.sparql.algebra.Op ;
-import com.hp.hpl.jena.sparql.serializer.SerializationContext ;
-import com.hp.hpl.jena.sparql.util.PrintSerializableBase ;
-
-public abstract class PlanBase extends PrintSerializableBase implements Plan
-{
-    private Op op = null ;
-    protected Closeable closeable = null ;
-    protected boolean closed = false ;
-    private boolean iteratorProduced = false ;
-    
-    protected abstract QueryIterator iteratorOnce() ;
-
-    protected PlanBase(Op op, Closeable closeable)  { this.op = op ; this.closeable = closeable ; } 
-    
-    @Override
-    public Op getOp()       { return op ; }
-    
-    @Override
-    final
-    public QueryIterator iterator() 
-    {
-        if ( iteratorProduced )
-        {
-            throw new ARQInternalErrorException("Attempt to use the iterator twice") ;
-        }
-        iteratorProduced = true ;
-        return iteratorOnce() ;
-    }
-
-    @Override
-    public void output(IndentedWriter out)
-    {
-        SerializationContext sCxt = new SerializationContext(ARQConstants.getGlobalPrefixMap()) ;
-        output(out, sCxt) ;
-    }
-    
-    @Override
-    public void output(IndentedWriter out, SerializationContext sCxt)
-    {
-        op.output(out, sCxt) ;
-    }
-    
-    @Override
-    public void close()
-    { 
-        if ( closed )
-            return ;
-        if ( closeable != null )
-            // Called once
-            // Two routes - explicit QueryExecution.close
-            // or natural end of QueryIterator (see PlanOp)
-            closeable.close() ;
-        closed = true ;
-    }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/PlanOp.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/PlanOp.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/PlanOp.java
deleted file mode 100644
index 251eaaa..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/PlanOp.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.sparql.engine;
-
-import org.apache.jena.atlas.io.IndentedWriter ;
-import org.apache.jena.atlas.lib.Closeable ;
-
-import com.hp.hpl.jena.sparql.algebra.Op ;
-import com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorCloseable ;
-import com.hp.hpl.jena.sparql.serializer.SerializationContext ;
-import com.hp.hpl.jena.sparql.util.Utils ;
-
-public class PlanOp extends PlanBase
-{
-    private QueryIterator qIter ;
-    private String label = null ;
-    
-    public PlanOp(Op op, Closeable closeable, QueryIterator qIter)
-    { 
-        super(op, closeable) ;
-        //this.qIter = qIter ;
-        // Catch the close and close the plan. 
-        this.qIter = new QueryIteratorCloseable(qIter, this) ;
-    }
-
-    public PlanOp(String label, Closeable closeable, Op op, QueryIterator qIter)
-    {
-        this(op, closeable, qIter) ;
-        this.label = label ;
-    }
-    
-    @Override
-    protected QueryIterator iteratorOnce()
-    { return qIter ; }
-
-    @Override
-    public void output(IndentedWriter out, SerializationContext sCxt)
-    {
-        if ( getOp() == null )
-        {
-            out.println(Utils.className(this)) ;
-            return ;
-        }
-
-        String str = label ;
-
-        if ( label == null )
-            str = "Plan" ;
-        out.print(Plan.startMarker) ;
-        out.println(str) ;
-        out.incIndent() ;
-        //getOp().output(out, sCxt) ;
-        qIter.output(out, sCxt) ;
-
-        out.print(Plan.finishMarker) ;
-        out.decIndent() ;
-        out.ensureStartOfLine() ;
-    }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/QueryEngineBase.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/QueryEngineBase.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/QueryEngineBase.java
deleted file mode 100644
index ee2da50..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/QueryEngineBase.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.sparql.engine;
-
-import org.apache.jena.atlas.lib.Closeable ;
-import org.apache.jena.atlas.logging.Log ;
-
-import com.hp.hpl.jena.query.Query ;
-import com.hp.hpl.jena.sparql.ARQConstants ;
-import com.hp.hpl.jena.sparql.algebra.Algebra ;
-import com.hp.hpl.jena.sparql.algebra.Op ;
-import com.hp.hpl.jena.sparql.core.DatasetGraph ;
-import com.hp.hpl.jena.sparql.core.Substitute ;
-import com.hp.hpl.jena.sparql.engine.binding.Binding ;
-import com.hp.hpl.jena.sparql.engine.binding.BindingRoot ;
-import com.hp.hpl.jena.sparql.mgt.Explain ;
-import com.hp.hpl.jena.sparql.mgt.QueryEngineInfo ;
-import com.hp.hpl.jena.sparql.util.Context ;
-
-/** Main part of a QueryEngine - something that takes responsibility for a complete query execution */ 
-public abstract class QueryEngineBase implements OpEval, Closeable
-{
-    public final static QueryEngineInfo queryEngineInfo = new QueryEngineInfo() ;
-    // See also ExecutinContext.getDataset()
-    protected DatasetGraph dataset = null ;
-    protected Context context ;
-    private Binding startBinding ;
-    
-    private Query query = null ;
-    private Op queryOp = null ;
-    private Plan plan = null ;
-    
-    protected QueryEngineBase(Query query,
-                              DatasetGraph dataset, 
-                              Binding input,
-                              Context cxt)
-    {
-        this(dataset, input, cxt) ;
-        this.query = query ;
-        query.setResultVars() ;
-        // Unoptimized so far.
-        setOp(createOp(query)) ;
-    }
-    
-    protected QueryEngineBase(Op op, DatasetGraph dataset, Binding input, Context cxt)
-    {
-        this(dataset, input, cxt) ;
-        // Ensure context setup - usually done in QueryExecutionBase
-        // so it can be changed after initialization.
-        if ( context == null )
-            context = Context.setupContext(context, dataset) ;
-        this.query = null ;
-        setOp(op) ;
-    }
-    
-    private QueryEngineBase(DatasetGraph dataset, Binding input, Context context)
-    {
-        this.context = context ;
-        this.dataset = dataset ;    // Maybe null e.g. in query
-        
-        if ( input == null )
-        {
-            Log.warn(this, "Null initial input") ;
-            input = BindingRoot.create() ;
-        }
-        this.startBinding = input ;
-    }
-    
-    public Plan getPlan()
-    {
-        if ( plan == null )
-            plan = createPlan() ;
-        return plan ;
-    }
-    
-    protected Plan createPlan()
-    {
-        // Decide the algebra to actually execute.
-        Op op = queryOp ;
-        if ( ! startBinding.isEmpty() ) {
-            op = Substitute.substitute(op, startBinding) ;
-            context.put(ARQConstants.sysCurrentAlgebra, op) ;
-            // Don't reset the startBinding because it also is
-            // needed in the output.
-        }
-        op = modifyOp(op) ;
-
-        QueryIterator queryIterator = null ;
-        if ( dataset != null )
-            // Null means setting up but not executing a query.
-            queryIterator = evaluate(op, dataset, startBinding, context) ;
-        else
-            // Bypass management interface
-            queryIterator = evaluateNoMgt(op, dataset, startBinding, context) ;
-        // This could be an automagic iterator to catch close.
-        return new PlanOp(getOp(), this, queryIterator) ;
-    }
-    
-    protected Op modifyOp(Op op)
-    { return op ; }
-    
-    protected Op createOp(Query query)
-    {
-        Op op = Algebra.compile(query) ;
-        return op ;
-    }
-    
-    // Record the query operation as it goes pass and call the actual worker
-    @Override
-    final
-    public QueryIterator evaluate(Op op, DatasetGraph dsg, Binding binding, Context context)
-    {
-        if ( query != null ) 
-            Explain.explain("QUERY", query, context) ;
-        Explain.explain("ALGEBRA", op, context) ;
-        queryEngineInfo.incQueryCount() ;
-        queryEngineInfo.setLastQueryExecAt() ;
-        //queryEngineInfo.setLastQueryExecTime(-1) ;
-        queryEngineInfo.setLastQueryString((Query)context.get(ARQConstants.sysCurrentQuery)) ;
-        queryEngineInfo.setLastOp(op) ;
-        return eval(op, dsg, binding, context) ;
-    }
-    
-    private QueryIterator evaluateNoMgt(Op op, DatasetGraph dsg, Binding binding, Context context)
-    {
-        return eval(op, dsg, binding, context) ;
-    }
-    
-    abstract protected
-    QueryIterator eval(Op op, DatasetGraph dsg, Binding binding, Context context) ;
-
-    /** Algebra expression (including any optimization) */
-    public Op getOp() { return queryOp ; }
-    
-    protected Binding getStartBinding() { return startBinding ; }
-    
-    @Override
-    public void close()
-    { }
-    
-    protected void setOp(Op op)
-    { 
-        queryOp = op ;
-        context.put(ARQConstants.sysCurrentAlgebra, op) ;
-    }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/QueryEngineFactory.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/QueryEngineFactory.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/QueryEngineFactory.java
deleted file mode 100644
index d141da7..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/QueryEngineFactory.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.sparql.engine;
-
-import com.hp.hpl.jena.query.Query ;
-import com.hp.hpl.jena.sparql.algebra.Op ;
-import com.hp.hpl.jena.sparql.core.DatasetGraph ;
-import com.hp.hpl.jena.sparql.engine.binding.Binding ;
-import com.hp.hpl.jena.sparql.util.Context ;
-
-/** Additional QueryEngineFactory's 
- * can be dynamically added to the registry. */ 
-public interface QueryEngineFactory
-{
-    public boolean accept(Query query, DatasetGraph dataset, Context context) ;
-    public Plan create(Query query, DatasetGraph dataset, Binding inputBinding, Context context) ;
-    
-    public boolean accept(Op op, DatasetGraph dataset, Context context) ;
-    public Plan create(Op op, DatasetGraph dataset, Binding inputBinding, Context context) ;
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/QueryEngineFactoryWrapper.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/QueryEngineFactoryWrapper.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/QueryEngineFactoryWrapper.java
deleted file mode 100644
index 0e17c8d..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/QueryEngineFactoryWrapper.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.sparql.engine;
-
-import com.hp.hpl.jena.query.Query ;
-import com.hp.hpl.jena.sparql.algebra.Op ;
-import com.hp.hpl.jena.sparql.core.DatasetGraph ;
-import com.hp.hpl.jena.sparql.core.DatasetGraphWrapper ;
-import com.hp.hpl.jena.sparql.engine.Plan ;
-import com.hp.hpl.jena.sparql.engine.QueryEngineFactory ;
-import com.hp.hpl.jena.sparql.engine.QueryEngineRegistry ;
-import com.hp.hpl.jena.sparql.engine.binding.Binding ;
-import com.hp.hpl.jena.sparql.util.Context ;
-
-/** Default processing for a DatasetGraphWrapper - unwrap and repeat */ 
-public class QueryEngineFactoryWrapper implements QueryEngineFactory
-{
-    private static QueryEngineFactory instance = new QueryEngineFactoryWrapper() ;
-    public static QueryEngineFactory get() { return instance ; }
-    
-    @Override
-    public boolean accept(Query query, DatasetGraph dsg, Context context) {
-        if ( !(  dsg instanceof DatasetGraphWrapper ) )
-            return false ;    
-        DatasetGraph dsg2 = ((DatasetGraphWrapper)dsg).getWrapped() ;
-        return QueryEngineRegistry.findFactory(query, dsg2, context).accept(query, dsg2, context) ;
-    }
-
-    @Override
-    public Plan create(Query query, DatasetGraph dsg, Binding inputBinding, Context context) {
-        if ( !(  dsg instanceof DatasetGraphWrapper ) )
-            return null ;    
-        DatasetGraph dsg2 = ((DatasetGraphWrapper)dsg).getWrapped() ;
-        return QueryEngineRegistry.findFactory(query, dsg2, context).create(query, dsg2, inputBinding, context) ;
-    }
-
-    @Override
-    public boolean accept(Op op, DatasetGraph dsg, Context context) {
-        if ( !(  dsg instanceof DatasetGraphWrapper ) )
-            return false ;    
-        DatasetGraph dsg2 = ((DatasetGraphWrapper)dsg).getWrapped() ;
-        return QueryEngineRegistry.findFactory(op, dsg2, context).accept(op, dsg2, context) ;
-    }
-
-    @Override
-    public Plan create(Op op, DatasetGraph dsg, Binding inputBinding, Context context) {
-        if ( !(  dsg instanceof DatasetGraphWrapper ) )
-            return null ;    
-        DatasetGraph dsg2 = ((DatasetGraphWrapper)dsg).getWrapped() ;
-        return QueryEngineRegistry.findFactory(op, dsg2, context).create(op, dsg2, inputBinding, context) ;
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/QueryEngineRegistry.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/QueryEngineRegistry.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/QueryEngineRegistry.java
deleted file mode 100644
index 7964e4c..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/QueryEngineRegistry.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.hp.hpl.jena.sparql.engine;
-
-import java.util.ArrayList ;
-import java.util.List ;
-
-import com.hp.hpl.jena.query.Query ;
-import com.hp.hpl.jena.sparql.algebra.Op ;
-import com.hp.hpl.jena.sparql.core.DatasetGraph ;
-import com.hp.hpl.jena.sparql.engine.main.QueryEngineMain ;
-import com.hp.hpl.jena.sparql.util.Context ;
-
-
-public class QueryEngineRegistry
-{
-    List<QueryEngineFactory> factories = new ArrayList<>() ;
-    static { init() ; }
-    
-    // Singleton
-    static QueryEngineRegistry registry = null ;
-    static public QueryEngineRegistry get()
-    { 
-        if ( registry == null )
-            init() ;
-        return registry;
-    }
-    
-    private QueryEngineRegistry() { }
-    
-    private static synchronized void init()
-    {
-        registry = new QueryEngineRegistry() ;
-        registry.add(QueryEngineMain.getFactory()) ;
-        registry.add(QueryEngineFactoryWrapper.get()) ;
-    }
-    
-    /** Locate a suitable factory for this query and dataset from the default registry
-     * 
-     * @param query   Query 
-     * @param dataset Dataset
-     * @return A QueryExecutionFactory or null if none accept the request
-     */
-    
-    public static QueryEngineFactory findFactory(Query query, DatasetGraph dataset, Context context)
-    { return get().find(query, dataset, context) ; }
-    
-    /** Locate a suitable factory for this algebra expression
-     *  and dataset from the default registry
-     * 
-     * @param op   Algebra expression 
-     * @param dataset DatasetGraph
-     * @param context
-     * @return A QueryExecutionFactory or null if none accept the request
-     */
-    
-    public static QueryEngineFactory findFactory(Op op, DatasetGraph dataset, Context context)
-    { return get().find(op, dataset, context) ; }
-
-    /** Locate a suitable factory for this query and dataset
-     * 
-     * @param query   Query 
-     * @param dataset Dataset
-     * @return A QueryExecutionFactory or null if none accept the request
-     */
-    
-    public QueryEngineFactory find(Query query, DatasetGraph dataset)
-    { return find(query, dataset, null) ; }
-
-    /** Locate a suitable factory for this query and dataset
-     * 
-     * @param query   Query 
-     * @param dataset Dataset
-     * @return A QueryExecutionFactory or null if none accept the request
-     */
-    
-    public QueryEngineFactory find(Query query, DatasetGraph dataset, Context context)
-    {
-        for ( QueryEngineFactory f : factories )
-        {
-            if ( f.accept( query, dataset, context ) )
-            {
-                return f;
-            }
-        }
-        return null ;
-    }
-    
-    /** Locate a suitable factory for this algebra expression and dataset
-     * 
-     * @param op   Algebra expression 
-     * @param dataset DatasetGraph
-     * @param context
-     * 
-     * @return A QueryExecutionFactory or null if none accept the request
-     */
-    
-    public QueryEngineFactory find(Op op, DatasetGraph dataset, Context context)
-    {
-        for ( QueryEngineFactory f : factories )
-        {
-            if ( f.accept( op, dataset, context ) )
-            {
-                return f;
-            }
-        }
-        return null ;
-    }
-    
-    /** Add a QueryExecutionFactory to the default registry */
-    public static void addFactory(QueryEngineFactory f) { get().add(f) ; }
-    
-    /** Add a QueryExecutionFactory */
-    public void add(QueryEngineFactory f)
-    {
-        // Add to low end so that newer factories are tried first
-        factories.add(0, f) ; 
-    }
-    
-    /** Remove a QueryExecutionFactory */
-    public static void removeFactory(QueryEngineFactory f)  { get().remove(f) ; }
-    
-    /** Remove a QueryExecutionFactory */
-    public void remove(QueryEngineFactory f)  { factories.remove(f) ; }
-    
-    /** Allow <b>careful</b> manipulation of the factories list */
-    public List<QueryEngineFactory> factories() { return factories ; }
-
-    /** Check whether a query engine factory is already registered in the default registry*/
-    public static boolean containsFactory(QueryEngineFactory f) { return get().contains(f) ; }
-
-    /** Check whether a query engine factory is already registered */
-    public boolean contains(QueryEngineFactory f) { return factories.contains(f) ; }
-
-}


Mime
View raw message