jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [1/6] jena git commit: JENA-1366: Fuseki embedded as a standalone server
Date Sun, 25 Jun 2017 14:36:20 GMT
Repository: jena
Updated Branches:
  refs/heads/master f9c074632 -> e05e65cf0


http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/sparqler/log4j-foreground.properties
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/sparqler/log4j-foreground.properties b/jena-fuseki2/jena-fuseki-basic/sparqler/log4j-foreground.properties
new file mode 100755
index 0000000..802ee9e
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/sparqler/log4j-foreground.properties
@@ -0,0 +1,44 @@
+log4j.rootLogger=INFO, stdlog
+#log4j.rootLogger=INFO, fileout
+
+log4j.appender.stdlog=org.apache.log4j.ConsoleAppender
+## log4j.appender.stdlog.target=System.err
+log4j.appender.stdlog.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdlog.layout.ConversionPattern=%d{HH:mm:ss} %-5p %-20c{1} :: %m%n
+
+# File logging, with roll over.
+log4j.appender.FusekiFileLog=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.FusekiFileLog.DatePattern='.'yyyy-MM-dd
+log4j.appender.FusekiFileLog.File=fuseki-log
+log4j.appender.FusekiFileLog.layout=org.apache.log4j.PatternLayout
+log4j.appender.FusekiFileLog.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss}%d{HH:mm:ss} %-5p %-20c{1} :: %m%n
+
+# File logging - one file.
+log4j.appender.fileout=org.apache.log4j.FileAppender
+log4j.appender.fileout.File=log.joseki
+log4j.appender.fileout.layout=org.apache.log4j.PatternLayout
+log4j.appender.fileout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %-20c{1} :: %m%n
+
+# Jetty - Fuseki catches Jetty errors and reports them.
+log4j.logger.org.eclipse.jetty=FATAL
+
+## # Execution logging
+## log4j.logger.com.hp.hpl.jena.arq.info=INFO
+## log4j.logger.com.hp.hpl.jena.arq.exec=INFO
+
+# Everything else in Jena
+log4j.logger.com.hp.hpl.jena=WARN
+log4j.logger.org.apache.jena=WARN
+log4j.logger.org.openjena=WARN
+log4j.logger.org.openjena.riot=WARN
+
+# Joseki server
+log4j.logger.org.joseki=INFO
+
+# Fuseki
+# Server log.
+log4j.logger.org.apache.jena.fuseki.Server=INFO
+# Request log.
+log4j.logger.org.apache.jena.fuseki.Fuseki=INFO
+# Internal logs
+log4j.logger.org.apache.jena.fuseki=INFO

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/sparqler/log4j-server.properties
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/sparqler/log4j-server.properties b/jena-fuseki2/jena-fuseki-basic/sparqler/log4j-server.properties
new file mode 100755
index 0000000..1f575dd
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/sparqler/log4j-server.properties
@@ -0,0 +1,44 @@
+#log4j.rootLogger=INFO, stdlog
+log4j.rootLogger=INFO, fileout
+
+log4j.appender.stdlog=org.apache.log4j.ConsoleAppender
+## log4j.appender.stdlog.target=System.err
+log4j.appender.stdlog.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdlog.layout.ConversionPattern=%d{HH:mm:ss} %-5p %-20c{1} :: %m%n
+
+# File logging, with roll over.
+log4j.appender.FusekiFileLog=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.FusekiFileLog.DatePattern='.'yyyy-MM-dd
+log4j.appender.FusekiFileLog.File=fuseki.log
+log4j.appender.FusekiFileLog.layout=org.apache.log4j.PatternLayout
+log4j.appender.FusekiFileLog.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss}%d{HH:mm:ss} %-5p %-20c{1} :: %m%n
+
+# File logging - one file.
+log4j.appender.fileout=org.apache.log4j.FileAppender
+log4j.appender.fileout.File=log.fuseki
+log4j.appender.fileout.layout=org.apache.log4j.PatternLayout
+log4j.appender.fileout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %-20c{1} :: %m%n
+
+# Jetty - Fuseki catches Jetty errors and reports them.
+log4j.logger.org.eclipse.jetty=FATAL
+
+## # Execution logging
+## log4j.logger.com.hp.hpl.jena.arq.info=INFO
+## log4j.logger.com.hp.hpl.jena.arq.exec=INFO
+
+# Everything else in Jena
+log4j.logger.com.hp.hpl.jena=WARN
+log4j.logger.org.apache.jena=WARN
+log4j.logger.org.openjena=WARN
+log4j.logger.org.openjena.riot=WARN
+
+# Joseki server
+log4j.logger.org.joseki=INFO
+
+# Fuseki
+# Server log.
+log4j.logger.org.apache.jena.fuseki.Server=INFO
+# Request log.
+log4j.logger.org.apache.jena.fuseki.Fuseki=INFO
+# Internal logs
+log4j.logger.org.apache.jena.fuseki=INFO

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/sparqler/pages/D.nt
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/sparqler/pages/D.nt b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/D.nt
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/sparqler/pages/D.rdf
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/sparqler/pages/D.rdf b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/D.rdf
new file mode 100644
index 0000000..a67a21e
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/D.rdf
@@ -0,0 +1,8 @@
+<rdf:RDF
+    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+    xmlns="http://example/">
+  <rdf:Description rdf:about="http://example/s">
+    <q rdf:datatype="http://www.w3.org/2001/XMLSchema#integer"
+    >123</q>
+  </rdf:Description>
+</rdf:RDF>

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/sparqler/pages/D.ttl
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/sparqler/pages/D.ttl b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/D.ttl
new file mode 100644
index 0000000..eca0eac
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/D.ttl
@@ -0,0 +1,3 @@
+@prefix : <http://example/> .
+
+:s :q 123 .

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/sparqler/pages/crossdomain.xml
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/sparqler/pages/crossdomain.xml b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/crossdomain.xml
new file mode 100755
index 0000000..c1e814f
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/crossdomain.xml
@@ -0,0 +1,3 @@
+<cross-domain-policy>
+<allow-access-from domain="*"/>
+</cross-domain-policy>

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/sparqler/pages/data-validator.html
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/sparqler/pages/data-validator.html b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/data-validator.html
new file mode 100755
index 0000000..876cab3
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/data-validator.html
@@ -0,0 +1,48 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head><title>SPARQLer Data Validator</title>
+    <link rel="stylesheet" type="text/css" href="fuseki.css" />
+  </head>
+  <body>
+    <h1>SPARQLer Data Validator</h1>
+    <div class="moreindent">
+      <form action="validate/data" method="post" accept-charset="UTF-8" >
+	    <textarea name="data" cols="70" rows="30">
+# Prefixes for Turtle or TriG - these can be edited or removed.
+@base          &lt;http://example.org/base/> .
+@prefix :      &lt;http://example.org/> .
+@prefix xsd:   &lt;http://www.w3.org/2001/XMLSchema#> .
+@prefix rdf:   &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs:  &lt;http://www.w3.org/2000/01/rdf-schema#> .
+@prefix owl:   &lt;http://www.w3.org/2002/07/owl#> .
+
+
+</textarea>
+<br/>
+Input syntax:
+<input type="radio" name="languageSyntax" value="Turtle" checked="checked"/>Turtle
+<input type="radio" name="languageSyntax" value="TriG"/>TriG
+<input type="radio" name="languageSyntax" value="N-Triples"/>N-Triples
+<input type="radio" name="languageSyntax" value="N-Quads"/>N-Quad
+  <br/>
+      <!--
+Output syntax:
+  <input type="checkbox" name="outputFormat" value="sparql" checked="checked"/>SPARQL
+  <input type="checkbox" name="outputFormat" value="algebra"/>SPARQL algebra
+  <input type="checkbox" name="outputFormat" value="quads"/>SPARQL algebra (quads)
+  <br/>
+
+  Line numbers:
+  <input type="radio" name="linenumbers" value="true" checked="checked"/>Yes
+  <input type="radio" name="linenumbers" value="false"/>No
+  <br/>
+      -->
+        <input type="submit" value="Validate RDF Data" />
+      </form>
+      <hr/>
+Parsing provided by <a href="http://jena.apache.org/documentation/io/">Jena/RIOT</a>.
+Questions to 
+<href="mailto:users@jena.apache.org?s=[Data Validator]: ">users@jena</a>
+(include full details of input).
+    </div>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/sparqler/pages/doc.css
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/sparqler/pages/doc.css b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/doc.css
new file mode 100755
index 0000000..4c86428
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/doc.css
@@ -0,0 +1,127 @@
+body {
+    font-family: Verdana, Arial, Helvetica, sans-serif ;
+    font-size: 10pt ;
+    line-height: 18pt ;
+    color: black;
+    background: white ;
+    margin: 0 ;
+}
+
+p { margin-left: 2% ; margin-right: 2% ; }
+
+/* Makes lists a little tighter
+li { line-height: 14pt ; }
+*/
+
+table {
+  font-family: Verdana, Arial, sans-serif ;
+  font-size: 10pt ;
+  border-collapse: collapse;
+  border: 1px solid black ;
+  cellspacing: 0 ;
+  cellpadding: 0 
+}
+
+td {
+  border: 1px solid #808080 ;
+  empty-cells: show;
+  padding: 5 ;
+  spacing: 0 ;
+  vertical-align:top;
+  text-align:center
+}
+
+
+th {
+  border: 1px solid #808080 ;
+  empty-cells: show;
+  padding: 5 ;
+  vertical-align:top;
+  text-align:center
+}
+
+.box 
+{ margin-left :     5% ;
+  margin-right :    5% ;
+  border:           solid ;
+  border-width:     thin; 
+  background-color: #F0F0F0; 
+  padding:          2mm;
+  page-break-inside: avoid ;
+}
+
+.noindent     { margin-left: -5% ; margin-right: -5%; }
+.moreindent   { margin-left:  5% ; margin-right:  5%; }
+
+
+/* Use this for the document title as displayed on the page at the top. */
+
+
+h1 {
+    text-align:center ;
+    font-size: 14pt;
+    line-height: 24pt ;
+    font-weight: bold;
+    color:#000;
+    background:#CADFF4;
+    padding: 0 ;
+    margin: 0 ;
+    padding-left: 1ex;
+    padding-right: 1ex;
+    text-align:center;
+}
+
+h2 {
+    font-size: 12pt;
+    line-height: 16pt ;
+    font-size: 110%;
+    font-weight: bold;
+    color: #003399;
+    background:#CADFF4;
+    margin-bottom:5px;
+    padding-left: 1ex;
+    padding-right: 1ex;
+}
+
+h3, h4, h5 {
+    font-size: 100%;
+    font-weight: bold;
+    margin-bottom:3px;
+}
+
+ul { list-style-type: disc }
+dt { font-weight: bold }
+
+/* Change background/foreground colour on hover */
+
+A:link { color: rgb(0, 0, 255) }        /* for unvisited links */
+A:hover { color: rgb(255, 0, 0) }       /* when mouse is over link */
+
+/* No extra space between paragraphs : inherits from body */
+pre {
+    font-family: monospace;
+    font-size: 10pt ;
+    line-height: 14pt ;
+    margin-top: 1 ;
+    margin-bottom: 1 ;
+    margin-left: 5ex ;
+    }
+
+/* Some general utility definitions */
+.centered {
+    text-align: center;
+}
+
+.caption {
+    text-align: center;
+    font-size: smaller;
+}
+
+code {
+    font-size: 10pt;
+}
+
+.footnote {
+    font-size: smaller;
+    border-top: thin solid gray;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/sparqler/pages/fuseki.css
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/sparqler/pages/fuseki.css b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/fuseki.css
new file mode 100755
index 0000000..e3e5763
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/fuseki.css
@@ -0,0 +1,148 @@
+/**
+   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.
+*/
+body {
+    font-family: Verdana, Arial, Helvetica, sans-serif ;
+    font-size: 10pt ;
+    line-height: 18pt ;
+    color: black;
+    background: white ;
+    margin: 0 ;
+}
+
+textarea { background-color: #F0F0F0 ; }
+
+p { margin-left: 2% ; margin-right: 2% ; }
+
+.warning { color: #FF0000 ; }
+.error   { color: #FF0000 ;  font-weight: bold; }
+
+/* Makes lists a little tighter
+li { line-height: 14pt ; }
+*/
+
+table {
+  font-family: Verdana, Arial, sans-serif ;
+  font-size: 10pt ;
+  border-collapse: collapse;
+  border: 1px solid black ;
+  cellspacing: 0 ;
+  cellpadding: 0 
+}
+
+td {
+  border: 1px solid #808080 ;
+  empty-cells: show;
+  padding: 5 ;
+  spacing: 0 ;
+  vertical-align:top;
+  text-align:center
+}
+
+
+th {
+  border: 1px solid #808080 ;
+  empty-cells: show;
+  padding: 5 ;
+  vertical-align:top;
+  text-align:center
+}
+
+.box 
+{ margin-left :     5% ;
+  margin-right :    5% ;
+  border:           solid ;
+  border-width:     thin; 
+  background-color: #F0F0F0; 
+  padding:          2mm;
+  page-break-inside: avoid ;
+}
+
+.noindent     { margin-left: -5% ; margin-right: -5%; }
+.moreindent   { margin-left:  5% ; margin-right:  5%; }
+
+
+/* Use this for the document title as displayed on the page at the top. */
+
+
+h1 {
+    text-align:center ;
+    font-size: 14pt;
+    line-height: 24pt ;
+    font-weight: bold;
+    color:#000;
+    background:#CADFF4;
+    padding: 0 ;
+    margin: 0 ;
+    padding-left: 1ex;
+    padding-right: 1ex;
+    text-align:center;
+}
+
+h2 {
+    font-size: 12pt;
+    line-height: 16pt ;
+    font-size: 110%;
+    font-weight: bold;
+    color: #003399;
+    background:#CADFF4;
+    margin-bottom:5px;
+    padding-left: 1ex;
+    padding-right: 1ex;
+}
+
+h3, h4, h5 {
+    font-size: 100%;
+    font-weight: bold;
+    margin-bottom:3px;
+}
+
+ul { list-style-type: disc }
+dt { font-weight: bold }
+
+/* Change background/foreground colour on hover */
+
+A:link { color: rgb(0, 0, 255) }        /* for unvisited links */
+A:hover { color: rgb(255, 0, 0) }       /* when mouse is over link */
+
+/* No extra space between paragraphs : inherits from body */
+pre {
+    font-family: monospace;
+    font-size: 10pt ;
+    line-height: 14pt ;
+    margin-top: 1 ;
+    margin-bottom: 1 ;
+    margin-left: 5ex ;
+    }
+
+/* Some general utility definitions */
+.centered {
+    text-align: center;
+}
+
+.caption {
+    text-align: center;
+    font-size: smaller;
+}
+
+code {
+    font-size: 10pt;
+}
+
+.footnote {
+    font-size: smaller;
+    border-top: thin solid gray;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/sparqler/pages/index.html
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/sparqler/pages/index.html b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/index.html
new file mode 100755
index 0000000..f301d1c
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/index.html
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <head>
+    <title>SPARQLer - An RDF Query Server</title>
+    <link rel="stylesheet" type="text/css" href="fuseki.css" />
+  </head>
+<body>
+    <h1>SPARQLer</h1>
+    
+    <p>&nbsp;</p>
+
+    <h2>Validators</h2>
+    <ul>
+      <li><a href="query-validator.html">SPARQL query validator</a></li>
+      <li><a href="update-validator.html">SPARQL update validator</a></li>
+      <li><a href="data-validator.html">RDF data validator</a></li>
+      <li><a href="iri-validator.html">IRI validator</a></li>
+    </ul>
+
+    <h2>Query forms</h2>
+
+    <ul>
+      <!--
+      <li><a href="query.html">Form for SPARQL queries on a small books database</a></li>
+      -->
+      <li><a href="sparql.html">General purpose SPARQL processor</a></li>
+    </ul>
+
+    <h2>SPARQL Services</h2>
+
+    <p>The general SPARQL query service is accessed directly using the SPARQL
+protocol at <tt>/sparql</tt></p>
+
+    <h2>Links to SPARQL 1.1 Specifications</h2>
+    
+    <p>The full set of SPARQL specification is:</p>
+
+    <ul>
+      <li><a href="http://www.w3.org/TR/sparql11-query/"
+             >SPARQL Query language</a></li>
+      <li><a href="http://www.w3.org/TR/sparql11-update/"
+           >SPARQL Update</a></li>
+      <li><a href="http://www.w3.org/TR/sparql11-protocol/"
+             >SPARQL Protocol</a></li>
+      <li><a href="http://www.w3.org/TR/sparql11-http-rdf-update/"
+             >SPARQL Graph Store Protocol</a></li>
+      <li>SPARQL Result formats
+        <ul>
+          <li><a href="http://www.w3.org/TR//sparql11-results-json/"
+                 >SPARQL Query Results JSON Format</a></li>
+          <li><a href="http://www.w3.org/TR/sparql11-results-csv-tsv/"
+                 >SPARQL Query Results CSV and TSV Formats</a></li>
+          <li><a href="http://www.w3.org/TR/rdf-sparql-XMLres/"
+                 >SPARQL Query Results XML Format</a></li>
+        </ul>
+      <li><a href="http://www.w3.org/TR/sparql11-service-description/"
+             >SPARQL Service Description</a></li>
+      <li><a href="http://www.w3.org/TR/sparql11-federated-query/"
+             >SPARQL Federated Query</a></li>
+      <li><a href="http://www.w3.org/TR/sparql11-entailment/"
+             >SPARQL Entailment Regimes</a></li>
+    </ul>
+
+    <hr/>
+
+    <p>This server is running 
+      <a href="http://jena.apache.org/documentation/fuseki2/">Apache Jena Fuseki</a>.</p>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/sparqler/pages/iri-validator.html
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/sparqler/pages/iri-validator.html b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/iri-validator.html
new file mode 100755
index 0000000..164b8c6
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/iri-validator.html
@@ -0,0 +1,22 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head><title>SPARQLer Query Validator</title>
+
+  <link rel="stylesheet" type="text/css" href="fuseki.css" />
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+  </head>
+  <body>
+    <h1>SPARQLer IRI Validator</h1>
+
+    <div class="moreindent">
+
+      <form action="validate/iri"  accept-charset="UTF-8">
+	    <p>
+	      <textarea name="iri" cols="70" rows="2"></textarea>
+
+          <input type="submit" value="Validate IRI" />
+	    </p>
+      </form>
+      <hr/>
+    </div>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/sparqler/pages/query-validator.html
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/sparqler/pages/query-validator.html b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/query-validator.html
new file mode 100755
index 0000000..f910650
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/query-validator.html
@@ -0,0 +1,71 @@
+<!--
+   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.
+-->
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head><title>SPARQLer Query Validator</title>
+
+  <link rel="stylesheet" type="text/css" href="fuseki.css" />
+
+  </head>
+  <body>
+    <h1>SPARQLer Query Validator</h1>
+
+    <div class="moreindent">
+
+      <form action="validate/query" method="post" accept-charset="UTF-8">
+	<p>
+	  <textarea name="query" cols="70" rows="30">
+PREFIX xsd:     &lt;http://www.w3.org/2001/XMLSchema#>
+PREFIX rdf:     &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
+PREFIX rdfs:    &lt;http://www.w3.org/2000/01/rdf-schema#>
+PREFIX owl:     &lt;http://www.w3.org/2002/07/owl#>
+PREFIX fn:      &lt;http://www.w3.org/2005/xpath-functions#>
+PREFIX apf:     &lt;http://jena.hpl.hp.com/ARQ/property#>
+PREFIX dc:      &lt;http://purl.org/dc/elements/1.1/>
+
+SELECT ?book ?title
+WHERE
+   { ?book dc:title ?title }</textarea>
+<br/>
+  Input syntax:<br/>
+    <input type="radio" name="languageSyntax" value="SPARQL" checked="checked"/>SPARQL
+    <input type="radio" name="languageSyntax" value="ARQ"/>SPARQL extended syntax
+  <br/>
+  <br/>
+Output:<br/>
+  <input type="checkbox" name="outputFormat" value="sparql" checked="checked"/>SPARQL<br/>
+  <input type="checkbox" name="outputFormat" value="algebra"/>SPARQL algebra<br/>
+  <input type="checkbox" name="outputFormat" value="quads"/>SPARQL algebra (quads)<br/>
+  <input type="checkbox" name="outputFormat" value="opt"/>SPARQL algebra
+(general optimizations)<br/>
+  <input type="checkbox" name="outputFormat" value="optquads"/>SPARQL algebra
+(quads, general optimizations)<br/>
+  <br/>
+  Line numbers:
+  <input type="radio" name="linenumbers" value="true" checked="checked"/>Yes
+  <input type="radio" name="linenumbers" value="false"/>No
+  <br/>
+
+
+  <input type="submit" value="Validate SPARQL Query" />
+	</p>
+      </form>
+
+      <hr/>
+    </div>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/sparqler/pages/query.html
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/sparqler/pages/query.html b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/query.html
new file mode 100755
index 0000000..c8f2ad3
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/query.html
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head><title>SPARQLer</title>
+  <link rel="stylesheet" type="text/css" href="fuseki.css" />
+  </head>
+
+  <body>
+    <h1>SPARQLer - An RDF Query Demo</h1>
+    <p>Example queries (or edit and write your own!).  All the text boxes invoke the same "books" service - they just get initialised with different examples.</p>
+    <hr/>
+
+    <div class="moreindent">
+
+      <form action="books/sparql" method="get">
+	<p>SELECT - get variables (apply XSLT stylesheet)</p>
+    <p><textarea name="query" cols="70" rows="15">
+PREFIX books:   &lt;http://example.org/book/&gt;
+PREFIX dc:      &lt;http://purl.org/dc/elements/1.1/&gt;
+SELECT ?book ?title
+WHERE 
+  { ?book dc:title ?title }</textarea>
+	  <br/>
+
+      Output: <select name="output">
+        <option value="json">JSON</option>
+        <option value="xml">XML</option>
+        <option value="text">Text</option>
+        <option value="csv">CSV</option>
+        <option value="tsv">TSV</option>
+      </select>
+      <br/>
+	  XSLT style sheet (blank for none): 
+      <input name="stylesheet" size="20" value="/xml-to-html.xsl" />
+      <br/>
+      <input type="checkbox" name="force-accept" value="text/plain"/>
+      Force the accept header to <tt>text/plain</tt> regardless 
+	  <br/>
+	   
+	  <input type="submit" value="Get Results" />
+	</p>
+      </form>
+
+      <hr/>
+
+      <form action="books/sparql">
+	<p>CONSTRUCT - return a graph</p>
+	<p><textarea name="query" cols="70" rows="10">
+PREFIX dc:      &lt;http://purl.org/dc/elements/1.1/&gt;
+CONSTRUCT { $book dc:title $title }
+WHERE 
+  { $book dc:title $title }
+	  </textarea>
+	  <br/>
+	  <input type="submit" value="Get Results" />
+	</p>
+      </form>
+      <hr/>
+    </div>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/sparqler/pages/robots.txt
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/sparqler/pages/robots.txt b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/robots.txt
new file mode 100755
index 0000000..1f53798
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/robots.txt
@@ -0,0 +1,2 @@
+User-agent: *
+Disallow: /

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/sparqler/pages/sparql.html
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/sparqler/pages/sparql.html b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/sparql.html
new file mode 100755
index 0000000..53c1d75
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/sparql.html
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head><title>SPARQLer</title>
+    <link rel="stylesheet" type="text/css" href="/fuseki.css" />
+  </head>
+
+  <body>
+    <h1>SPARQLer - General purpose processor</h1>
+
+    <div class="moreindent">
+
+      <form action="sparql" method="get">
+	<p>General SPARQL query : input query, set any options and press "Get Results"</p>
+	<p>
+	  <textarea style="background-color: #F0F0F0;" name="query" cols="70" rows="20"></textarea>
+	  <br/>
+	  Target graph URI (or use <code>FROM</code> in the query)
+	  <input name="default-graph-uri" size="25" value="" />
+    <br/>
+    If no dataset is provided, the query will execute agains an empty one.<br/>
+    The query can contain use <code>VALUES</code> to set some variables.
+    <br/>
+    <br/>
+      Output: <select name="output">
+        <option value="json">JSON</option>
+        <option value="xml">XML</option>
+        <option value="text">Text</option>
+        <option value="csv">CSV</option>
+        <option value="tsv">TSV</option>
+      </select>
+      <br/>
+	  XSLT style sheet (blank for none): 
+      <input name="stylesheet" size="20" value="/xml-to-html.xsl" />
+      <br/>
+      <input type="checkbox" name="force-accept" value="text/plain"/>
+      Force the accept header to <tt>text/plain</tt> regardless 
+	  <br/>
+    <br/>
+	  <input type="submit" value="Get Results" />
+    
+	</p>
+      </form>
+    </div>
+
+    <hr/>
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/sparqler/pages/update-validator.html
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/sparqler/pages/update-validator.html b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/update-validator.html
new file mode 100755
index 0000000..8ac9bbb
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/update-validator.html
@@ -0,0 +1,46 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head><title>SPARQLer Update Validator</title>
+
+  <link rel="stylesheet" type="text/css" href="fuseki.css" />
+
+  </head>
+  <body>
+    <h1>SPARQLer Update Validator</h1>
+
+    <div class="moreindent">
+
+
+      <form action="validate/update" method="post" accept-charset="UTF-8">
+	  <textarea name="update" cols="70" rows="30">
+PREFIX xsd:     &lt;http://www.w3.org/2001/XMLSchema#>
+PREFIX rdf:     &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
+PREFIX rdfs:    &lt;http://www.w3.org/2000/01/rdf-schema#>
+PREFIX owl:     &lt;http://www.w3.org/2002/07/owl#>
+PREFIX fn:      &lt;http://www.w3.org/2005/xpath-functions#>
+PREFIX apf:     &lt;http://jena.hpl.hp.com/ARQ/property#>
+
+</textarea>
+<br/>
+  Input syntax:
+    <input type="radio" name="languageSyntax" value="SPARQL" checked="checked"/>SPARQL
+    <input type="radio" name="languageSyntax" value="ARQ"/>SPARQL extended syntax
+  <br/>
+<!--
+Output syntax:
+  <input type="checkbox" name="outputFormat" value="sparql" checked="checked"/>SPARQL
+  <input type="checkbox" name="outputFormat" value="algebra"/>SPARQL algebra
+  <input type="checkbox" name="outputFormat" value="quads"/>SPARQL algebra (quads)
+  <br/>
+-->
+  Line numbers:
+  <input type="radio" name="linenumbers" value="true" checked="checked"/>Yes
+  <input type="radio" name="linenumbers" value="false"/>No
+  <br/>
+
+  <input type="submit" value="Validate SPARQL Update" />
+      </form>
+
+      <hr/>
+    </div>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/sparqler/pages/update.html
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/sparqler/pages/update.html b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/update.html
new file mode 100755
index 0000000..b390826
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/update.html
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head><title>SPARQLer</title>
+  <link rel="stylesheet" type="text/css" href="fuseki.css" />
+  </head>
+
+  <body>
+    <h1>SPARQLer - SPARQL/Update processor</h1>
+
+    <div class="moreindent">
+
+      <form action="update/service" method="post">
+	<p>General SPARQL/update : input SPARQL/Update request</p>
+	<p>
+	  <textarea style="background-color: #F0F0F0;" name="update" cols="70" rows="20"></textarea>
+	  <input type="submit" value="Perform update" />
+	</p>
+      </form>
+    </div>
+
+    <hr/>
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/sparqler/pages/validator.html
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/sparqler/pages/validator.html b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/validator.html
new file mode 100755
index 0000000..638d5d1
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/validator.html
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <head>
+    <title>SPARQL Query Validator</title>
+    <link rel="stylesheet" type="text/css" href="fuseki.css" />
+    <meta http-equiv="refresh" content="5;url=http://sparql.org/query-validator.html">
+  </head>
+<body>
+    <h1>SPARQLer</h1>
+    
+    <p>
+The SPARQL query validator page has moved to 
+<a href="http://sparql.org/query-validator.html">http://sparql.org/query-validator.html</a>.
+You should be redirected there in a few seconds.
+</p>
+
+    <h2>Validators</h2>
+    <ul>
+      <li><a href="query-validator.html">SPARQL query validator</a></li>
+      <li><a href="update-validator.html">SPARQL update validator</a></li>
+      <li><a href="data-validator.html">RDF data validator</a></li>
+      <li><a href="iri-validator.html">IRI validator</a></li>
+    </ul>
+
+    <hr/>
+
+    <p>This server is running 
+      <a href="http://jena.apache.org/documentation/serving_data/index.html"
+         >Apache Jena Fuseki</a>.</p>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/sparqler/pages/xml-to-html-links.xsl
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/sparqler/pages/xml-to-html-links.xsl b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/xml-to-html-links.xsl
new file mode 100755
index 0000000..9e0a450
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/xml-to-html-links.xsl
@@ -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

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/sparqler/pages/xml-to-html-plain.xsl
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/sparqler/pages/xml-to-html-plain.xsl b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/xml-to-html-plain.xsl
new file mode 100755
index 0000000..1878ab0
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/xml-to-html-plain.xsl
@@ -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>

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/sparqler/pages/xml-to-html.xsl
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/sparqler/pages/xml-to-html.xsl b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/xml-to-html.xsl
new file mode 100755
index 0000000..1878ab0
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/sparqler/pages/xml-to-html.xsl
@@ -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>

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/sparqler/run-sparqler
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/sparqler/run-sparqler b/jena-fuseki2/jena-fuseki-basic/sparqler/run-sparqler
new file mode 100755
index 0000000..93aa84d
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/sparqler/run-sparqler
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+
+## Configuration
+SPARQLER_PAGES="${SPARQLER_PAGES:-pages/}"
+SPARQLER_DATA="${SPARQLER_DATA:-file:data/books.ttl}"
+SPARQLER_DS="${SPARQLER_DS:-/books}"
+
+## Development
+FUSEKI_JAR1="$(echo ../target/jena-fuseki-basic-*-server.jar)"
+## Deployment
+FUSEKI_JAR2="fuseki-basic.jar"
+FUSEKI_JAR3="jena-fuseki-basic-*-server.jar"
+
+# Choose which jar to run
+[[ -e $FUSEKI_JAR3 ]] && FUSEKI_JAR=$FUSEKI_JAR3
+[[ -e $FUSEKI_JAR2 ]] && FUSEKI_JAR=$FUSEKI_JAR2
+[[ -e $FUSEKI_JAR1 ]] && FUSEKI_JAR=$FUSEKI_JAR1
+
+if [ ! -e "$FUSEKI_JAR" ]
+then
+    echo "Can't find the Fuseki jar file: $FUSEKI_JAR" 1>&2
+    exit 1 
+fi
+
+BACKGROUND=${BACKGROUND:-1}
+if [ "$BACKGROUND" = 0 ]
+then
+    LOGCONFIG=${LOGCONFIG:-file:log4j-foreground.properties}
+else
+    LOGCONFIG=${LOGCONFIG:-file:log4j-server.properties}
+fi
+
+export FUSEKI_LOG="-Dlog4j.configuration=${LOGCONFIG}"
+export JVM_ARGS="${JVM_ARGS:--Xmx1200M}"
+
+## SPARQLER_ARGS="--base $SPARQLER_PAGES --file=$SPARQLER_DATA  $SPARQLER_DS"
+## 
+## if [[ $1 == "--help" ]]
+## then
+##     echo "$0"
+##     echo "SPARQLER_PAGES = $SPARQLER_PAGES"
+##     echo "SPARQLER_DATA  = $SPARQLER_DATA"
+##     echo "SPARQLER_DS    = $SPARQLER_DS"
+##     exit 0
+## fi
+
+SPARQLER_ARGS="--base $SPARQLER_PAGES --empty"
+
+set --
+
+if [ "$BACKGROUND" = 0 ]
+then
+    # Run in the foreground
+    exec java $JVM_ARGS $FUSEKI_LOG -jar $FUSEKI_JAR $SPARQLER_ARGS
+else
+    # Run in the background
+    # Linux / nohup
+    nohup java $JVM_ARGS $FUSEKI_LOG -jar $FUSEKI_JAR $SPARQLER_ARGS > nohup.log 2>&1 &
+    # Process ID ... of the script.
+    PROC=$!
+    echo "Server process = $PROC"
+fi

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/src/main/java/org/apache/jena/fuseki/cmds/FusekiBasicCmd.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/src/main/java/org/apache/jena/fuseki/cmds/FusekiBasicCmd.java b/jena-fuseki2/jena-fuseki-basic/src/main/java/org/apache/jena/fuseki/cmds/FusekiBasicCmd.java
new file mode 100644
index 0000000..0ac08a3
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/src/main/java/org/apache/jena/fuseki/cmds/FusekiBasicCmd.java
@@ -0,0 +1,468 @@
+/*
+ * 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 org.apache.jena.fuseki.cmds;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import arq.cmdline.CmdARQ;
+import arq.cmdline.ModAssembler;
+import arq.cmdline.ModDatasetAssembler;
+import jena.cmd.ArgDecl;
+import jena.cmd.CmdException;
+import org.apache.jena.assembler.exceptions.AssemblerException;
+import org.apache.jena.atlas.lib.DateTimeUtils ;
+import org.apache.jena.atlas.lib.FileOps;
+import org.apache.jena.atlas.logging.FmtLog;
+import org.apache.jena.fuseki.Fuseki;
+import org.apache.jena.fuseki.FusekiLogging;
+import org.apache.jena.fuseki.embedded.FusekiEmbeddedServer;
+import org.apache.jena.fuseki.server.DataAccessPoint;
+import org.apache.jena.fuseki.server.DataAccessPointRegistry;
+import org.apache.jena.fuseki.server.DataService;
+import org.apache.jena.fuseki.validation.DataValidator ;
+import org.apache.jena.fuseki.validation.IRIValidator ;
+import org.apache.jena.fuseki.validation.QueryValidator ;
+import org.apache.jena.fuseki.validation.UpdateValidator ;
+import org.apache.jena.query.ARQ;
+import org.apache.jena.query.Dataset;
+import org.apache.jena.riot.Lang;
+import org.apache.jena.riot.RDFDataMgr;
+import org.apache.jena.riot.RDFLanguages;
+import org.apache.jena.sparql.core.DatasetGraph;
+import org.apache.jena.sparql.core.DatasetGraphFactory;
+import org.apache.jena.system.JenaSystem;
+import org.apache.jena.system.Txn;
+import org.apache.jena.tdb.TDB;
+import org.apache.jena.tdb.TDBFactory;
+import org.apache.jena.tdb.transaction.TransactionManager;
+import org.slf4j.Logger;
+
+/** Fuseki command that runs a Fuseki server with no UI, just SPARQL services.
+ * <p>
+ * Use {@code --conf=} for multiple datasets and specific service names. 
+ * <p>
+ * The command line dataset setup only supports a single dataset.
+ */
+
+public class FusekiBasicCmd {
+    // Own module (or optional dependency on jena-cmds)
+    // Needs jena-cmds.
+    
+    static {
+        FusekiLogging.setLogging();
+    }
+
+    static public void main(String... argv) {
+        FusekiCmdInner.innerMain(argv);
+    }
+    
+    /** Dataset setup (command line, config file) for a dataset (or several if config file) */
+    static class ServerConfig {
+        public int port;
+        // Dataset name on the command line.
+        public String    datasetPath      = null; 
+        // Command line --update.
+        public boolean   allowUpdate      = false;
+        
+        // This is set ...
+        public DatasetGraph dsg           = null;
+        // ... or this.
+        public String serverConfig        = null;
+        
+
+        // Allow there to be no registered datasets without it being an error.
+        // which is "return  dsg==null && serverConfig==null;"
+        public boolean allowEmpty              = false ;
+        public boolean loopback           = false;
+        public String datasetDescription;
+        public String contentDirectory    = null;
+    }
+    
+    static class FusekiCmdInner extends CmdARQ {
+        private static int defaultPort = 3030;
+        
+        private static ArgDecl  argMem          = new ArgDecl(ArgDecl.NoValue,  "mem");
+        private static ArgDecl  argUpdate       = new ArgDecl(ArgDecl.NoValue,  "update", "allowUpdate");
+        private static ArgDecl  argFile         = new ArgDecl(ArgDecl.HasValue, "file");
+        private static ArgDecl  argMemTDB       = new ArgDecl(ArgDecl.NoValue,  "memtdb", "memTDB", "tdbmem");
+        private static ArgDecl  argTDB          = new ArgDecl(ArgDecl.HasValue, "loc", "location", "tdb");
+        // No SPARQL dataset or services
+        private static ArgDecl  argEmpty        = new ArgDecl(ArgDecl.NoValue,  "empty", "no-dataset");
+        private static ArgDecl  argPort         = new ArgDecl(ArgDecl.HasValue, "port");
+        private static ArgDecl  argLocalhost    = new ArgDecl(ArgDecl.NoValue,  "localhost", "local");
+        private static ArgDecl  argTimeout      = new ArgDecl(ArgDecl.HasValue, "timeout");
+        private static ArgDecl  argConfig       = new ArgDecl(ArgDecl.HasValue, "config", "conf");
+        private static ArgDecl  argGZip         = new ArgDecl(ArgDecl.HasValue, "gzip");
+        private static ArgDecl  argBase         = new ArgDecl(ArgDecl.HasValue, "base", "files");
+        // private static ModLocation modLocation = new ModLocation();
+        private static ModDatasetAssembler modDataset      = new ModDatasetAssembler();
+
+        static public void innerMain(String... argv) {
+            JenaSystem.init();
+            new FusekiCmdInner(argv).mainRun();
+        }
+
+        private final ServerConfig serverConfig  = new ServerConfig();
+        
+        public FusekiCmdInner(String... argv) {
+            super(argv);
+
+            if ( false )
+                // Consider ...
+                TransactionManager.QueueBatchSize = TransactionManager.QueueBatchSize / 2;
+
+            getUsage().startCategory("Fuseki");
+            addModule(modDataset);
+            add(argMem, "--mem",
+                "Create an in-memory, non-persistent dataset for the server");
+            add(argFile, "--file=FILE",
+                "Create an in-memory, non-persistent dataset for the server, initialised with the contents of the file");
+            add(argTDB, "--loc=DIR",
+                "Use an existing TDB database (or create if does not exist)");
+            add(argMemTDB, "--memTDB",
+                "Create an in-memory, non-persistent dataset using TDB (testing only)");
+//            add(argEmpty, "--empty",
+//                "Run with no datasets and services (validators only)");
+            // Needs FusekiEmbeddedServer.Builder change.
+            add(argEmpty); // Hidden
+            add(argPort, "--port",
+                "Listen on this port number");
+            add(argLocalhost, "--localhost",
+                "Listen only on the localhost interface");
+            add(argTimeout, "--timeout=",
+                "Global timeout applied to queries (value in ms) -- format is X[,Y] ");
+            add(argUpdate, "--update",
+                "Allow updates (via SPARQL Update and SPARQL HTTP Update)");
+            add(argConfig, "--config=",
+                "Use a configuration file to determine the services");
+            add(argGZip, "--gzip=on|off",
+                "Enable GZip compression (HTTP Accept-Encoding) if request header set");
+            add(argBase, "--base=DIR",
+                "Directory for static content");
+
+            super.modVersion.addClass(TDB.class);
+            super.modVersion.addClass(Fuseki.class);
+        }
+
+        static String argUsage = "[--config=FILE] [--mem|--desc=AssemblerFile|--file=FILE] [--port PORT] /DatasetPathName";
+
+        @Override
+        protected String getSummary() {
+            return getCommandName() + " " + argUsage;
+        }
+
+        @Override
+        protected void processModulesAndArgs() {
+            int x = 0;
+
+            Logger log = Fuseki.serverLog;
+
+            // ---- Checking
+
+            if ( contains(argMem) )             
+                x++;
+            if ( contains(argFile) )
+                x++;
+            if ( contains(ModAssembler.assemblerDescDecl) )
+                x++;
+            if ( contains(argTDB) )
+                x++;
+            if ( contains(argMemTDB) )
+                x++;
+            if ( contains(argConfig) )
+                x++;
+
+            boolean allowEmpty = contains(argEmpty);
+            
+            if ( x == 0 && ! allowEmpty )
+                throw new CmdException("No dataset specified on the command line.");
+
+            if ( x > 1 )
+                throw new CmdException("Multiple ways providing a dataset. Only one of --mem, --file, --loc or --desc");
+            
+            if ( x > 0 && allowEmpty )
+                throw new CmdException("Dataset provided but 'no dataset' flag given");
+            
+            //---- check: Invalid: --conf + service name.
+            if ( contains(argConfig) ) {
+                if ( getPositional().size() != 0 )
+                    throw new CmdException("Can't have both a configutation file and a service name");
+            } else if ( ! allowEmpty ) {
+                if ( getPositional().size() == 0 )
+                    throw new CmdException("Missing service name");
+                if ( getPositional().size() > 1 )
+                    throw new CmdException("Multiple dataset path names given");
+                serverConfig.datasetPath = DataAccessPoint.canonical(getPositionalArg(0));
+            }
+            
+            serverConfig.datasetDescription = "<unset>";
+            
+            // ---- check: Invalid: --update + --conf
+            if ( contains(argUpdate) && contains(argConfig) )
+                throw new CmdException("--update and a configuration file does not make sense (control using the configuration file only)");
+            boolean allowUpdate = contains(argUpdate);
+            serverConfig.allowUpdate = allowUpdate;
+
+            // ---- Port
+            serverConfig.port = defaultPort;
+            
+            if ( contains(argPort) ) {
+                String portStr = getValue(argPort);
+                try {
+                    int port = Integer.parseInt(portStr);
+                    serverConfig.port = port;
+                } catch (NumberFormatException ex) {
+                    throw new CmdException(argPort.getKeyName() + " : bad port number: " + portStr);
+                }
+            }
+            if ( contains(argLocalhost) )
+                serverConfig.loopback = true;
+
+            // ---- Dataset
+            // Only one of these is choose from the checking above.
+            
+            if ( allowEmpty ) {
+                serverConfig.allowEmpty = true;
+                serverConfig.datasetDescription = "No dataset";
+            }                
+
+            // Fuseki config file 
+            if ( contains(argConfig) ) {
+                String file = getValue(argConfig);
+                if ( file.startsWith("file:") )
+                    file = file.substring("file:".length());
+                
+                Path path = Paths.get(file);
+                if ( ! Files.exists(path) )
+                    throw new CmdException("File not found: "+file);
+                if ( Files.isDirectory(path) )
+                    throw new CmdException("Is a directory: "+file);
+                serverConfig.datasetDescription = "Configuration: "+path.toAbsolutePath();
+                serverConfig.serverConfig = getValue(argConfig);
+            }
+            
+            // Ways to setup a dataset.
+            if ( contains(argMem) ) {
+                serverConfig.datasetDescription = "in-memory";
+                // Only one setup should be called by the test above but to be safe
+                // and in case of future changes, clear the configuration.  
+                serverConfig.dsg = DatasetGraphFactory.createTxnMem();
+                // Always allow, else you can't do very much! 
+                serverConfig.allowUpdate = true;
+            }
+
+            if ( contains(argFile) ) {
+                String filename = getValue(argFile);
+                String pathname = filename;
+                if ( filename.startsWith("file:") )
+                    pathname = filename.substring("file:".length());
+
+                serverConfig.datasetDescription = "file:"+filename;
+                if ( !FileOps.exists(pathname) )
+                    throw new CmdException("File not found: " + filename);
+                serverConfig.dsg = DatasetGraphFactory.createTxnMem();
+                
+                // INITIAL DATA.
+                Lang language = RDFLanguages.filenameToLang(filename);
+                if ( language == null )
+                    throw new CmdException("Can't guess language for file: " + filename);
+                Txn.executeWrite(serverConfig.dsg,  ()->RDFDataMgr.read(serverConfig.dsg, filename));
+            }
+
+            if ( contains(argMemTDB) ) {
+                serverConfig.datasetDescription = "TDB dataset in-memory";
+                serverConfig.dsg = TDBFactory.createDatasetGraph();
+                serverConfig.allowUpdate = true;
+            }
+
+            if ( contains(argTDB) ) {
+                String dir = getValue(argTDB);
+                serverConfig.datasetDescription = "TDB dataset: "+dir;
+                serverConfig.dsg = TDBFactory.createDatasetGraph(dir);
+            }
+
+            if ( contains(ModAssembler.assemblerDescDecl) ) {
+                serverConfig.datasetDescription = "Assembler: "+ getValue(ModAssembler.assemblerDescDecl);
+                // Need to add service details.
+                Dataset ds = modDataset.createDataset();
+                serverConfig.dsg = ds.asDatasetGraph();
+            }
+
+            // ---- Misc features.
+            if ( contains(argTimeout) ) {
+                String str = getValue(argTimeout);
+                ARQ.getContext().set(ARQ.queryTimeout, str);
+            }
+            
+            if ( contains(argBase) ) {
+                // Static files.
+                String filebase = getValue(argBase);
+                if ( ! FileOps.exists(filebase) ) {
+                    throw new CmdException("File area not found: "+filebase); 
+                    //FmtLog.warn(Fuseki.configLog, "File area not found: "+filebase);  
+                }
+                serverConfig.contentDirectory = filebase;
+            }
+
+//            if ( contains(argGZip) ) {
+//                if ( !hasValueOfTrue(argGZip) && !hasValueOfFalse(argGZip) )
+//                    throw new CmdException(argGZip.getNames().get(0) + ": Not understood: " + getValue(argGZip));
+//                jettyServerConfig.enableCompression = super.hasValueOfTrue(argGZip);
+//            }
+        }
+
+//        private static String sort_out_dir(String path) {
+//            path.replace('\\', '/');
+//            if ( !path.endsWith("/") )
+//                path = path + "/";
+//            return path;
+//        }
+
+        @Override
+        protected void exec() {
+            try {
+                FusekiEmbeddedServer server = buildServer(serverConfig);
+                info(server, serverConfig);
+                server.start();
+                server.join();
+                System.exit(0);
+            }
+            catch (AssemblerException ex) {
+                if ( ex.getCause() != null )
+                    System.err.println(ex.getCause().getMessage());
+                else
+                    System.err.println(ex.getMessage());
+            }
+        }
+
+        // ServerConfig -> Setup the builder.
+        private static FusekiEmbeddedServer buildServer(ServerConfig serverConfig) {
+            FusekiEmbeddedServer.Builder builder = FusekiEmbeddedServer.create();
+            // Loopback.
+            builder.setPort(serverConfig.port);
+            builder.setLoopback(serverConfig.loopback);
+            
+            if ( ! serverConfig.allowEmpty ) {
+                if ( serverConfig.serverConfig != null )
+                    // Config file.
+                    builder.parseConfigFile(serverConfig.serverConfig);
+                else
+                    // One dataset.
+                    builder.add(serverConfig.datasetPath, serverConfig.dsg, serverConfig.allowUpdate);
+            }
+            if ( serverConfig.contentDirectory != null )
+                builder.setStaticFileBase(serverConfig.contentDirectory) ;
+
+            // Validators.
+            builder.addServlet("/validate/query",  new QueryValidator());
+            builder.addServlet("/validate/update", new UpdateValidator());
+            builder.addServlet("/validate/iri",    new IRIValidator());
+            builder.addServlet("/validate/data",   new DataValidator());
+            
+            return builder.build();
+        }
+
+        private void info(FusekiEmbeddedServer server, ServerConfig serverConfig) {
+            if ( super.isQuiet() )
+                return;
+
+            Logger log = Fuseki.serverLog;
+
+            String version = Fuseki.VERSION;
+            String buildDate = Fuseki.BUILD_DATE ;
+
+            if ( version != null && version.equals("${project.version}") )
+                version = null ;
+            if ( buildDate != null && buildDate.equals("${build.time.xsd}") )
+                buildDate = DateTimeUtils.nowAsXSDDateTimeString() ;
+            
+            String name = Fuseki.NAME;
+            name = name +" (basic server)";
+            
+            if ( version != null ) {
+                if ( Fuseki.developmentMode && buildDate != null )
+                    FmtLog.info(log, "%s %s %s", name, version, buildDate) ;
+                else
+                    FmtLog.info(log, "%s %s", name, version);
+            }
+            
+            // Dataset -> Endpoints
+            Map<String, List<String>> z = description(DataAccessPointRegistry.get(server.getServletContext()));
+            
+            if ( serverConfig.allowEmpty ) {
+                FmtLog.info(log, "No SPARQL datasets services"); 
+            } else {
+                if ( serverConfig.datasetPath == null && serverConfig.serverConfig == null )
+                    log.error("No dataset path nor server configuration file");
+            }
+            
+            if ( serverConfig.datasetPath != null ) {
+                if ( z.size() != 1 )
+                    log.error("Expected only one dataset");
+                List<String> endpoints = z.get(serverConfig.datasetPath); 
+                FmtLog.info(log,  "Dataset Type = %s", serverConfig.datasetDescription);
+                FmtLog.info(log,  "Path = %s; Services = %s", serverConfig.datasetPath, endpoints);
+            }
+            if ( serverConfig.serverConfig != null ) {
+                // May be many datasets and services.
+                FmtLog.info(log,  "Configuration file %s", serverConfig.serverConfig);
+                z.forEach((path, endpoints)->{
+                    FmtLog.info(log,  "Path = %s; Services = %s", path, endpoints);
+                });
+            }
+            
+            if ( serverConfig.contentDirectory != null )
+                FmtLog.info(log,  "Static files = %s", serverConfig.contentDirectory);
+                
+            if ( super.isVerbose() )
+                PlatformInfo.logDetailsVerbose(log);
+            else if ( !super.isQuiet() )
+                PlatformInfo.logDetails(log);
+        }
+
+        private static Map<String, List<String>> description(DataAccessPointRegistry reg) {
+            Map<String, List<String>> desc = new LinkedHashMap<>();
+            reg.forEach((ds,dap)->{
+                List<String> endpoints = new ArrayList<>();
+                desc.put(ds, endpoints);
+                DataService dSrv = dap.getDataService();
+                dSrv.getOperations().forEach((opName)->{
+                    dSrv.getOperation(opName).forEach(ep-> {
+                        String x = ep.getEndpoint();
+                        if ( x.isEmpty() )
+                            x = "quads";
+                        endpoints.add(x);   
+                    });
+                });
+            });
+            return desc;
+        }
+        
+        @Override
+        protected String getCommandName() {
+            return "fuseki";
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/src/main/java/org/apache/jena/fuseki/cmds/PlatformInfo.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/src/main/java/org/apache/jena/fuseki/cmds/PlatformInfo.java b/jena-fuseki2/jena-fuseki-basic/src/main/java/org/apache/jena/fuseki/cmds/PlatformInfo.java
new file mode 100644
index 0000000..86cc5da
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/src/main/java/org/apache/jena/fuseki/cmds/PlatformInfo.java
@@ -0,0 +1,122 @@
+/*
+ * 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 org.apache.jena.fuseki.cmds;
+
+import java.io.IOException;
+import java.util.function.Function;
+
+import org.apache.jena.atlas.logging.FmtLog;
+import org.slf4j.Logger;
+
+public class PlatformInfo {
+    
+    public static void main(String ...args) throws IOException {
+        long maxMem = Runtime.getRuntime().maxMemory();
+        long totalMem = Runtime.getRuntime().totalMemory();
+        long freeMem = Runtime.getRuntime().freeMemory();
+        long usedMem = totalMem - freeMem;
+        Function<Long, String> f = PlatformInfo::strNumMixed;
+        
+        System.out.printf("max=%s  total=%s  used=%s  free=%s\n", f.apply(maxMem), f.apply(totalMem), f.apply(usedMem), f.apply(freeMem));
+    }
+    
+    /** Essential information about the runtime environment. */
+    
+    public static void logDetails(Logger log) {
+        logDetails(log, "  ");
+    }
+    
+    /**
+     * Essential information about the runtime environment
+     * @param log
+     * @param prefix String to add at the start of the log message.
+     */
+    public static void logDetails(Logger log, String prefix) {
+        if ( prefix == null )
+            prefix = "";
+        long maxMem = Runtime.getRuntime().maxMemory();
+        long totalMem = Runtime.getRuntime().totalMemory();
+        long freeMem = Runtime.getRuntime().freeMemory();
+        long usedMem = totalMem - freeMem;
+        Function<Long, String> f = PlatformInfo::strNum2;
+        FmtLog.info(log, "%sMemory: %s", prefix, f.apply(maxMem));
+        //FmtLog.info(log, "%sMemory: max=%s  total=%s  used=%s  free=%s", prefix, f.apply(maxMem), f.apply(totalMem), f.apply(usedMem), f.apply(freeMem));
+        FmtLog.info(log, "%sJava:   %s", prefix, System.getProperty("java.version"));
+        FmtLog.info(log, "%sOS:     %s %s %s", prefix, System.getProperty("os.name"), System.getProperty("os.version"), System.getProperty("os.arch"));
+    }
+
+    public static void logDetailsVerbose(Logger log) {
+        logDetails(log);
+        logOne(log, "java.vendor");
+        logOne(log, "java.home");
+        logOne(log, "java.runtime.version");
+        logOne(log, "java.runtime.name");
+        //logOne(log, "java.endorsed.dirs");
+        logOne(log, "user.language");
+        logOne(log, "user.timezone");
+        logOne(log, "user.country");
+        logOne(log, "user.dir");
+        //logOne(log, "file.encoding");
+    }
+    
+    private static void logOne(Logger log, String property) {
+        FmtLog.info(log, "    %-20s = %s", property, System.getProperty(property));
+    }
+
+    /** Create a human-friendly string for a number based on Kilo/Mega/Giga/Tera (powers of 2) */
+    public static String strNumMixed(long x) {
+        // https://en.wikipedia.org/wiki/Kibibyte
+        if ( x < 1024 )
+            return Long.toString(x);
+        if ( x < 1024*1024 )
+            return String.format("%.1fK", x/1024.0);
+        if ( x < 1024*1024*1024 )
+            return String.format("%.1fM", x/(1024.0*1024));
+        if ( x < 1024L*1024*1024*1024 )
+            return String.format("%.1fG", x/(1024.0*1024*1024));
+        return String.format("%.1fT", x/(1024.0*1024*1024*1024));
+    }
+
+    /** Create a human-friendly string for a number based on Kilo/Mega/Giga/Tera (powers of 10) */
+    public static String strNum10(long x) {
+        if ( x < 1_000 )
+            return Long.toString(x);
+        if ( x < 1_000_000 )
+            return String.format("%.1fK", x/1000.0);
+        if ( x < 1_000_000_000 )
+            return String.format("%.1fM", x/(1000.0*1000));
+        if ( x < 1_000_000_000_000L )
+            return String.format("%.1fG", x/(1000.0*1000*1000));
+        return String.format("%.1fT", x/(1000.0*1000*1000*1000));
+    }
+    
+    /** Create a human-friendly string for a number based on Kibi/Mebi/Gibi/Tebi (powers of 2) */
+    public static String strNum2(long x) {
+        // https://en.wikipedia.org/wiki/Kibibyte
+        if ( x < 1024 )
+            return Long.toString(x);
+        if ( x < 1024*1024 )
+            return String.format("%.1f KiB", x/1024.0);
+        if ( x < 1024*1024*1024 )
+            return String.format("%.1f MiB", x/(1024.0*1024));
+        if ( x < 1024L*1024*1024*1024 )
+            return String.format("%.1f GiB", x/(1024.0*1024*1024));
+        return String.format("%.1fTiB", x/(1024.0*1024*1024*1024));
+    }
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/pom.xml
----------------------------------------------------------------------
diff --git a/jena-fuseki2/pom.xml b/jena-fuseki2/pom.xml
index 5bdc4a1..1986f2a 100644
--- a/jena-fuseki2/pom.xml
+++ b/jena-fuseki2/pom.xml
@@ -72,6 +72,7 @@
     <module>jena-fuseki-embedded</module>
     <module>jena-fuseki-war</module>
     <module>jena-fuseki-server</module>
+    <module>jena-fuseki-basic</module>
     <module>apache-jena-fuseki</module>
   </modules>
   


Mime
View raw message