You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2012/02/16 18:42:50 UTC

svn commit: r1245095 - in /incubator/jena/Jena2/ARQ/trunk: ResultSets/xml-to-html-links.xsl ResultSets/xml-to-html-plain.xsl ResultSets/xml-to-html.xsl bin/sparql src/main/java/com/hp/hpl/jena/sparql/sse/builders/BuilderPath.java

Author: andy
Date: Thu Feb 16 17:42:49 2012
New Revision: 1245095

URL: http://svn.apache.org/viewvc?rev=1245095&view=rev
Log: (empty)

Added:
    incubator/jena/Jena2/ARQ/trunk/ResultSets/xml-to-html-links.xsl
    incubator/jena/Jena2/ARQ/trunk/ResultSets/xml-to-html-plain.xsl
Modified:
    incubator/jena/Jena2/ARQ/trunk/ResultSets/xml-to-html.xsl
    incubator/jena/Jena2/ARQ/trunk/bin/sparql
    incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/sse/builders/BuilderPath.java

Added: incubator/jena/Jena2/ARQ/trunk/ResultSets/xml-to-html-links.xsl
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/ResultSets/xml-to-html-links.xsl?rev=1245095&view=auto
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/ResultSets/xml-to-html-links.xsl (added)
+++ incubator/jena/Jena2/ARQ/trunk/ResultSets/xml-to-html-links.xsl Thu Feb 16 17:42:49 2012
@@ -0,0 +1,183 @@
+<?xml version="1.0"?>
+
+<!--
+
+XSLT script to format SPARQL Query Results XML Format into xhtml
+
+Copyright © 2004, 2005 World Wide Web Consortium, (Massachusetts
+Institute of Technology, European Research Consortium for
+Informatics and Mathematics, Keio University). All Rights
+Reserved. This work is distributed under the W3C® Software
+License [1] in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.
+
+[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+
+Version 1 : Dave Beckett (DAWG)
+Version 2 : Jeen Broekstra (DAWG)
+Customization for SPARQler: Andy Seaborne
+URIs as hrefs in results : Bob DuCharme & Andy Seaborne
+
+> -    <xsl:for-each select="//res:head/res:variable">
+> +    <xsl:for-each select="/res:sparql/res:head/res:variable">
+
+-->
+
+<xsl:stylesheet version="1.0"
+		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+		xmlns="http://www.w3.org/1999/xhtml"
+		xmlns:res="http://www.w3.org/2005/sparql-results#"
+		xmlns:fn="http://www.w3.org/2005/xpath-functions"
+		exclude-result-prefixes="res xsl">
+
+  <!--
+    <xsl:output
+    method="html"
+    media-type="text/html"
+    doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
+    indent="yes"
+    encoding="UTF-8"/>
+  -->
+
+  <!-- or this? -->
+
+  <xsl:output
+   method="xml" 
+   indent="yes"
+   encoding="UTF-8" 
+   doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
+   doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
+   omit-xml-declaration="no" />
+
+    <xsl:template match="res:link">
+      <p>Link to <xsl:value-of select="@href"/></p>
+    </xsl:template>
+
+    <xsl:template name="header">
+      <div>
+        <h2>Header</h2>
+        <xsl:apply-templates select="res:head/res:link"/>
+      </div>
+    </xsl:template>
+
+  <xsl:template name="boolean-result">
+    <div>
+      <p>ASK => <xsl:value-of select="res:boolean"/></p>
+    </div>
+  </xsl:template>
+
+
+  <xsl:template name="vb-result">
+    <div>
+      <table>
+	<xsl:text>
+	</xsl:text>
+	<tr>
+	  <xsl:for-each select="res:head/res:variable">
+	    <th><xsl:value-of select="@name"/></th>
+	  </xsl:for-each>
+	</tr>
+	<xsl:text>
+	</xsl:text>
+	<xsl:for-each select="res:results/res:result">
+	  <tr>
+	    <xsl:apply-templates select="."/>
+	  </tr>
+	</xsl:for-each>
+      </table>
+    </div>
+  </xsl:template>
+
+  <xsl:template match="res:result">
+    <xsl:variable name="current" select="."/>
+    <xsl:for-each select="/res:sparql/res:head/res:variable">
+      <xsl:variable name="name" select="@name"/>
+      <td>
+	<xsl:choose>
+	  <xsl:when test="$current/res:binding[@name=$name]">
+	    <!-- apply template for the correct value type (bnode, uri, literal) -->
+	    <xsl:apply-templates select="$current/res:binding[@name=$name]"/>
+	  </xsl:when>
+	  <xsl:otherwise>
+	    <!-- no binding available for this variable in this solution -->
+	  </xsl:otherwise>
+	</xsl:choose>
+      </td>
+    </xsl:for-each>
+  </xsl:template>
+
+  <xsl:template match="res:bnode">
+    <xsl:text>_:</xsl:text>
+    <xsl:value-of select="text()"/>
+  </xsl:template>
+
+  <xsl:template match="res:uri">
+    <!-- Roughly: SELECT ($uri AS ?subject) ?predicate ?object { $uri ?predicate ?object } -->
+    <!-- XSLT 2.0
+    <xsl:variable name="x"><xsl:value-of select="fn:encode-for-uri(.)"/></xsl:variable>
+    -->
+    <xsl:variable name="x"><xsl:value-of select="."/></xsl:variable>
+    <!--
+    <xsl:variable name="query">SELECT%20%28%3C<xsl:value-of select="."/>%3E%20AS%20%3Fsubject%29%20%3Fpredicate%20%3Fobject%20%7B%3C<xsl:value-of select="."/>%3E%20%3Fpredicate%20%3Fobject%20%7D</xsl:variable>
+    -->
+     <xsl:variable name="query">SELECT%20%28%3C<xsl:value-of select="$x"/>%3E%20AS%20%3Fsubject%29%20%3Fpredicate%20%3Fobject%20%7B%3C<xsl:value-of select="$x"/>%3E%20%3Fpredicate%20%3Fobject%20%7D</xsl:variable>
+    <xsl:text>&lt;</xsl:text>
+    <a href="?query={$query}&amp;output=xml&amp;stylesheet=%2Fxml-to-html.xsl">
+    <xsl:value-of select="."/>
+    </a>
+    <xsl:text>&gt;</xsl:text>
+  </xsl:template>
+
+  <xsl:template match="res:literal[@datatype]">
+	<!-- datatyped literal value -->
+    "<xsl:value-of select="."/>"^^&lt;<xsl:value-of select="@datatype"/>&gt;
+  </xsl:template>
+
+  <xsl:template match="res:literal[@lang]">
+	<!-- datatyped literal value -->
+    "<xsl:value-of select="."/>"<xsl:value-of select="@xml:lang"/>
+  </xsl:template>
+
+  <xsl:template match="res:sparql">
+    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+      <head>
+	<title>SPARQLer Query Results</title>
+	<style>
+	  <![CDATA[
+	  h1 { font-size: 150% ; }
+	  h2 { font-size: 125% ; }
+	  table { border-collapse: collapse ; border: 1px solid black ; }
+	  td, th
+ 	  { border: 1px solid black ;
+	    padding-left:0.5em; padding-right: 0.5em; 
+	    padding-top:0.2ex ; padding-bottom:0.2ex 
+	  }
+	  ]]>
+	</style>
+      </head>
+      <body>
+
+
+	<h1>SPARQLer Query Results</h1>
+
+	<xsl:if test="res:head/res:link">
+	  <xsl:call-template name="header"/>
+	</xsl:if>
+
+	<xsl:choose>
+	  <xsl:when test="res:boolean">
+	    <xsl:call-template name="boolean-result" />
+	  </xsl:when>
+
+	  <xsl:when test="res:results">
+	    <xsl:call-template name="vb-result" />
+	  </xsl:when>
+
+	</xsl:choose>
+
+
+      </body>
+    </html>
+  </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file

Added: incubator/jena/Jena2/ARQ/trunk/ResultSets/xml-to-html-plain.xsl
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/ResultSets/xml-to-html-plain.xsl?rev=1245095&view=auto
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/ResultSets/xml-to-html-plain.xsl (added)
+++ incubator/jena/Jena2/ARQ/trunk/ResultSets/xml-to-html-plain.xsl Thu Feb 16 17:42:49 2012
@@ -0,0 +1,187 @@
+<?xml version="1.0"?>
+
+<!--
+
+XSLT script to format SPARQL Query Results XML Format into xhtml
+
+Copyright © 2004, 2005 World Wide Web Consortium, (Massachusetts
+Institute of Technology, European Research Consortium for
+Informatics and Mathematics, Keio University). All Rights
+Reserved. This work is distributed under the W3C® Software
+License [1] in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.
+
+[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+
+Version 1 : Dave Beckett (DAWG)
+Version 2 : Jeen Broekstra (DAWG)
+Customization for SPARQler: Andy Seaborne
+Fix:
+
+> -    <xsl:for-each select="//res:head/res:variable">
+> +    <xsl:for-each select="/res:sparql/res:head/res:variable">
+
+-->
+
+<xsl:stylesheet version="1.0"
+		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+		xmlns="http://www.w3.org/1999/xhtml"
+		xmlns:res="http://www.w3.org/2005/sparql-results#"
+		exclude-result-prefixes="res xsl">
+
+  <!--
+    <xsl:output
+    method="html"
+    media-type="text/html"
+    doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
+    indent="yes"
+    encoding="UTF-8"/>
+  -->
+
+  <!-- or this? -->
+
+  <xsl:output
+   method="xml" 
+   indent="yes"
+   encoding="UTF-8" 
+   doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
+   doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
+   omit-xml-declaration="no" />
+
+
+  <xsl:template name="header">
+    <div>
+      <h2>Header</h2>
+      <xsl:for-each select="res:head/res:link"> 
+	<p>Link to <xsl:value-of select="@href"/></p>
+      </xsl:for-each>
+    </div>
+  </xsl:template>
+
+  <xsl:template name="boolean-result">
+    <div>
+      <!--      
+	<h2>Boolean Result</h2>
+      -->      
+      <p>ASK => <xsl:value-of select="res:boolean"/></p>
+    </div>
+  </xsl:template>
+
+
+  <xsl:template name="vb-result">
+    <div>
+      <!--
+	<h2>Variable Bindings Result</h2>
+	<p>Ordered: <xsl:value-of select="res:results/@ordered"/></p>
+	<p>Distinct: <xsl:value-of select="res:results/@distinct"/></p>
+      -->
+
+      <table>
+	<xsl:text>
+	</xsl:text>
+	<tr>
+	  <xsl:for-each select="res:head/res:variable">
+	    <th><xsl:value-of select="@name"/></th>
+	  </xsl:for-each>
+	</tr>
+	<xsl:text>
+	</xsl:text>
+	<xsl:for-each select="res:results/res:result">
+	  <tr>
+	    <xsl:apply-templates select="."/>
+	  </tr>
+	</xsl:for-each>
+      </table>
+    </div>
+  </xsl:template>
+
+  <xsl:template match="res:result">
+    <xsl:variable name="current" select="."/>
+    <xsl:for-each select="/res:sparql/res:head/res:variable">
+      <xsl:variable name="name" select="@name"/>
+      <td>
+	<xsl:choose>
+	  <xsl:when test="$current/res:binding[@name=$name]">
+	    <!-- apply template for the correct value type (bnode, uri, literal) -->
+	    <xsl:apply-templates select="$current/res:binding[@name=$name]"/>
+	  </xsl:when>
+	  <xsl:otherwise>
+	    <!-- no binding available for this variable in this solution -->
+	  </xsl:otherwise>
+	</xsl:choose>
+      </td>
+    </xsl:for-each>
+  </xsl:template>
+
+  <xsl:template match="res:bnode">
+    <xsl:text>_:</xsl:text>
+    <xsl:value-of select="text()"/>
+  </xsl:template>
+
+  <xsl:template match="res:uri">
+    <xsl:variable name="uri" select="text()"/>
+    <xsl:text>&lt;</xsl:text>
+    <xsl:value-of select="$uri"/>
+    <xsl:text>&gt;</xsl:text>
+  </xsl:template>
+
+  <xsl:template match="res:literal">
+    <xsl:text>"</xsl:text>
+    <xsl:value-of select="text()"/>
+    <xsl:text>"</xsl:text>
+
+    <xsl:choose>
+      <xsl:when test="@datatype">
+	<!-- datatyped literal value -->
+	^^&lt;<xsl:value-of select="@datatype"/>&gt;
+      </xsl:when>
+      <xsl:when test="@xml:lang">
+	<!-- lang-string -->
+	@<xsl:value-of select="@xml:lang"/>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="res:sparql">
+    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+      <head>
+	<title>SPARQLer Query Results</title>
+	<style>
+	  <![CDATA[
+	  h1 { font-size: 150% ; }
+	  h2 { font-size: 125% ; }
+	  table { border-collapse: collapse ; border: 1px solid black ; }
+	  td, th
+ 	  { border: 1px solid black ;
+	    padding-left:0.5em; padding-right: 0.5em; 
+	    padding-top:0.2ex ; padding-bottom:0.2ex 
+	  }
+	  ]]>
+	</style>
+      </head>
+      <body>
+
+
+	<h1>SPARQLer Query Results</h1>
+
+	<xsl:if test="res:head/res:link">
+	  <xsl:call-template name="header"/>
+	</xsl:if>
+
+	<xsl:choose>
+	  <xsl:when test="res:boolean">
+	    <xsl:call-template name="boolean-result" />
+	  </xsl:when>
+
+	  <xsl:when test="res:results">
+	    <xsl:call-template name="vb-result" />
+	  </xsl:when>
+
+	</xsl:choose>
+
+
+      </body>
+    </html>
+  </xsl:template>
+</xsl:stylesheet>

Modified: incubator/jena/Jena2/ARQ/trunk/ResultSets/xml-to-html.xsl
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/ResultSets/xml-to-html.xsl?rev=1245095&r1=1245094&r2=1245095&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/ResultSets/xml-to-html.xsl (original)
+++ incubator/jena/Jena2/ARQ/trunk/ResultSets/xml-to-html.xsl Thu Feb 16 17:42:49 2012
@@ -1,188 +1,187 @@
-<?xml version="1.0"?>
-
-<!--
-
-XSLT script to format SPARQL Query Results XML Format into xhtml
-
-Copyright © 2004, 2005 World Wide Web Consortium, (Massachusetts
-Institute of Technology, European Research Consortium for
-Informatics and Mathematics, Keio University). All Rights
-Reserved. This work is distributed under the W3C® Software
-License [1] in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.
-
-[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
-
-Version 1 : Dave Beckett (DAWG)
-Version 2 : Jeen Broekstra (DAWG)
-Customization for SPARQler: Andy Seaborne
-Fix:
-
-> -    <xsl:for-each select="//res:head/res:variable">
-> +    <xsl:for-each select="/res:sparql/res:head/res:variable">
-
--->
-
-<xsl:stylesheet version="1.0"
-		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-		xmlns="http://www.w3.org/1999/xhtml"
-		xmlns:res="http://www.w3.org/2005/sparql-results#"
-		exclude-result-prefixes="res xsl">
-
-  <!--
-    <xsl:output
-    method="html"
-    media-type="text/html"
-    doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
-    indent="yes"
-    encoding="UTF-8"/>
-  -->
-
-  <!-- or this? -->
-
-  <xsl:output
-   method="xml" 
-   indent="yes"
-   encoding="UTF-8" 
-   doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
-   doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
-   omit-xml-declaration="no" />
-
-    <xsl:template match="res:link">
-      <p>Link to <xsl:value-of select="@href"/></p>
-    </xsl:template>
-
-    <xsl:template name="header">
-      <div>
-        <h2>Header</h2>
-        <!-- replaced by Bob D with the following line and the preceding template rule     
-             <xsl:for-each select="res:head/res:link"> 
-             <p>Link to <xsl:value-of select="@href"/></p>
-             </xsl:for-each> -->
-        <xsl:apply-templates select="res:head/res:link"/>
-      </div>
-    </xsl:template>
-
-  <xsl:template name="boolean-result">
-    <div>
-      <!--      
-	<h2>Boolean Result</h2>
-      -->      
-      <p>ASK => <xsl:value-of select="res:boolean"/></p>
-    </div>
-  </xsl:template>
-
-
-  <xsl:template name="vb-result">
-    <div>
-      <!--
-	<h2>Variable Bindings Result</h2>
-	<p>Ordered: <xsl:value-of select="res:results/@ordered"/></p>
-	<p>Distinct: <xsl:value-of select="res:results/@distinct"/></p>
-      -->
-
-      <table>
-	<xsl:text>
-	</xsl:text>
-	<tr>
-	  <xsl:for-each select="res:head/res:variable">
-	    <th><xsl:value-of select="@name"/></th>
-	  </xsl:for-each>
-	</tr>
-	<xsl:text>
-	</xsl:text>
-	<xsl:for-each select="res:results/res:result">
-	  <tr>
-	    <xsl:apply-templates select="."/>
-	  </tr>
-	</xsl:for-each>
-      </table>
-    </div>
-  </xsl:template>
-
-  <xsl:template match="res:result">
-    <xsl:variable name="current" select="."/>
-    <xsl:for-each select="/res:sparql/res:head/res:variable">
-      <xsl:variable name="name" select="@name"/>
-      <td>
-	<xsl:choose>
-	  <xsl:when test="$current/res:binding[@name=$name]">
-	    <!-- apply template for the correct value type (bnode, uri, literal) -->
-	    <xsl:apply-templates select="$current/res:binding[@name=$name]"/>
-	  </xsl:when>
-	  <xsl:otherwise>
-	    <!-- no binding available for this variable in this solution -->
-	  </xsl:otherwise>
-	</xsl:choose>
-      </td>
-    </xsl:for-each>
-  </xsl:template>
-
-  <xsl:template match="res:bnode">
-    <xsl:text>_:</xsl:text>
-    <xsl:value-of select="text()"/>
-  </xsl:template>
-
-  <xsl:template match="res:uri">
-    <!-- Roughly: SELECT ($uri AS ?subject) ?predicate ?object { $uri ?predicate ?object } -->
-    <xsl:variable name="query">SELECT%20%28%3C<xsl:value-of select="."/>%3E%20AS%20%3Fsubject%29%20%3Fpredicate%20%3Fobject%20%7B%3C<xsl:value-of select="."/>%3E%20%3Fpredicate%20%3Fobject%20%7D</xsl:variable>
-    <xsl:text>&lt;</xsl:text>
-    <a href="?query={$query}&amp;output=xml&amp;stylesheet=%2Fxml-to-html-2.xsl">
-    <xsl:value-of select="."/>
-    </a>
-    <xsl:text>&gt;</xsl:text>
-  </xsl:template>
-
-  <xsl:template match="res:literal[@datatype]">
-	<!-- datatyped literal value -->
-    "<xsl:value-of select="."/>"^^&lt;<xsl:value-of select="@datatype"/>&gt;
-  </xsl:template>
-
-  <xsl:template match="res:literal[@lang]">
-	<!-- datatyped literal value -->
-    "<xsl:value-of select="."/>"<xsl:value-of select="@xml:lang"/>
-  </xsl:template>
-
-  <xsl:template match="res:sparql">
-    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-      <head>
-	<title>SPARQLer Query Results</title>
-	<style>
-	  <![CDATA[
-	  h1 { font-size: 150% ; }
-	  h2 { font-size: 125% ; }
-	  table { border-collapse: collapse ; border: 1px solid black ; }
-	  td, th
- 	  { border: 1px solid black ;
-	    padding-left:0.5em; padding-right: 0.5em; 
-	    padding-top:0.2ex ; padding-bottom:0.2ex 
-	  }
-	  ]]>
-	</style>
-      </head>
-      <body>
-
-
-	<h1>SPARQLer Query Results</h1>
-
-	<xsl:if test="res:head/res:link">
-	  <xsl:call-template name="header"/>
-	</xsl:if>
-
-	<xsl:choose>
-	  <xsl:when test="res:boolean">
-	    <xsl:call-template name="boolean-result" />
-	  </xsl:when>
-
-	  <xsl:when test="res:results">
-	    <xsl:call-template name="vb-result" />
-	  </xsl:when>
-
-	</xsl:choose>
-
-
-      </body>
-    </html>
-  </xsl:template>
-</xsl:stylesheet>
\ No newline at end of file
+<?xml version="1.0"?>
+
+<!--
+
+XSLT script to format SPARQL Query Results XML Format into xhtml
+
+Copyright © 2004, 2005 World Wide Web Consortium, (Massachusetts
+Institute of Technology, European Research Consortium for
+Informatics and Mathematics, Keio University). All Rights
+Reserved. This work is distributed under the W3C® Software
+License [1] in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.
+
+[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+
+Version 1 : Dave Beckett (DAWG)
+Version 2 : Jeen Broekstra (DAWG)
+Customization for SPARQler: Andy Seaborne
+Fix:
+
+> -    <xsl:for-each select="//res:head/res:variable">
+> +    <xsl:for-each select="/res:sparql/res:head/res:variable">
+
+-->
+
+<xsl:stylesheet version="1.0"
+		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+		xmlns="http://www.w3.org/1999/xhtml"
+		xmlns:res="http://www.w3.org/2005/sparql-results#"
+		exclude-result-prefixes="res xsl">
+
+  <!--
+    <xsl:output
+    method="html"
+    media-type="text/html"
+    doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
+    indent="yes"
+    encoding="UTF-8"/>
+  -->
+
+  <!-- or this? -->
+
+  <xsl:output
+   method="xml" 
+   indent="yes"
+   encoding="UTF-8" 
+   doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
+   doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
+   omit-xml-declaration="no" />
+
+
+  <xsl:template name="header">
+    <div>
+      <h2>Header</h2>
+      <xsl:for-each select="res:head/res:link"> 
+	<p>Link to <xsl:value-of select="@href"/></p>
+      </xsl:for-each>
+    </div>
+  </xsl:template>
+
+  <xsl:template name="boolean-result">
+    <div>
+      <!--      
+	<h2>Boolean Result</h2>
+      -->      
+      <p>ASK => <xsl:value-of select="res:boolean"/></p>
+    </div>
+  </xsl:template>
+
+
+  <xsl:template name="vb-result">
+    <div>
+      <!--
+	<h2>Variable Bindings Result</h2>
+	<p>Ordered: <xsl:value-of select="res:results/@ordered"/></p>
+	<p>Distinct: <xsl:value-of select="res:results/@distinct"/></p>
+      -->
+
+      <table>
+	<xsl:text>
+	</xsl:text>
+	<tr>
+	  <xsl:for-each select="res:head/res:variable">
+	    <th><xsl:value-of select="@name"/></th>
+	  </xsl:for-each>
+	</tr>
+	<xsl:text>
+	</xsl:text>
+	<xsl:for-each select="res:results/res:result">
+	  <tr>
+	    <xsl:apply-templates select="."/>
+	  </tr>
+	</xsl:for-each>
+      </table>
+    </div>
+  </xsl:template>
+
+  <xsl:template match="res:result">
+    <xsl:variable name="current" select="."/>
+    <xsl:for-each select="/res:sparql/res:head/res:variable">
+      <xsl:variable name="name" select="@name"/>
+      <td>
+	<xsl:choose>
+	  <xsl:when test="$current/res:binding[@name=$name]">
+	    <!-- apply template for the correct value type (bnode, uri, literal) -->
+	    <xsl:apply-templates select="$current/res:binding[@name=$name]"/>
+	  </xsl:when>
+	  <xsl:otherwise>
+	    <!-- no binding available for this variable in this solution -->
+	  </xsl:otherwise>
+	</xsl:choose>
+      </td>
+    </xsl:for-each>
+  </xsl:template>
+
+  <xsl:template match="res:bnode">
+    <xsl:text>_:</xsl:text>
+    <xsl:value-of select="text()"/>
+  </xsl:template>
+
+  <xsl:template match="res:uri">
+    <xsl:variable name="uri" select="text()"/>
+    <xsl:text>&lt;</xsl:text>
+    <xsl:value-of select="$uri"/>
+    <xsl:text>&gt;</xsl:text>
+  </xsl:template>
+
+  <xsl:template match="res:literal">
+    <xsl:text>"</xsl:text>
+    <xsl:value-of select="text()"/>
+    <xsl:text>"</xsl:text>
+
+    <xsl:choose>
+      <xsl:when test="@datatype">
+	<!-- datatyped literal value -->
+	^^&lt;<xsl:value-of select="@datatype"/>&gt;
+      </xsl:when>
+      <xsl:when test="@xml:lang">
+	<!-- lang-string -->
+	@<xsl:value-of select="@xml:lang"/>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="res:sparql">
+    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+      <head>
+	<title>SPARQLer Query Results</title>
+	<style>
+	  <![CDATA[
+	  h1 { font-size: 150% ; }
+	  h2 { font-size: 125% ; }
+	  table { border-collapse: collapse ; border: 1px solid black ; }
+	  td, th
+ 	  { border: 1px solid black ;
+	    padding-left:0.5em; padding-right: 0.5em; 
+	    padding-top:0.2ex ; padding-bottom:0.2ex 
+	  }
+	  ]]>
+	</style>
+      </head>
+      <body>
+
+
+	<h1>SPARQLer Query Results</h1>
+
+	<xsl:if test="res:head/res:link">
+	  <xsl:call-template name="header"/>
+	</xsl:if>
+
+	<xsl:choose>
+	  <xsl:when test="res:boolean">
+	    <xsl:call-template name="boolean-result" />
+	  </xsl:when>
+
+	  <xsl:when test="res:results">
+	    <xsl:call-template name="vb-result" />
+	  </xsl:when>
+
+	</xsl:choose>
+
+
+      </body>
+    </html>
+  </xsl:template>
+</xsl:stylesheet>

Modified: incubator/jena/Jena2/ARQ/trunk/bin/sparql
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/bin/sparql?rev=1245095&r1=1245094&r2=1245095&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/bin/sparql (original)
+++ incubator/jena/Jena2/ARQ/trunk/bin/sparql Thu Feb 16 17:42:49 2012
@@ -6,8 +6,13 @@ then
     exit 1
     fi
 
-CP=$($ARQROOT/bin/arq_path)
+INIT="$ARQROOT/bin/arq_init"
 
-#echo $CP
+if [ ! -r "$INIT" ] 
+    then 
+    echo "Script $INIT (\$ARQROOT/bin/arq_init) does not exist or is not readable"
+    exit 1
+fi
 
-java -Xmx1024M $SOCKS -cp "$CP" arq.sparql "$@"
+source "$INIT"
+exec java $JVM_ARGS $SOCKS -cp "$ARQ_CP" "arq.$ARQ_CMD" "$@"

Modified: incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/sse/builders/BuilderPath.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/sse/builders/BuilderPath.java?rev=1245095&r1=1245094&r2=1245095&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/sse/builders/BuilderPath.java (original)
+++ incubator/jena/Jena2/ARQ/trunk/src/main/java/com/hp/hpl/jena/sparql/sse/builders/BuilderPath.java Thu Feb 16 17:42:49 2012
@@ -59,6 +59,7 @@ public class BuilderPath
     
     private BuilderPath()
     {
+        dispatch.put(Tags.tagPath,    buildPath) ;
         dispatch.put(Tags.tagPathSeq, buildSeq) ;
         dispatch.put(Tags.tagPathAlt, buildAlt) ;
         dispatch.put(Tags.tagPathMod, buildMod) ;
@@ -123,6 +124,17 @@ public class BuilderPath
         return build(list.get(idx)) ;
     }
     
+    final protected Build buildPath = new Build()
+    {
+        @Override
+        public Path make(ItemList list)
+        {
+            BuilderLib.checkLength(2, list, "path: Exactly one element") ;
+            Item item = list.get(1) ;
+            return build(item) ;
+        }
+    } ;
+    
     final protected Build buildNotOneOf = new Build()
     {
         @Override