jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [46/51] [partial] jena git commit: Rename com.hp.hpl.jena.* as org.apache.jena.*
Date Thu, 23 Apr 2015 19:57:02 GMT
http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/query/ResultSetFormatter.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/query/ResultSetFormatter.java b/jena-arq/src/main/java/com/hp/hpl/jena/query/ResultSetFormatter.java
deleted file mode 100644
index 2049e23..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/query/ResultSetFormatter.java
+++ /dev/null
@@ -1,786 +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.query;
-
-import java.io.ByteArrayOutputStream ;
-import java.io.OutputStream ;
-import java.io.UnsupportedEncodingException ;
-import java.util.ArrayList ;
-import java.util.Iterator ;
-import java.util.List ;
-
-import org.apache.jena.atlas.logging.Log ;
-import org.apache.jena.riot.ResultSetMgr ;
-
-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.shared.PrefixMapping ;
-import com.hp.hpl.jena.sparql.ARQException ;
-import com.hp.hpl.jena.sparql.ARQNotImplemented ;
-import com.hp.hpl.jena.sparql.core.Prologue ;
-import com.hp.hpl.jena.sparql.core.Var ;
-import com.hp.hpl.jena.sparql.engine.binding.Binding ;
-import com.hp.hpl.jena.sparql.engine.binding.BindingOutputStream ;
-import com.hp.hpl.jena.sparql.engine.binding.BindingUtils ;
-import com.hp.hpl.jena.sparql.resultset.CSVOutput ;
-import com.hp.hpl.jena.sparql.resultset.JSONOutput ;
-import com.hp.hpl.jena.sparql.resultset.RDFOutput ;
-import com.hp.hpl.jena.sparql.resultset.ResultsFormat ;
-import com.hp.hpl.jena.sparql.resultset.TSVOutput ;
-import com.hp.hpl.jena.sparql.resultset.TextOutput ;
-import com.hp.hpl.jena.sparql.resultset.XMLOutput ;
-import com.hp.hpl.jena.sparql.resultset.XMLOutputASK ;
-import com.hp.hpl.jena.sparql.serializer.SerializationContext ;
-
-/** ResultSetFormatter - Convenience ways to call the various output formatters.
- *  in various formats.
- *  @see ResultSetMgr
- */
-
-public class ResultSetFormatter {
-    // See also ResultSetMgr -- this post-dates this code.
-    // Ideally, the operation here should call ResultSetMgr.
-    
-    private ResultSetFormatter() {}
-    /**
-     * Output a result set in a text format.  The result set is consumed.
-     * Use @see{ResultSetFactory.makeRewindable(ResultSet)} for a rewindable one.
-     * <p>
-     *  This caches the entire results in memory in order to determine the appropriate
-     *  column widths and therefore may exhaust memory for large results
-     *  </p>
-     * @param qresults   result set
-     */
-    public static void out(ResultSet qresults)
-    { out(System.out, qresults) ; }
-
-    /**
-     * Output a result set in a text format.  The result set is consumed.
-     * Use @see{ResultSetFactory.makeRewindable(ResultSet)} for a rewindable one.
-     * <p>
-     *  This caches the entire results in memory in order to determine the appropriate
-     *  column widths and therefore may exhaust memory for large results
-     *  </p>
-     * @param out        OutputStream
-     * @param qresults   result set
-     */
-    public static void out(OutputStream out, ResultSet qresults)
-    { out(out, qresults, (PrefixMapping)null) ; }
-    
-    /**
-     * Output a result set in a text format.  The result set is consumed.
-     * Use @see{ResultSetFactory.makeRewindable(ResultSet)} for a rewindable one.
-     * <p>
-     *  This caches the entire results in memory in order to determine the appropriate
-     *  column widths and therefore may exhaust memory for large results
-     *  </p>
-     * @param qresults   result set
-     * @param query     May be used to abbreviate URIs 
-     */
-    public static void out(ResultSet qresults, Query query)
-    { out(System.out, qresults, query) ; }
-    
-    /**
-     * Output a result set in a text format.  The result set is consumed.
-     * Use @see{ResultSetFactory.makeRewindable(ResultSet)} for a rewindable one.
-     * <p>
-     *  This caches the entire results in memory in order to determine the appropriate
-     *  column widths and therefore may exhaust memory for large results
-     *  </p>
-     * @param qresults   result set
-     * @param prologue   May be used to abbreviate URIs 
-     */
-    public static void out(ResultSet qresults, Prologue prologue)
-    { out(System.out, qresults, prologue) ; }
-
-    //    /**
-//     * Output a result set in a text format.
-//     * @param out        OutputStream
-//     * @param qresults   result set
-//     * @param query      May be used to abbreviate URIs 
-//     */
-//    public static void out(OutputStream out, ResultSet qresults, Query query)
-//    { out(out, qresults, query.getPrefixMapping()) ; }
-    
-    /**
-     * Output a result set in a text format.  The result set is consumed.
-     * Use @see{ResultSetFactory.makeRewindable(ResultSet)} for a rewindable one.
-     * <p>
-     *  This caches the entire results in memory in order to determine the appropriate
-     *  column widths and therefore may exhaust memory for large results
-     *  </p>
-     * @param qresults  result set
-     * @param pmap      Prefix mapping for abbreviating URIs.
-     */
-    public static void out(ResultSet qresults, PrefixMapping pmap)
-    { out(System.out, qresults, pmap) ; }
-
-    /**
-     * Output a result set in a text format.  The result set is consumed.
-     * Use @see{ResultSetFactory.makeRewindable(ResultSet)} for a rewindable one.
-     * <p>
-     *  This caches the entire results in memory in order to determine the appropriate
-     *  column widths and therefore may exhaust memory for large results
-     *  </p>
-     * @param out       OutputStream
-     * @param qresults  result set
-     * @param pmap      Prefix mapping for abbreviating URIs.
-     */
-    public static void out(OutputStream out, ResultSet qresults, PrefixMapping pmap)
-    {
-        TextOutput tFmt = new TextOutput(pmap) ;
-        tFmt.format(out, qresults) ;
-    }
-
-    /**
-     * Output a result set in a text format.  The result set is consumed.
-     * Use @see{ResultSetFactory.makeRewindable(ResultSet)} for a rewindable one.
-     * <p>
-     *  This caches the entire results in memory in order to determine the appropriate
-     *  column widths and therefore may exhaust memory for large results
-     *  </p>
-     * @param out       OutputStream
-     * @param qresults  result set
-     * @param prologue  Prologue, used to abbreviate IRIs
-     */
-    public static void out(OutputStream out, ResultSet qresults, Prologue prologue)
-    {
-        TextOutput tFmt = new TextOutput(prologue) ;
-        tFmt.format(out, qresults) ;
-    }
-
-
-    /**
-     * Output an ASK answer
-     * @param answer    The boolean answer
-     */
-    public static void out(boolean answer)
-    { out(System.out, answer) ; }
-
-    /**
-     * Output an ASK answer
-     * @param out       OutputStream
-     * @param answer    The boolean answer
-     */
-    public static void out(OutputStream out, boolean answer)
-    {
-        TextOutput tFmt = new TextOutput((SerializationContext)null) ;
-        tFmt.format(out, answer) ;
-    }
-    
-    /** Return a string that has the result set serialized as a text table
-     * <p>
-     *  This caches the entire results in memory in order to determine the appropriate
-     *  column widths and therefore may exhaust memory for large results
-     *  </p>
-     * 
-     * @param qresults  result set
-     * @return  string
-     */
-    
-    public static String asText(ResultSet qresults)
-    {
-        ByteArrayOutputStream arr = new ByteArrayOutputStream() ;
-        out(arr, qresults) ;
-        try { return new String(arr.toByteArray(), "UTF-8") ; }
-        catch (UnsupportedEncodingException e)
-        {
-            Log.warn(ResultSetFormatter.class, "UnsupportedEncodingException") ;
-            return null ;
-        }
-    }
-
-    /** Return a string that has the result set serialized as a text table
-     * <p>
-     *  This caches the entire results in memory in order to determine the appropriate
-     *  column widths and therefore may exhaust memory for large results
-     *  </p>
-     * 
-     * @param qresults  result set
-     * @param prologue  Prologue, used to abbreviate IRIs
-
-     * @return  string
-     */
-    
-    public static String asText(ResultSet qresults, Prologue prologue)
-    {
-        ByteArrayOutputStream arr = new ByteArrayOutputStream() ;
-        out(arr, qresults, prologue) ;
-        try { return new String(arr.toByteArray(), "UTF-8") ; }
-        catch (UnsupportedEncodingException e)
-        {
-            Log.warn(ResultSetFormatter.class, "UnsupportedEncodingException") ;
-            return null ;
-        }
-    }
-
-    // ----------------------------------------------------------------
-    // Do nothing formatting
-    
-    /** This operation faithfully walks the results but does nothing with them.
-     *  @return The count of the number of solutions. 
-     */
-
-    public static int consume(ResultSet resultSet)
-    {
-        int count = 0 ;
-        for ( ; resultSet.hasNext() ; )
-        {
-            // Force nodes to be materialized.
-            QuerySolution result = resultSet.nextSolution() ;
-            for ( Iterator<String> iter = result.varNames() ; iter.hasNext() ; )
-            {
-                String vn = iter.next();
-                RDFNode n = result.get(vn) ;
-            }
-            count++ ;
-        }
-        return count ;
-    }
-    
-
-    /**
-     * Turn the result set into a java.util.List
-     * @param resultSet   The result set
-     * @return            List of QuerySolutions
-     */
-    static public List<QuerySolution> toList(ResultSet resultSet)
-    {
-        List<QuerySolution> list = new ArrayList<>() ;
-        for ( ; resultSet.hasNext() ; )
-        {
-            QuerySolution result = 
-                resultSet.nextSolution() ;
-            list.add(result) ;
-        }
-        return list ;
-    }
-    
-    // ----------------------------------------------------------------
-    // As RDF
-    
-    /** Output a ResultSet in some format.
-     * 
-     * @param resultSet Result set
-     * @param rFmt      A format to encode the result set in
-     */
-    
-    static public void output(ResultSet resultSet, ResultsFormat rFmt)
-    { output(System.out, resultSet, rFmt) ; }
-
-    /** Output a ResultSet in some format.
-     *  To get detailed control over each format, call the appropropiate operation directly. 
-     * 
-     * @param outStream Output
-     * @param resultSet Result set
-     * @param rFmt      A format to encode the result set in
-     */
-    
-    static public void output(OutputStream outStream, ResultSet resultSet, ResultsFormat rFmt) {
-        if ( rFmt.equals(ResultsFormat.FMT_RS_XML) ) {
-            outputAsXML(outStream, resultSet) ;
-            return ;
-        }
-
-        if ( rFmt.equals(ResultsFormat.FMT_RS_JSON) ) {
-            outputAsJSON(outStream, resultSet) ;
-            return ;
-        }
-
-        if ( rFmt.equals(ResultsFormat.FMT_RS_CSV) ) {
-            outputAsCSV(outStream, resultSet) ;
-            return ;
-        }
-
-        if ( rFmt.equals(ResultsFormat.FMT_RS_TSV) ) {
-            outputAsTSV(outStream, resultSet) ;
-            return ;
-        }
-
-        if ( rFmt.equals(ResultsFormat.FMT_RS_BIO) ) {
-            outputAsBIO(outStream, resultSet) ;
-            return ;
-        }
-
-        if ( rFmt.equals(ResultsFormat.FMT_RDF_XML) ) {
-            RDFOutput.outputAsRDF(outStream, "RDF/XML-ABBREV", resultSet) ;
-            return ;
-        }
-
-        if ( rFmt.equals(ResultsFormat.FMT_RDF_TTL) ) {
-            RDFOutput.outputAsRDF(outStream, "TTL", resultSet) ;
-            return ;
-        }
-
-        if ( rFmt.equals(ResultsFormat.FMT_RDF_NT) ) {
-            RDFOutput.outputAsRDF(outStream, "N-TRIPLES", resultSet) ;
-            return ;
-        }
-        throw new ARQException("Unknown ResultSet format: " + rFmt) ;
-    }
-    
-    /** Write out an RDF model that encodes the result set
-     * 
-     * @param format        Name of RDF format (names as Jena writers) 
-     * @param resultSet     The result set to encode in RDF
-     * @deprecated Use {@link RDFOutput#outputAsRDF(String,ResultSet)} directly instead
-     */
-    @Deprecated
-    static public void outputAsRDF(String format, ResultSet resultSet) {
-        RDFOutput.outputAsRDF(format, resultSet) ;
-    }
-
-    /** Write out an RDF model that encodes the result set
-     * 
-     * @param outStream     Output
-     * @param format        Name of RDF format (names as Jena writers) 
-     * @param resultSet     The result set to encode in RDF
-     * @deprecated Use {@link RDFOutput#outputAsRDF(OutputStream,String,ResultSet)} instead
-     */
-    @Deprecated
-    static public void outputAsRDF(OutputStream outStream, String format, ResultSet resultSet) {
-        RDFOutput.outputAsRDF(outStream, format, resultSet) ;
-    }
-
-    /** Write out an RDF model that encodes a boolean result
-     * 
-     * @param format        Name of RDF format (names as Jena writers) 
-     * @param booleanResult The boolean result to encode in RDF
-     * @deprecated Use {@link RDFOutput#outputAsRDF(String,boolean)} directly instead
-     */
-    @Deprecated
-    static public void outputAsRDF(String format,  boolean booleanResult) {
-        RDFOutput.outputAsRDF(format, booleanResult) ;
-    }
-    
-    /** Write out an RDF model that encodes a boolean result
-     * 
-     * @param outStream     Output
-     * @param format        Name of RDF format (names as Jena writers) 
-     * @param booleanResult The boolean result to encode in RDF
-     * @deprecated Use {@link RDFOutput#outputAsRDF(OutputStream,String,boolean)} instead
-     */
-    @Deprecated
-    static public void outputAsRDF(OutputStream outStream, String format,  boolean booleanResult) {
-        RDFOutput.outputAsRDF(outStream, format, booleanResult) ;
-    }
-
-    // ---- XML Output
-
-    /** Output a result set in the XML format
-     * 
-     * @param qresults      result set
-     */
-    
-    static public void outputAsXML(ResultSet qresults)
-    { outputAsXML(System.out, qresults) ; }
-
-    /** Output a result set in the XML format
-     * 
-     * @param outStream     output stream
-     * @param qresults      result set
-     */
-    
-    static public void outputAsXML(OutputStream outStream, ResultSet qresults)
-    {
-        outputAsXML(outStream, qresults, (String)null) ;
-    }
-    
-    /** Output a result set in the XML format, inserting a style sheet in the XMl output
-     * 
-     * @param qresults      result set
-     * @param stylesheet    The URL of the stylsheet
-     */
-    
-    static public void outputAsXML(ResultSet qresults, String stylesheet)
-    { outputAsXML(System.out, qresults, stylesheet) ; }
-
-    /** Output a result set in the XML format, inserting a style sheet in the XMl output
-     * 
-     * @param outStream     output stream
-     * @param qresults      result set
-     * @param stylesheet    The URL of the stylsheet
-     */
-    
-    static public void outputAsXML(OutputStream outStream, ResultSet qresults, String stylesheet)
-    {
-        XMLOutput xOut = new XMLOutput(stylesheet) ;
-        xOut.format(outStream, qresults) ;
-    }
-    
-    // ----  XML output: ASK
-    
-    /** Output a boolean result in the XML format
-     * 
-     * @param booleanResult The boolean result to encode
-     */
-    
-    public static void outputAsXML(boolean booleanResult)
-    { outputAsXML(System.out, booleanResult) ; }
-    
-    /** Output a boolean result in the XML format
-     * 
-     * @param outStream     output stream
-     * @param booleanResult The boolean result to encode
-     */
-    
-    public static void outputAsXML(OutputStream outStream, boolean booleanResult)
-    {
-        outputAsXML(outStream, booleanResult, null) ;
-    }
-
-    /** Output a boolean result in the XML format
-     * 
-     * @param booleanResult 
-     * @param stylesheet    The URL of the stylesheet
-     */
-    public static void outputAsXML(boolean booleanResult, String stylesheet)
-    { outputAsXML(System.out, booleanResult, stylesheet) ; }
-
-    /** Output a boolean result in the XML format
-     * 
-     * @param outStream     output stream
-     * @param booleanResult 
-     * @param stylesheet    The URL of the stylesheet
-     */
-    
-    public static void outputAsXML(OutputStream outStream, boolean booleanResult, String stylesheet)
-    {
-        XMLOutputASK fmt = new XMLOutputASK(outStream, stylesheet) ;
-        fmt.exec(booleanResult) ;
-    }
-
-    /** Return a string that has the result set serialized as XML (not RDF)
-     * <p>
-     *  This builds the string in memory which can lead to memory exhaustion
-     *  for large results.  It is generally better to use the 
-     *  {@link #outputAsXML(OutputStream, ResultSet)} overload instead
-     *  </p>
-     * 
-     * @param qresults  result set
-     * @return  string
-     */
-    
-    public static String asXMLString(ResultSet qresults)
-    {
-        return asXMLString(qresults, null) ;
-    }
-    
-    /** Return a string that has the result set serialized as XML (not RDF)
-     *  with a style sheet directive inserted into the XML.
-     *  <p>
-     *  This builds the string in memory which can lead to memory exhaustion
-     *  for large results.  It is generally better to use the 
-     *  {@link #outputAsXML(OutputStream, ResultSet, String)} overload instead
-     *  </p>
-     * @param qresults  result set
-     * @param stylesheet
-     * @return  string
-     */
-    
-    public static String asXMLString(ResultSet qresults, String stylesheet)
-    {
-        XMLOutput xOut = new XMLOutput(stylesheet) ;
-        return xOut.asString(qresults) ;
-    }
-    
-    /** Return a string that has the result set serilized as XML (not RDF)
-     * <p>
-     *  This builds the string in memory which can lead to memory exhaustion
-     *  for large results.  It is generally better to use the 
-     *  {@link #outputAsXML(OutputStream, boolean)} overload instead
-     *  </p>
-     * 
-     * @param booleanResult The boolean result to encode
-     * @return  string
-     */
-    
-    public static String asXMLString(boolean booleanResult)
-    {
-        return asXMLString(booleanResult, null) ;
-    }
-
-    /** Return a string that has the result set serilized as XML (not RDF)
-     * <p>
-     *  This builds the string in memory which can lead to memory exhaustion
-     *  for large results.  It is generally better to use the 
-     *  {@link #outputAsXML(OutputStream, boolean, String)} overload instead
-     *  </p>
-     * 
-     * @param booleanResult The boolean result to encode
-     * @param stylesheet
-     * @return  string
-     */
-    
-    public static String asXMLString(boolean booleanResult, String stylesheet)
-    {
-        XMLOutput xOut = new XMLOutput(stylesheet) ;
-        return xOut.asString(booleanResult) ;
-    }
-    
-    // ---- JSON (and YAML)
-    
-    /** Output a result set in the JSON format
-     *  Format: <a href="http://www.w3.org/TR/rdf-sparql-json-res/">Serializing SPARQL Query Results in JSON</a> 
-     *  JSON: <a href="http://json.org">http://json.org/</a>
-     * @param resultSet     result set
-     */
-    
-    static public void outputAsJSON(ResultSet resultSet)
-    { outputAsJSON(System.out, resultSet) ; }
-    
-    /** Output a result set in the JSON format
-     *  Format: <a href="http://www.w3.org/TR/rdf-sparql-json-res/">Serializing SPARQL Query Results in JSON</a> 
-     *  JSON: <a href="http://json.org">http://json.org/</a>
-     *  
-     * @param outStream     output stream
-     * @param resultSet     result set
-     */
-    
-    static public void outputAsJSON(OutputStream outStream, ResultSet resultSet)
-    {
-        JSONOutput jOut = new JSONOutput() ;
-        jOut.format(outStream, resultSet) ; 
-    }
-
-    /** Output a result set in the JSON format
-     *  Format: <a href="http://www.w3.org/TR/rdf-sparql-json-res/">Serializing SPARQL Query Results in JSON</a> 
-     *  JSON: <a href="http://json.org">http://json.org/</a>
-     *  
-     * @param booleanResult The boolean result to encode
-     */
-
-    static public void outputAsJSON(boolean booleanResult)
-    { outputAsJSON(System.out, booleanResult ) ; }
-    
-    /** Output a result set in the JSON format
-     *  Format: <a href="http://www.w3.org/TR/rdf-sparql-json-res/">Serializing SPARQL Query Results in JSON</a> 
-     *  JSON: <a href="http://json.org">http://json.org/</a>
-     *  
-     * @param outStream     output stream
-     * @param booleanResult The boolean result to encode
-     */
-    
-    static public void outputAsJSON(OutputStream outStream, boolean booleanResult)
-    {
-        JSONOutput jOut = new JSONOutput() ;
-        jOut.format(outStream, booleanResult) ; 
-    }
-    
-    // ---- SSE
-    
-    /** Output a boolean result in the SSE format
-     *  Format: <a href="http://jena.apache.org/documentation/notes/sse.html">SSE</a> 
-     *  
-     * @param booleanResult The boolean result to encode
-     */
-    
-    static public void outputAsSSE(boolean booleanResult)
-    { outputAsSSE(System.out, booleanResult ) ; }
-    
-    /** Output a boolean result in the SSE format
-     *  Format: <a href="http://jena.apache.org/documentation/notes/sse.html">SSE</a> 
-     *  
-     * @param outStream     output stream
-     * @param booleanResult The boolean result to encode
-     */
-    
-    static public void outputAsSSE(OutputStream outStream, boolean booleanResult)
-    {
-        throw new ARQNotImplemented("outputAsSSE") ;
-    }
-
-    /** Output a result set in the SSE format
-     *  Format: <a href="http://jena.apache.org/documentation/notes/sse.html">SSE</a>
-     *  @param resultSet     result set
-     */
-    
-    static public void outputAsSSE(ResultSet resultSet)
-    { outputAsSSE(System.out, resultSet) ; }
-    
-    /** Output a result set in the SSE format
-     *  Format: <a href="http://jena.apache.org/documentation/notes/sse.html">SSE</a>
-     *  @param resultSet     result set
-     */
-    
-    static public void outputAsSSE(ResultSet resultSet, Prologue prologue)
-    { outputAsSSE(System.out, resultSet, prologue) ; }
-
-    /** Output a result set in the SSE format
-     *  Format: <a href="http://jena.apache.org/documentation/notes/sse.html">SSE</a>
-     * @param outStream  The output stream
-     * @param resultSet     The result set
-     */
-    
-    static public void outputAsSSE(OutputStream outStream, ResultSet resultSet)
-    { outputAsSSE(outStream, resultSet, null) ; }
-    
-    /** Output a result set in the SSE format
-     *  Format: <a href="http://jena.apache.org/documentation/notes/sse.html">SSE</a>
-     * @param outStream     output stream
-     * @param resultSet     result set
-     * @param prologue
-     */
-    
-    static public void outputAsSSE(OutputStream outStream, ResultSet resultSet, Prologue prologue)
-    {
-        throw new ARQNotImplemented("outputAsSSE") ;
-    }
-    
-    // ---- CSV
-    
-    /** Output a boolean result in CSV format
-     *  
-     * @param booleanResult The boolean result to encode
-     */
-    
-    static public void outputAsCSV(boolean booleanResult)
-    { outputAsCSV(System.out, booleanResult ) ; }
-    
-    /** Output a boolean result in in CSV format
-     *  
-     * @param outStream     output stream
-     * @param booleanResult The boolean result to encode
-     */
-    
-    static public void outputAsCSV(OutputStream outStream, boolean booleanResult)
-    {
-        CSVOutput fmt = new CSVOutput() ;
-        fmt.format(outStream, booleanResult) ;
-    }
-
-    /** Output a result set in CSV format
-     *  @param resultSet     result set
-     */
-    
-    static public void outputAsCSV(ResultSet resultSet)
-    { outputAsCSV(System.out, resultSet) ; }
-    
-    /** Output a result set in CSV format
-     * @param outStream  The output stream
-     * @param resultSet     The result set
-     */
-    
-    static public void outputAsCSV(OutputStream outStream, ResultSet resultSet)
-    {
-        CSVOutput fmt = new CSVOutput() ;
-        fmt.format(outStream, resultSet) ;
-    }
-
-    // ---- TSV
-    
-    /** Output a boolean result in TSV (tab separated values) format
-     *  
-     * @param booleanResult The boolean result to encode
-     */
-    
-    static public void outputAsTSV(boolean booleanResult)
-    { outputAsTSV(System.out, booleanResult ) ; }
-    
-    /** Output a boolean result in in TSV format
-     *  
-     * @param outStream     output stream
-     * @param booleanResult The boolean result to encode
-     */
-    
-    static public void outputAsTSV(OutputStream outStream, boolean booleanResult)
-    {
-        TSVOutput fmt = new TSVOutput() ;
-        fmt.format(outStream, booleanResult) ;
-    }
-
-    /** Output a result set in TSV format
-     *  @param resultSet     result set
-     */
-    
-    static public void outputAsTSV(ResultSet resultSet)
-    { outputAsTSV(System.out, resultSet) ; }
-    
-    /** Output a result set in TSV format
-     * @param outStream  The output stream
-     * @param resultSet     The result set
-     */
-    
-    static public void outputAsTSV(OutputStream outStream, ResultSet resultSet)
-    {
-        TSVOutput fmt = new TSVOutput() ;
-        fmt.format(outStream, resultSet) ;
-    }
-    
-    /** Output a result set in BIO format */
-    public static void outputAsBIO(OutputStream out, ResultSet results)
-    {
-        List<Var> vars = Var.varList(results.getResultVars()) ;
-        
-        BindingOutputStream bout = new BindingOutputStream(out, vars) ;
-        for ( ; results.hasNext() ; )
-        {
-            Binding b = BindingUtils.asBinding(results.next()) ;
-            bout.write(b) ;
-        }
-        bout.flush() ;
-    }
-    // ----------------------------------------------------------------
-    // As RDF
-    
-    /** Encode the result set as RDF.
-     * @param  resultSet
-     * @return Model       Model contains the results
-     * @deprecated Use {@link RDFOutput#encodeAsModel(ResultSet)} instead
-     */
-    @Deprecated
-    static public Model toModel(ResultSet resultSet) {
-        return RDFOutput.encodeAsModel(resultSet) ;
-    }
-    /**
-     * Encode a boolean result set as RDF. 
-     * @param booleanResult
-     * @return Model       Model contains the results
-     * @deprecated Use {@link RDFOutput#encodeAsModel(boolean)} instead
-     */
-    @Deprecated
-    public static Model toModel(boolean booleanResult) {
-        return RDFOutput.encodeAsModel(booleanResult) ;
-    }
-    /** Encode the result set as RDF in the model provided.
-     *  
-     * @param  model     The place where to put the RDF.
-     * @param  resultSet
-     * @return Resource  The resource for the result set.
-     * @deprecated Use {@link RDFOutput#encodeAsRDF(Model,ResultSet)} directly instead
-     */ 
-    @Deprecated
-    static public Resource asRDF(Model model, ResultSet resultSet) {
-        return RDFOutput.encodeAsRDF(model, resultSet) ;
-    }
-    /** Encode the boolean as RDF in the model provided.
-     *  
-     * @param  model     The place where to put the RDF.
-     * @param  booleanResult
-     * @return Resource  The resource for the result set.
-     * @deprecated Use {@link RDFOutput#encodeAsRDF(Model,boolean)} directly instead
-     */ 
-    @Deprecated
-    static public Resource asRDF(Model model, boolean booleanResult) {
-        return RDFOutput.encodeAsRDF(model, booleanResult) ;
-    }
-
-    
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/query/ResultSetRewindable.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/query/ResultSetRewindable.java b/jena-arq/src/main/java/com/hp/hpl/jena/query/ResultSetRewindable.java
deleted file mode 100644
index 2838bcf..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/query/ResultSetRewindable.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.query;
-
-public interface ResultSetRewindable extends ResultSet
-{
-    /** Move back to the start of the iterator for this instance of results of a query. */
-    public void reset() ;
-    
-    /** return the number of solutions */ 
-    public int size() ;
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/query/SortCondition.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/query/SortCondition.java b/jena-arq/src/main/java/com/hp/hpl/jena/query/SortCondition.java
deleted file mode 100644
index d3a32cb..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/query/SortCondition.java
+++ /dev/null
@@ -1,156 +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.query;
-
-import org.apache.jena.atlas.io.IndentedWriter ;
-import org.apache.jena.atlas.lib.Lib ;
-import org.apache.jena.atlas.logging.Log ;
-
-import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.sparql.core.Var ;
-import com.hp.hpl.jena.sparql.engine.Plan ;
-import com.hp.hpl.jena.sparql.expr.E_Function ;
-import com.hp.hpl.jena.sparql.expr.Expr ;
-import com.hp.hpl.jena.sparql.expr.ExprVar ;
-import com.hp.hpl.jena.sparql.serializer.FmtExprSPARQL ;
-import com.hp.hpl.jena.sparql.serializer.SerializationContext ;
-import com.hp.hpl.jena.sparql.util.ExprUtils ;
-import com.hp.hpl.jena.sparql.util.PrintSerializableBase ;
-
-
-public class SortCondition extends PrintSerializableBase
-{
-    public Expr expression = null ;
-    public int direction = 0 ;
-
-    public SortCondition(Var var, int dir)
-    { this(new ExprVar(var),dir) ; } 
-  
-    public SortCondition(Node var, int dir)
-    { this(ExprUtils.nodeToExpr(var), dir) ; }
-
-    public SortCondition(Expr expr, int dir)
-    {
-        expression = expr ;
-        direction = dir ;
-        
-        if ( dir != Query.ORDER_ASCENDING && dir != Query.ORDER_DESCENDING && dir != Query.ORDER_DEFAULT )
-            Log.fatal(this, "Unknown sort direction") ;
-    }
-    
-    public void format(FmtExprSPARQL fmt,
-                       IndentedWriter writer)
-    {
-        boolean explicitDirection = false ;
-        // Not always necessary but safe.
-        // At this point there must be brackets but some forms (e.g. ?x+?y)
-        // are going to put their own brackets in regardless.
-        boolean needParens = false ;
-        
-        if ( direction != Query.ORDER_DEFAULT )
-        {
-            // Need parens if the expression isn't going to add them anyway.
-            if ( expression.isVariable() || expression instanceof E_Function )
-                // Bracketless by expression formatting
-                needParens = true ;
-        }
-        
-        if ( direction == Query.ORDER_ASCENDING )
-        {
-            writer.print("ASC") ;
-            needParens = true ;
-        }
-        
-        if ( direction == Query.ORDER_DESCENDING )
-        {
-            writer.print("DESC") ;
-            needParens = true ;
-        }
-        
-        if ( needParens )
-            writer.print("(") ;
-        
-        fmt.format(expression) ;
-        
-        if ( needParens )
-            writer.print(")") ;
-    }
-
-    /** @return Returns the direction. */
-    public int getDirection()
-    {
-        return direction ;
-    }
-
-    /** @return Returns the expression. */
-    public Expr getExpression()
-    {
-        return expression ;
-    }
-
-    @Override
-    public int hashCode()
-    { 
-        int x = this.getDirection() ;
-        if ( getExpression() != null )
-            x ^= getExpression().hashCode() ;
-        return x ;
-    }
-    
-    @Override
-    public boolean equals(Object other)
-    {
-        if ( this == other ) return true ;
-
-        if ( ! ( other instanceof SortCondition ) )
-            return false ;
-        
-        SortCondition sc = (SortCondition)other ;
-        
-        if ( sc.getDirection() != this.getDirection() )
-            return false ;
-        
-        if ( ! Lib.equal(this.getExpression(), sc.getExpression()) )
-            return false ;
-        
-//        if ( ! Utils.eq(this.getVariable(), sc.getVariable()) )
-//            return false ;
-        
-        return true ;
-    }
-
-    @Override
-    public void output(IndentedWriter out)
-    { 
-        out.print(Plan.startMarker) ;
-        out.print("SortCondition ") ;
-        FmtExprSPARQL fmt = new FmtExprSPARQL(out, null) ;
-        format(fmt, out) ;
-        out.print(Plan.finishMarker) ;
-    }
-    
-    @Override
-    public void output(IndentedWriter out, SerializationContext sCxt)
-    {
-        if ( sCxt == null )
-            sCxt = new SerializationContext() ;
-        FmtExprSPARQL fmt = new FmtExprSPARQL(out, sCxt) ;
-        format(fmt, out) ;
-    }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/query/Syntax.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/query/Syntax.java b/jena-arq/src/main/java/com/hp/hpl/jena/query/Syntax.java
deleted file mode 100644
index e7e99a2..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/query/Syntax.java
+++ /dev/null
@@ -1,170 +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.query;
-
-import com.hp.hpl.jena.sparql.util.Symbol ;
-import com.hp.hpl.jena.sparql.util.TranslationTable ;
-
-/** Symbols for query language syntaxes */
-
-public class Syntax extends Symbol
-{
-    /** The syntax that the DAWG working group defined */
-    public static final Syntax syntaxSPARQL_10
-                = new Syntax("http://jena.hpl.hp.com/2003/07/query/SPARQL_10") ;
-
-    /** The syntax that the SPARQL working group has defined */
-    public static final Syntax syntaxSPARQL_11
-                = new Syntax("http://jena.hpl.hp.com/2003/07/query/SPARQL_11") ;
-    
-//    /** The update syntax that the SPARQL working group has defined */
-//    private static final Syntax syntaxSPARQL_11_Update
-//                = syntaxSPARQL_11 ;
-//                //= new Syntax("http://jena.hpl.hp.com/2003/07/update/SPARQL_11") ;
-
-    /** The query syntax for extended SPARQL */ 
-    public static final Syntax syntaxARQ
-                = new Syntax("http://jena.hpl.hp.com/2003/07/query/ARQ") ;
-
-//    /** The update syntax for SPARQL Update, with extensions to help migrate the update language in the W3C submission */  
-//    private static final Syntax syntaxARQ_Update
-//                = syntaxARQ ;
-//                //= new Syntax("http://jena.hpl.hp.com/2003/07/update/ARQ") ;
-    
-    public static final Syntax syntaxAlgebra
-                = new Syntax("http://jena.hpl.hp.com/2003/07/query/SPARQL_Algebra") ;
-    
-    /** The system default syntax */ 
-    public static Syntax defaultSyntax = syntaxSPARQL_11 ;
-    
-    /** The name of the default query language for query parsing.
-     *  The default query language syntax must be capable of accepting
-     *  any SPARQL query but may also accept extensions. 
-     */
-    public static Syntax defaultQuerySyntax = syntaxSPARQL_11 ;
-    
-    /** The name of the default update language for update parsing.
-     *  The default update language syntax must be capable of accepting
-     *  any SPARQL query but may also accept extensions. 
-     */
-    public static Syntax defaultUpdateSyntax = syntaxSPARQL_11 ;
-    
-    /** The query syntax currently that is standardized, published, SPARQL - the "default SPARQL Query" */ 
-    public static final Syntax syntaxSPARQL = syntaxSPARQL_11 ;
-
-//    /** The update syntax currently that is standardized, published, SPARQL - the "default SPARQL Update" */ 
-//    private static final Syntax syntaxSPARQL_Update = syntaxSPARQL_11_Update ;
-
-    public static TranslationTable<Syntax> querySyntaxNames = new TranslationTable<>(true) ;
-    static {
-        querySyntaxNames.put("sparql",      syntaxSPARQL) ;
-        querySyntaxNames.put("sparql10",   syntaxSPARQL_10) ;
-        querySyntaxNames.put("sparql_10",   syntaxSPARQL_10) ;
-        querySyntaxNames.put("sparql11",   syntaxSPARQL_11) ;
-        querySyntaxNames.put("sparql_11",   syntaxSPARQL_11) ;
-        querySyntaxNames.put("arq",         syntaxARQ) ;
-        querySyntaxNames.put("alg",         syntaxAlgebra) ;
-        querySyntaxNames.put("op",          syntaxAlgebra) ;
-    }
-
-    public static TranslationTable<Syntax> updateSyntaxNames = new TranslationTable<>(true) ;
-    static {
-        querySyntaxNames.put("sparql",      syntaxSPARQL) ;
-        querySyntaxNames.put("sparql_11",   syntaxSPARQL_11) ;
-        querySyntaxNames.put("arq",         syntaxARQ) ;
-    }
-
-    protected Syntax(String s) { super(s) ; }
-	protected Syntax(Syntax s) { super(s) ; }
-    
-    public static Syntax make(String uri)
-    {
-        if ( uri == null )
-            return null ;
-        
-        Symbol sym = Symbol.create(uri) ;
-        
-        if ( sym.equals(syntaxARQ) )         return syntaxARQ ;
-        
-        if ( sym.equals(syntaxSPARQL) )      return syntaxSPARQL ;
-        if ( sym.equals(syntaxSPARQL_10) )   return syntaxSPARQL_10 ;
-        if ( sym.equals(syntaxSPARQL_11) )   return syntaxSPARQL_11 ;
-        if ( sym.equals(syntaxAlgebra) )     return syntaxAlgebra ;
-        return null ;
-    }
-    
-    
-    public static Syntax guessFileSyntax(String url) 
-    {
-        return guessFileSyntax(url, syntaxSPARQL) ;
-    }
-
-    /** Gues the synatx (query and update) based on filename */
-    public static Syntax guessFileSyntax(String url, Syntax defaultSyntax)
-    {
-        if ( url.endsWith(".arq") )     return syntaxARQ ;
-        if ( url.endsWith(".rq") )      return syntaxSPARQL ;
-
-        if ( url.endsWith(".aru") )     return syntaxARQ ;
-        if ( url.endsWith(".ru") )      return syntaxSPARQL_11 ;
-        
-        if ( url.endsWith(".sse") )     return syntaxAlgebra ;
-        
-        // Default
-        return defaultSyntax ;
-    }
-    
-    /** Guess the query syntax based on file name */
-    public static Syntax guessQueryFileSyntax(String url) 
-    {
-        return guessFileSyntax(url, defaultQuerySyntax) ;
-    }
-    
-
-    /** Guess the query syntax based on file name */
-    public static Syntax guessQueryFileSyntax(String url, Syntax defaultSyntax)
-    {
-        if ( url.endsWith(".arq") )     return syntaxARQ ;
-        if ( url.endsWith(".rq") )      return syntaxSPARQL ;
-        if ( url.endsWith(".sse") )     return syntaxAlgebra ;
-        return defaultSyntax ;
-    }
-
-    /** Guess the update syntax based on file name */
-    public static Syntax guessUpdateFileSyntax(String url)
-    {
-        return guessUpdateFileSyntax(url, defaultUpdateSyntax) ;
-    }
-
-    
-    /** Guess the update syntax based on file name */
-    public static Syntax guessUpdateFileSyntax(String url, Syntax defaultSyntax)
-    {
-        if ( url.endsWith(".aru") )     return syntaxARQ ;
-        if ( url.endsWith(".ru") )      return syntaxSPARQL_11 ;
-        if ( url.endsWith(".sse") )     return syntaxAlgebra ;
-        return defaultSyntax ;
-    }
-    
-    
-    public static Syntax lookup(String s)
-    {
-        return querySyntaxNames.lookup(s) ;
-    }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/query/package.html
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/query/package.html b/jena-arq/src/main/java/com/hp/hpl/jena/query/package.html
deleted file mode 100644
index 0b7b632..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/query/package.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
-<head>
-</head>
-<body>
-ARQ - A query engine for Jena, implementing SPARQL.
-<p>
-ARQ is an implementation of SPARQL, an RDF query language defined
-by W3C.
-</p>
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/ARQConstants.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/ARQConstants.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/ARQConstants.java
deleted file mode 100644
index d1a30ae..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/ARQConstants.java
+++ /dev/null
@@ -1,267 +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;
-
-import com.hp.hpl.jena.datatypes.xsd.XSDDatatype ;
-import com.hp.hpl.jena.query.ARQ ;
-import com.hp.hpl.jena.shared.PrefixMapping ;
-import com.hp.hpl.jena.shared.impl.PrefixMappingImpl ;
-import com.hp.hpl.jena.sparql.util.Symbol ;
-import com.hp.hpl.jena.vocabulary.OWL ;
-import com.hp.hpl.jena.vocabulary.RDF ;
-import com.hp.hpl.jena.vocabulary.RDFS ;
-
-/**
- * Internal constants - configuration is in class ARQ */
-public class ARQConstants
-{
-    /** The prefix of XQuery/Xpath functions and operator */
-    public static final String fnPrefix = "http://www.w3.org/2005/xpath-functions#" ;
-    
-    /** RDF namespace prefix */
-    public static final String rdfPrefix = RDF.getURI() ;
-
-    /** RDFS namespace prefix */
-    public static final String rdfsPrefix = RDFS.getURI() ;
-
-    /** OWL namespace prefix */
-    public static final String owlPrefix = OWL.getURI() ;
-    
-    /** XSD namespace prefix */
-    public static final String xsdPrefix = XSDDatatype.XSD+"#" ;
-    
-    /** The prefix of SPARQL functions and operator */
-    public static final String fnSparql = "http://www.w3.org/ns/sparql#" ;
-    
-    /** The namespace of the XML results format */ 
-    public static final String srxPrefix = "http://www.w3.org/2005/sparql-results#" ;
-    
-    /** XML namespace */
-    public static final String XML_NS = "http://www.w3.org/XML/1998/namespace" ; 
-    
-    /** XML Schema namespace */
-    public static final String XML_SCHEMA_NS = "http://www.w3.org/2001/XMLSchema#" ;
-    
-    public static final String javaClassURIScheme = "java:" ;
-    
-    /** The ARQ function library URI space */
-    public static final String ARQFunctionLibraryURI = "http://jena.hpl.hp.com/ARQ/function#" ;
-    
-    /** The ARQ property function library URI space */
-    public static final String ARQPropertyFunctionLibraryURI = "http://jena.hpl.hp.com/ARQ/property#" ;
-    
-    /** The ARQ procedure library URI space */
-    public static final String ARQProcedureLibraryURI = "http://jena.hpl.hp.com/ARQ/procedure#" ;
-    
-    /** The ARQ function library */
-    public static final String ARQFunctionLibrary = javaClassURIScheme+"com.hp.hpl.jena.sparql.function.library." ;
-    
-    /** The ARQ property function library */
-    public static final String ARQPropertyFunctionLibrary = javaClassURIScheme+"com.hp.hpl.jena.sparql.pfunction.library." ;
-
-    /** The ARQ property function library */
-    public static final String ARQProcedureLibrary = javaClassURIScheme+"com.hp.hpl.jena.sparql.procedure.library." ;
-
-    /** Common prefixes */
-    protected static final PrefixMapping globalPrefixMap = new PrefixMappingImpl() ;
-    static {
-        //globalPrefixMap.setNsPrefixes(PrefixMapping.Standard) ;
-        globalPrefixMap.setNsPrefix("rdf",  rdfPrefix) ;
-        globalPrefixMap.setNsPrefix("rdfs", rdfsPrefix) ;
-        globalPrefixMap.setNsPrefix("xsd",  xsdPrefix) ;
-        globalPrefixMap.setNsPrefix("owl" , owlPrefix) ;
-        globalPrefixMap.setNsPrefix("fn" ,  fnPrefix) ; 
-        globalPrefixMap.setNsPrefix("afn",  ARQFunctionLibraryURI) ;
-        globalPrefixMap.setNsPrefix("apf",  ARQPropertyFunctionLibraryURI) ;
-    }
-    public static PrefixMapping getGlobalPrefixMap() { return globalPrefixMap ; }
-    
-    public static Symbol allocSymbol(String shortName)
-    { 
-        if ( shortName.startsWith(ARQ.arqSymbolPrefix)) 
-            throw new ARQInternalErrorException("Symbol short name begins with the ARQ namespace prefix: "+shortName) ;
-        if ( shortName.startsWith("http:")) 
-            throw new ARQInternalErrorException("Symbol short name begins with http: "+shortName) ;
-        return allocSymbol(ARQ.arqParamNS, shortName) ;
-    }
-    
-    public static Symbol allocSymbol(String base, String shortName)
-    {
-        return Symbol.create(base+shortName) ;
-    }
-
-    /* Variable names and allocated variables.
-     * NB Must agree with the variable parsing rules in SSE 
-     * Allocated variables use names that are not legal in SPARQL.
-     * Examples include the "?" variable initial character.
-     * 
-     * We need to allocate so clashes never occur within scopes.
-     * Distinguished (named variables) and non-distinguished (anon variables, bNodes) 
-     * 
-     * SSE also allows some convenience forms of exactly these string:
-     *  
-     * See: ParseHandlerPlain.emitVar
-     * 
-     * Naming:
-     *   Named (distinguished) allocated variables start "?."
-     *   Non-Distinguished, allocated variables start "??"
-     *   Quad transform hidden vars: "?*"
-     * 
-     * Scopes and usages:
-     *   Global:        
-     *      allocVarMarker          "?.."
-     *   VarAlloc.getVarAllocator 
-     *   
-     *   Query:     Expressions and aggregates 
-     *   Parser:    Used in turning blank nodes into variables in query patterns
-     *              Via LabelToNodeMap ("??")
-     *   Algebra Generator:
-     *              PathCompiler ("??P")    : Non-distinguished variables.
-     *              
-     *   SSE 
-     *      "?"     short hand for "some variable" using ?0, ?1, ?2 naming (legal SPARQL names)
-     *      "??"    short hand for "some new anon variable"
-     *      "?."    short hand for "some new named variable"
-     *      
-     *  See also sysVarAllocNamed and sysVarAllocAnon for symbols to identify in a context. 
-     */
-    
-    /** Marker for generated variables for non-distinguished in query patterns (??a etc) */
-    public static final String allocVarAnonMarker = "?" ;
-    
-    /** Marker for general temporary variables (not blank node variables) */
-    public static final String allocVarMarker = "." ;
-    
-    // Secondary marker for globally allocated variables. 
-    private static final String globalVar =     "." ;
-    
-    /** Marker for variables replacing blank nodes in SPARQL Update patterns */
-    public static final String allocVarBNodeToVar =  "~" ;
-
-    /** Marker for variables renamed to make variables hidden by scope have globally unique names */
-    public static final String allocVarScopeHiding =  "/" ;
-
-    /** Marker for variables renamed to make variables hidden because of quad transformation */
-    public static final String allocVarQuad =  "*g" ;
-
-    // Spare primary marker.
-    //private static final String executionVar =  "@" ;
-    
-    // These strings are without the leading "?"
-
-    // Put each constant here and not in the place the variable allocator created.
-    // Alwats 0, 1, 2, 3 after these prefixes. 
-    
-    public static final String allocGlobalVarMarker     = allocVarMarker+globalVar ;    // VarAlloc
-    public static final String allocPathVariables       = allocVarAnonMarker+"P" ;      // PathCompiler
-    public static final String allocQueryVariables      = allocVarMarker ;              // Query
-    public static final String allocParserAnonVars      = allocVarAnonMarker ;          // LabelToModeMap
-    
-    // SSE
-    public static final String allocSSEUnamedVars       = "_" ;                         // ParseHandlerPlain - SSE token "?" - legal SPARQL
-    public static final String allocSSEAnonVars         = allocVarAnonMarker ;          // ParseHandlerPlain - SSE token "??"
-    public static final String allocSSENamedVars        = allocVarMarker ;              // ParseHandlerPlain - SSE token "?."
-    
-    /** Marker for system symbols */
-    public static final String systemVarNS = "http://jena.hpl.hp.com/ARQ/system#" ;
-    
-    /** Context key for the query for the current query execution 
-     * (may be null if was not created from a query string )
-     */
-    public static final Symbol sysCurrentQuery          = Symbol.create(systemVarNS+"query") ;
-
-    /** Context key for the OpExecutor to be used */
-    public static final Symbol sysOpExecutorFactory     = Symbol.create(systemVarNS+"opExecutorFactory") ;
-
-    /** Context key for the optimizer factory to be used */
-    public static final Symbol sysOptimizerFactory      = Symbol.create(systemVarNS+"optimizerFactory") ;
-    
-    /** Context key for the optimizer used in this execution */
-    public static final Symbol sysOptimizer             = Symbol.create(systemVarNS+"optimizer") ;
-
-    /** Context key for the dataset for the current query execution. */
-    public static final Symbol sysCurrentDataset        = Symbol.create(systemVarNS+"dataset") ;
-
-    /** Context key for the dataset description (if any).
-     *  See the <a href="http://www.w3.org/TR/sparql11-protocol">SPARQL protocol</a>.
-     *  <p> 
-     *  A dataset description specified outside the query should override a dataset description
-     *  in query and also the implicit dataset of a service. The order is:
-     *  <ol>
-     *  <li>Dataset description from the protocol</li>
-     *  <li>Dataset description from the query (FROM/FROM NAMED)</li>
-     *  <li>Dataset of the service</li>
-     *  </ol>
-     *  Use in other situations should reflect this design. 
-     *  The value of this key in a Context must be an object of type DatasetDescription. 
-     */  
-    public static final Symbol sysDatasetDescription    = Symbol.create(systemVarNS+"datasetDescription") ;
-
-    /** Context key for the algebra expression of the query execution after optimization */
-    public static final Symbol sysCurrentAlgebra        = Symbol.create(systemVarNS+"algebra") ;
-
-//    /** Context key for the algebra execution engine of the query execution */
-//    public static final Symbol sysCurrentOpExec   = Symbol.create(systemVarNS+"opExec") ;
-
-    /** Context key for the current time of query execution */
-    public static final Symbol sysCurrentTime           = Symbol.create(systemVarNS+"now") ;
-    
-    /** Context key for ARQ version */
-    public static final Symbol sysVersionARQ            = Symbol.create(systemVarNS+"version/ARQ") ;
-    
-    /** Context key for Jena version */
-    public static final Symbol sysVersionJena           = Symbol.create(systemVarNS+"version/Jena") ;
-
-    /** Context key for the execution-scoped named variable generator */
-    public static final Symbol sysVarAllocNamed         = Symbol.create(systemVarNS+"namedVarAlloc") ;
-    
-    /** Context key for the execution-scoped bNode variable generator */
-    public static final Symbol sysVarAllocAnon          = Symbol.create(systemVarNS+"namedVarAnon") ;
-    
-    /** Graphs forming the default graph (List&lt;String&gt;) (Dynamic dataset) */
-    public static final Symbol symDatasetDefaultGraphs     = allocSymbol("datasetDefaultGraphs") ;
-    
-    /** Graphs forming the named graphs (List&lt;String&gt;) (Dynamic dataset) */
-    public static final Symbol symDatasetNamedGraphs       = allocSymbol("datasetNamedGraphs") ;
-    
-    /** Context key for making all SELECT queries have DISTINCT applied, whether stated ot not */
-    public static final Symbol autoDistinct             = ARQConstants.allocSymbol("autoDistinct") ;
-    
-    // Context keys : some here, some in ARQ - sort out
-    
-    /** The property function registry key */
-    public static final Symbol registryPropertyFunctions =
-        ARQConstants.allocSymbol("registryPropertyFunctions") ;
-    
-    /** The describe handler registry key */
-    public static final Symbol registryDescribeHandlers =
-        ARQConstants.allocSymbol("registryDescribeHandlers") ;
-
-    /** The function library registry key */
-    public static final Symbol registryFunctions =
-        ARQConstants.allocSymbol("registryFunctions") ;
-    
-    /** The function library registry key */
-    public static final Symbol registryProcedures =
-        ARQConstants.allocSymbol("registryProcedures") ;
-    
-    /** The extension library registry key */
-    public static final Symbol registryExtensions =
-        ARQConstants.allocSymbol("registryExtensions") ;
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/ARQException.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/ARQException.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/ARQException.java
deleted file mode 100644
index 25fd70f..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/ARQException.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.
- */
-
-/** Hopefully, you won't see this! */
-
-package com.hp.hpl.jena.sparql;
-
-import com.hp.hpl.jena.shared.JenaException ;
-
-public class ARQException extends JenaException
-{
-    public ARQException(String msg, Throwable cause)    { super(msg, cause) ; }
-    public ARQException(String msg)                     { super(msg) ; }
-    public ARQException(Throwable cause)                { super(cause) ; }
-    public ARQException()                               { super() ; }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/ARQInternalErrorException.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/ARQInternalErrorException.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/ARQInternalErrorException.java
deleted file mode 100644
index a7df2fc..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/ARQInternalErrorException.java
+++ /dev/null
@@ -1,33 +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.
- */
-
-/** Hopefully, you won't see this! */
-
-package com.hp.hpl.jena.sparql;
-
-import com.hp.hpl.jena.query.QueryFatalException ;
-
-public class ARQInternalErrorException extends QueryFatalException
-{
-    public ARQInternalErrorException(Throwable cause) { super(cause) ; }
-    public ARQInternalErrorException() { super() ; }
-    public ARQInternalErrorException (String msg) { super(msg) ; }
-    public ARQInternalErrorException (String msg, Throwable cause) { super(msg, cause) ; }
-
-    private static final long serialVersionUID = 1L; // Unused
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/ARQNotImplemented.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/ARQNotImplemented.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/ARQNotImplemented.java
deleted file mode 100644
index cdb0bcf..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/ARQNotImplemented.java
+++ /dev/null
@@ -1,39 +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.
- */
-
-/** Hopefully, you won't see this! */
-
-package com.hp.hpl.jena.sparql;
-
-import com.hp.hpl.jena.query.QueryFatalException ;
-
-public class ARQNotImplemented extends QueryFatalException
-{
-    public ARQNotImplemented(Throwable cause) { super(cause) ; }
-    public ARQNotImplemented() { super() ; }
-    public ARQNotImplemented (String msg) { super(msg) ; }
-    public ARQNotImplemented (String msg, Throwable cause) { super(msg, cause) ; }
-    
-    @Override
-    public String toString()
-    {
-        if ( super.getMessage() != null ) 
-            return "Not implemented: "+super.getMessage() ;
-        return "Not implemented" ;
-    }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/AlreadyExists.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/AlreadyExists.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/AlreadyExists.java
deleted file mode 100644
index f06fb3b..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/AlreadyExists.java
+++ /dev/null
@@ -1,29 +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;
-
-import com.hp.hpl.jena.shared.JenaException ;
-
-public class AlreadyExists extends JenaException
-{
-    public AlreadyExists() { super() ; }
-    public AlreadyExists(Throwable cause) { super(cause) ; }
-    public AlreadyExists(String msg) { super(msg) ; }
-    public AlreadyExists(String msg, Throwable cause) { super(msg, cause) ; }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/DoesNotExist.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/DoesNotExist.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/DoesNotExist.java
deleted file mode 100644
index cb3a282..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/DoesNotExist.java
+++ /dev/null
@@ -1,29 +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;
-
-import com.hp.hpl.jena.shared.JenaException ;
-
-public class DoesNotExist extends JenaException
-{
-    public DoesNotExist() { super() ; }
-    public DoesNotExist(Throwable cause) { super(cause) ; }
-    public DoesNotExist(String msg) { super(msg) ; }
-    public DoesNotExist(String msg, Throwable cause) { super(msg, cause) ; }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/JenaTransactionException.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/JenaTransactionException.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/JenaTransactionException.java
deleted file mode 100644
index c4e6a43..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/JenaTransactionException.java
+++ /dev/null
@@ -1,29 +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;
-
-import com.hp.hpl.jena.shared.JenaException ;
-
-public class JenaTransactionException extends JenaException
-{
-    public JenaTransactionException()                                  { super(); }
-    public JenaTransactionException(String message)                    { super(message); }
-    public JenaTransactionException(Throwable cause)                   { super(cause) ; }
-    public JenaTransactionException(String message, Throwable cause)   { super(message, cause) ; }
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/SystemARQ.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/SystemARQ.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/SystemARQ.java
deleted file mode 100644
index 41424ba..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/SystemARQ.java
+++ /dev/null
@@ -1,160 +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;
-
-import java.util.ArrayList ;
-import java.util.Iterator ;
-import java.util.List ;
-
-import org.apache.jena.atlas.iterator.Iter ;
-import org.apache.jena.atlas.lib.Sync ;
-
-import com.hp.hpl.jena.graph.Graph ;
-import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.graph.compose.Polyadic ;
-import com.hp.hpl.jena.query.Dataset ;
-import com.hp.hpl.jena.rdf.model.Model ;
-import com.hp.hpl.jena.reasoner.InfGraph ;
-import com.hp.hpl.jena.sparql.core.DatasetGraph ;
-import com.hp.hpl.jena.sparql.graph.GraphWrapper ;
-import com.hp.hpl.jena.sparql.mgt.ARQMgt ;
-import com.hp.hpl.jena.sparql.mgt.SystemInfo ;
-
-public class SystemARQ
-{
-    // Various system wide settings, "constants" that might change e.g. test setups
-
-    // NodeValues work without the context so somethings only have global settings.
-    
-    /** Control whether additon datatypes, over and above strict, minimal SPARQL compliance, are handled.
-     *  Examples incldue xsd;date and simple literal/xsd:string.
-     */
-    public static boolean ValueExtensions       = true ;
-
-    /**
-     * Under strict F&O, dateTimes and dates with no timezone have one magically applied. 
-     * This default timezone is implementation dependent and can lead to different answers
-     * to queries depending on the timezone. Normally, ARQ uses XMLSchema dateTime comparions,
-     * which an yield "indeterminate", which in turn is an evaluation error. 
-     * F&O insists on true/false and so can lead to false positves and negatives. 
-     */
-    public static boolean StrictDateTimeFO      = false ;
-    
-    /** Whether support for roman numerals (datatype http://rome.example.org/Numeral).
-     *  Mainly a test of datatype extension.
-     */
-    public static boolean EnableRomanNumerals   = true ;  
-    
-    /**
-     * Use a plain graph (sameValueAs is term equality)
-     */
-    public static boolean UsePlainGraph         = false ;
-    
-    /**
-     * Whether to use StAX or SAX XML parsing for result sets (StAX preferred). 
-     */
-    public static boolean UseSAX                = false ;
-
-    /** Sync a Model if it provides the underlying graph provides sync . Do nothing otherwise. */
-    public static void sync(Model model)
-    {
-        sync(model.getGraph()) ;
-    }
-    
-    /** Sync if provided. Do nothing if not. */
-    public static void sync(Graph graph)
-    {
-        syncGraph(graph) ;
-    }
-    
-    private static void syncGraph(Graph graph)
-    {
-        // "Temporary" hack.  Graph ought to implement sync and casade it down.
-        if ( graph instanceof InfGraph )
-            syncGraph(((InfGraph)graph).getRawGraph()) ;
-        else if ( graph instanceof Polyadic ) // MultiUnion
-            // Only the base graph is updatable.
-            syncGraph(((Polyadic)graph).getBaseGraph()) ;
-        else if ( graph instanceof GraphWrapper )
-            syncGraph(((GraphWrapper)graph).get()) ;
-//        else if ( graph instanceof WrappedGraph )   
-//            // Does not expose the WrappedGraph : checking, no subclass needs a sync().
-//            syncGraph(((WrappedGraph)graph).get()) ;
-        else
-            syncObject(graph) ;
-    }
-
-    /** Sync a Dataset, if underlying storage provides sync. */
-    public static void sync(Dataset dataset)
-    { 
-        sync(dataset.asDatasetGraph()) ;
-    }
-    
-    /** Sync carefully for compound objects*/
-    public static void sync(DatasetGraph dataset)
-    { 
-        // Let implementation declare Sync and decide what to do
-        // For light-weight, not truely ACID transaction, implementations.
-//        if ( dataset instanceof Transactional )
-//            return ;
-        
-        if ( dataset instanceof Sync )
-        {
-            ((Sync)dataset).sync() ;
-            return ;
-        }
-        else
-        {
-            sync(dataset.getDefaultGraph()) ;
-            // Go through each graph.
-            Iterator<Node> iter = Iter.iterator(dataset.listGraphNodes()) ;
-            for ( ; iter.hasNext() ; )
-            {
-                Node n = iter.next();
-                Graph g = dataset.getGraph(n) ;
-                sync(g) ;
-            }
-        }
-    }
-    
-    /** Sync an object if synchronizable (model, graph, dataset). 
-     *  If force is true, synchronize as much as possible (e.g. file metadata)
-     *  else make a reasonable attenpt at synchronization but does not gauarantee disk state. 
-     *  Do nothing otherwise.
-     */
-    public static void syncObject(Object object)
-    {
-        if ( object instanceof Sync )
-            ((Sync)object).sync() ;
-    }
-    
-    
-    private static List<SystemInfo> versions = new ArrayList<>() ;
-    public static void registerSubSystem(SystemInfo systemInfo)
-    {
-        ARQMgt.register(systemInfo.getJmxPath()+".system:type=SystemInfo", systemInfo) ;
-        versions.add(systemInfo) ;
-    }
-    
-    public static Iterator<SystemInfo> registeredSubsystems()
-    {
-        return versions.iterator() ;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/jena/blob/56534eac/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/Algebra.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/Algebra.java b/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/Algebra.java
deleted file mode 100644
index 5992d51..0000000
--- a/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/Algebra.java
+++ /dev/null
@@ -1,219 +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.algebra;
-
-import java.util.Iterator ;
-
-import com.hp.hpl.jena.graph.Graph ;
-import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.query.ARQ ;
-import com.hp.hpl.jena.query.Dataset ;
-import com.hp.hpl.jena.query.Query ;
-import com.hp.hpl.jena.rdf.model.Model ;
-import com.hp.hpl.jena.shared.PrefixMapping ;
-import com.hp.hpl.jena.sparql.algebra.optimize.Optimize ;
-import com.hp.hpl.jena.sparql.core.DatasetGraph ;
-import com.hp.hpl.jena.sparql.core.DatasetGraphFactory ;
-import com.hp.hpl.jena.sparql.core.Var ;
-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.QueryIterator ;
-import com.hp.hpl.jena.sparql.engine.binding.Binding ;
-import com.hp.hpl.jena.sparql.engine.binding.BindingFactory ;
-import com.hp.hpl.jena.sparql.engine.binding.BindingMap ;
-import com.hp.hpl.jena.sparql.engine.binding.BindingRoot ;
-import com.hp.hpl.jena.sparql.engine.ref.QueryEngineRef ;
-import com.hp.hpl.jena.sparql.sse.Item ;
-import com.hp.hpl.jena.sparql.sse.SSE ;
-import com.hp.hpl.jena.sparql.sse.builders.BuilderOp ;
-import com.hp.hpl.jena.sparql.syntax.Element ;
-import com.hp.hpl.jena.sparql.util.Context ;
-
-/** Utilities to produce SPARQL algebra */
-public class Algebra
-{
-    // -------- Optimize
-    
-    /** Apply static transformations to a query to optimize it */
-    public static Op optimize(Op op) { return optimize(op, null) ; }
-    
-    /** Apply static transformations to a query to optimize it */
-    public static Op optimize(Op op, Context context)
-    {
-        if ( context == null )
-            context = ARQ.getContext() ;
-        // Call-through to somewhere to manage all the optimizations
-        if ( op == null )
-            return null ;
-        return Optimize.optimize(op, context) ;
-    }   
-    
-    // -------- Compile
-    
-    /** Compile a query - pattern and modifiers.  */
-    public static Op compile(Query query)
-    {
-        if ( query == null )
-            return null ;
-        return new AlgebraGenerator().compile(query) ;
-    }
-
-    /** Compile a pattern.*/
-    public static Op compile(Element elt)
-    {
-        if ( elt == null )
-            return null ;
-        return new AlgebraGenerator().compile(elt) ;
-    }
-
-    /** Turn an algebra expression into quad form */
-    public static Op toQuadForm(Op op)
-    {
-        return AlgebraQuad.quadize(op) ;
-    }
-    
-    /** Transform an algebra expression so that default graph is union of the named graphs. */
-    public static Op unionDefaultGraph(Op op)
-    {
-        return TransformUnionQuery.transform(op) ;
-    }
-    
-    // -------- SSE uses these operations ...
-    
-    static public Op read(String filename)
-    {
-        Item item = SSE.readFile(filename) ;
-        return parse(item) ;
-    }
-
-    static public Op parse(String string)
-    {
-        Item item = SSE.parse(string) ;
-        return parse(item) ;
-    }
-    
-
-    static public Op parse(String string, PrefixMapping pmap)
-    {
-        Item item = SSE.parse(string, pmap) ;
-        return parse(item) ;
-    }
-    
-    static public Op parse(Item item)
-    {
-        Op op = BuilderOp.build(item) ;
-        return op ;
-    }
-    
-    // -------- Execute
-
-    static public QueryIterator exec(Op op, Dataset ds)
-    {
-        return exec(op, ds.asDatasetGraph()) ;
-    }
-
-    static public QueryIterator exec(Op op, Model model)
-    {
-        return exec(op, model.getGraph()) ;
-    }
-
-    static public QueryIterator exec(Op op, Graph graph)
-    {
-        return exec(op, DatasetGraphFactory.createOneGraph(graph)) ;
-    }
-
-    static public QueryIterator exec(Op op, DatasetGraph ds)
-    {
-        QueryEngineFactory f = QueryEngineRegistry.findFactory(op, ds, null) ;
-        Plan plan = f.create(op, ds, BindingRoot.create(), null) ;
-        return plan.iterator() ;
-    }
-
-    //  Reference engine
-
-    static public QueryIterator execRef(Op op, Dataset ds)
-    {
-        return execRef(op, ds.asDatasetGraph()) ;
-    }
-
-    static public QueryIterator execRef(Op op, Model model)
-    {
-        return execRef(op, model.getGraph()) ;
-    }
-
-    static public QueryIterator execRef(Op op, Graph graph)
-    {
-        return execRef(op, DatasetGraphFactory.createOneGraph(graph)) ;
-    }
-
-    static public QueryIterator execRef(Op op, DatasetGraph dsg)
-    {
-        QueryEngineRef qe = new QueryEngineRef(op, dsg, ARQ.getContext().copy()) ;
-        return qe.getPlan().iterator() ;
-    }
-    
-    // This is the SPARQL merge rule. 
-    public static Binding merge(Binding bindingLeft, Binding bindingRight)
-    {
-        // Test to see if compatible: Iterate over variables in left
-        boolean matches = compatible(bindingLeft, bindingRight) ;
-        
-        if ( ! matches ) 
-            return null ;
-        
-        // If compatible, merge. Iterate over variables in right but not in left.
-        BindingMap b = BindingFactory.create(bindingLeft) ;
-        for ( Iterator<Var> vIter = bindingRight.vars() ; vIter.hasNext() ; )
-        {
-            Var v = vIter.next();
-            Node n = bindingRight.get(v) ;
-            if ( ! bindingLeft.contains(v) )
-                b.add(v, n) ;
-        }
-        return b ;
-    }
-    
-    public static boolean compatible(Binding bindingLeft, Binding bindingRight)
-    {
-        // Test to see if compatible: Iterate over variables in left
-        for ( Iterator<Var> vIter = bindingLeft.vars() ; vIter.hasNext() ; )
-        {
-            Var v = vIter.next();
-            Node nLeft  = bindingLeft.get(v) ; 
-            Node nRight = bindingRight.get(v) ;
-            
-            if ( nRight != null && ! nRight.equals(nLeft) )
-                return false ;
-        }
-        return true ;
-    }
-    
-    public static boolean disjoint(Binding binding1, Binding binding2)
-    {
-        Iterator<Var> iterVar1 = binding1.vars() ;
-        for ( ; iterVar1.hasNext() ; )
-        {
-            Var v = iterVar1.next() ; 
-            if ( binding2.contains(v) )
-                return false ;
-        }
-        return true ;
-    }
-}


Mime
View raw message