http://git-wip-us.apache.org/repos/asf/jena/blob/36855e1b/jena-fuseki2/dist/NOTICE-dist
----------------------------------------------------------------------
diff --git a/jena-fuseki2/dist/NOTICE-dist b/jena-fuseki2/dist/NOTICE-dist
new file mode 100644
index 0000000..a840c0b
--- /dev/null
+++ b/jena-fuseki2/dist/NOTICE-dist
@@ -0,0 +1,216 @@
+Apache Jena - module Fuseki
+Copyright 2011-2013 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+Portions of this software were originally based on the following:
+  - Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 
Hewlett-Packard Development Company, LP
+  - Copyright 2010, 2011 Epimorphics Ltd.
+  - Copyright 2010, 2011 Talis Systems Ltd.
+These have been licensed to the Apache Software Foundation under a software 
grant.
+
+- - - - - - - - - - - - - - - - - - - - - - - 
+
+slf4j:
+ Copyright (c) 2004-2011 QOS.ch
+ All rights reserved.
+
+- - - - - - - - - - - - - - - - - - - - - - -
+
+(c) Copyright 2003, Plugged In Software 
+This product includes software developed by
+PluggedIn Software under a BSD license.
+
+- - - - - - - - - - - - - - - - - - - - - - -
+
+ Jetty Web Container
+ Copyright 1995-2012 Mort Bay Consulting Pty Ltd.
+
+under the Apache 2.0 License. 
+
+The Jetty Web Container includes:
+
+UnixCrypt.java
+Copyright 1996 Aki Yoshida,
+modified April 2001  by Iris Van den Broeke, Daniel Deville.
+
+- - - - - - - - - - - - - - - - - - - - - - -
+
+From Apache HttpComponents Client:
+
+This project contains annotations derived from JCIP-ANNOTATIONS
+Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
+
+- - - - - - - - - - - - - - - - - - - - - - -
+
+  Apache Xerces Java
+   Copyright 1999-2013 The Apache Software Foundation
+
+   This product includes software developed at
+   The Apache Software Foundation (http://www.apache.org/).
+
+   Portions of this software were originally based on the following:
+     - software copyright (c) 1999, IBM Corporation., http://www.ibm.com.
+     - software copyright (c) 1999, Sun Microsystems., http://www.sun.com.
+     - voluntary contributions made by Paul Eng on behalf of the 
+       Apache Software Foundation that were originally developed at iClick, 
Inc.,
+       software copyright (c) 1999.
+
+- - - - - - - - - - - - - - - - - - - - - - -
+
+From Apache Lucene:
+
+ICU4J, (under analysis/icu) is licensed under an MIT styles license
+and Copyright (c) 1995-2008 International Business Machines Corporation and 
others
+
+Some data files (under analysis/icu/src/data) are derived from Unicode data 
such
+as the Unicode Character Database. See http://unicode.org/copyright.html for 
more
+details.
+
+Brics Automaton (under core/src/java/org/apache/lucene/util/automaton) is 
+BSD-licensed, created by Anders Møller. See http://www.brics.dk/automaton/
+
+The levenshtein automata tables (under 
core/src/java/org/apache/lucene/util/automaton) were
+automatically generated with the moman/finenight FSA library, created by
+Jean-Philippe Barrette-LaPierre. This library is available under an MIT 
license,
+see http://sites.google.com/site/rrettesite/moman and 
+http://bitbucket.org/jpbarrette/moman/overview/
+
+This product includes code (JaspellTernarySearchTrie) from Java Spelling 
+Checking Package (jaspell): http://jaspell.sourceforge.net/
+License: The BSD License (http://www.opensource.org/licenses/bsd-license.php)
+
+The snowball stemmers in
+  analysis/common/src/java/net/sf/snowball
+were developed by Martin Porter and Richard Boulton.
+The snowball stopword lists in
+  analysis/common/src/resources/org/apache/lucene/analysis/snowball
+were developed by Martin Porter and Richard Boulton.
+The full snowball package is available from
+  http://snowball.tartarus.org/
+
+The KStem stemmer in
+  analysis/common/src/org/apache/lucene/analysis/en
+was developed by Bob Krovetz and Sergio Guzman-Lara (CIIR-UMass Amherst)
+under the BSD-license.
+
+The Arabic,Persian,Romanian,Bulgarian, and Hindi analyzers (common) come with 
a default
+stopword list that is BSD-licensed created by Jacques Savoy.
+See http://members.unine.ch/jacques.savoy/clef/index.html.
+
+The German,Spanish,Finnish,French,Hungarian,Italian,Portuguese,Russian and 
Swedish light stemmers
+(common) are based on BSD-licensed reference implementations created by 
Jacques Savoy and
+Ljiljana Dolamic.
+
+The Stempel analyzer (stempel) includes BSD-licensed software developed 
+by the Egothor project http://egothor.sf.net/, created by Leo Galambos, Martin 
Kvapil,
+and Edmond Nolan.
+
+The Polish analyzer (stempel) comes with a default
+stopword list that is BSD-licensed created by the Carrot2 project. The file 
resides
+in stempel/src/resources/org/apache/lucene/analysis/pl/stopwords.txt.
+See http://project.carrot2.org/license.html.
+
+The SmartChineseAnalyzer source code (smartcn) was
+provided by Xiaoping Gao and copyright 2009 by www.imdict.net.
+
+WordBreakTestUnicode_*.java (under modules/analysis/common/src/test/) 
+is derived from Unicode data such as the Unicode Character Database. 
+See http://unicode.org/copyright.html for more details.
+
+The Morfologik analyzer (morfologik) includes BSD-licensed software
+developed by Dawid Weiss and Marcin Miłkowski 
(http://morfologik.blogspot.com/).
+
+Morfologik uses data from Polish ispell/myspell dictionary
+(http://www.sjp.pl/slownik/en/) licenced on the terms of (inter alia)
+LGPL and Creative Commons ShareAlike.
+
+Morfologic includes data from BSD-licensed dictionary of Polish (SGJP)
+(http://sgjp.pl/morfeusz/)
+
+Servlet-api.jar and javax.servlet-*.jar are under the CDDL license, the 
original
+source code for this can be found at http://www.eclipse.org/jetty/downloads.php
+
+===========================================================================
+Kuromoji Japanese Morphological Analyzer - Apache Lucene Integration
+===========================================================================
+
+This software includes a binary and/or source version of data from
+
+  mecab-ipadic-2.7.0-20070801
+
+which can be obtained from
+
+  http://atilika.com/releases/mecab-ipadic/mecab-ipadic-2.7.0-20070801.tar.gz
+
+or
+
+  
http://jaist.dl.sourceforge.net/project/mecab/mecab-ipadic/2.7.0-20070801/mecab-ipadic-2.7.0-20070801.tar.gz
+
+===========================================================================
+mecab-ipadic-2.7.0-20070801 Notice
+===========================================================================
+
+Nara Institute of Science and Technology (NAIST),
+the copyright holders, disclaims all warranties with regard to this
+software, including all implied warranties of merchantability and
+fitness, in no event shall NAIST be liable for
+any special, indirect or consequential damages or any damages
+whatsoever resulting from loss of use, data or profits, whether in an
+action of contract, negligence or other tortuous action, arising out
+of or in connection with the use or performance of this software.
+
+A large portion of the dictionary entries
+originate from ICOT Free Software.  The following conditions for ICOT
+Free Software applies to the current dictionary as well.
+
+Each User may also freely distribute the Program, whether in its
+original form or modified, to any third party or parties, PROVIDED
+that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear
+on, or be attached to, the Program, which is distributed substantially
+in the same form as set out herein and that such intended
+distribution, if actually made, will neither violate or otherwise
+contravene any of the laws and regulations of the countries having
+jurisdiction over the User or the intended distribution itself.
+
+NO WARRANTY
+
+The program was produced on an experimental basis in the course of the
+research and development conducted during the project and is provided
+to users as so produced on an experimental basis.  Accordingly, the
+program is provided without any warranty whatsoever, whether express,
+implied, statutory or otherwise.  The term "warranty" used herein
+includes, but is not limited to, any warranty of the quality,
+performance, merchantability and fitness for a particular purpose of
+the program and the nonexistence of any infringement or violation of
+any right of any third party.
+
+Each user of the program will agree and understand, and be deemed to
+have agreed and understood, that there is no warranty whatsoever for
+the program and, accordingly, the entire risk arising from or
+otherwise connected with the program is assumed by the user.
+
+Therefore, neither ICOT, the copyright holder, or any other
+organization that participated in or was otherwise related to the
+development of the program and their respective officials, directors,
+officers and other employees shall be held liable for any and all
+damages, including, without limitation, general, special, incidental
+and consequential damages, arising out of or otherwise in connection
+with the use or inability to use the program or any product, material
+or result produced or otherwise obtained by using the program,
+regardless of whether they have been advised of, or otherwise had
+knowledge of, the possibility of such damages at any time during the
+project or thereafter.  Each user will be deemed to have agreed to the
+foregoing by his or her commencement of use of the program.  The term
+"use" as used herein includes, but is not limited to, the use,
+modification, copying and distribution of the program and the
+production of secondary products from the program.
+
+In the case where the program, whether in its original form or
+modified, was distributed or delivered to or received by a user from
+any person, organization or entity other than ICOT, unless it makes or
+grants independently of ICOT any specific warranty to the user in
+writing, such person, organization or entity, will also be exempted
+from and not be held liable to the user for any such damages as noted
+above as far as the program is concerned.

http://git-wip-us.apache.org/repos/asf/jena/blob/36855e1b/jena-fuseki2/dwim
----------------------------------------------------------------------
diff --git a/jena-fuseki2/dwim b/jena-fuseki2/dwim
new file mode 100755
index 0000000..34eaab6
--- /dev/null
+++ b/jena-fuseki2/dwim
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+
+curl -XPOST --header "Content-type: text/trig" --data-binary @D.trig \
+     http://localhost:3030/ds/data

http://git-wip-us.apache.org/repos/asf/jena/blob/36855e1b/jena-fuseki2/dwim-upload
----------------------------------------------------------------------
diff --git a/jena-fuseki2/dwim-upload b/jena-fuseki2/dwim-upload
new file mode 100755
index 0000000..555919f
--- /dev/null
+++ b/jena-fuseki2/dwim-upload
@@ -0,0 +1,32 @@
+#!/bin/bash
+# How to do a file upload in curl
+
+# GSP strict
+U='http://localhost:3030/ds/data?graph=http://example/G'
+# PUT
+## curl --upload-file D.ttl --header 'Content-Type: text/turtle' "$U"
+
+# POST
+curl -XPOST --upload-file D.ttl --header 'Content-Type: text/turtle' "$U"
+
+# GSP strict / file upload
+## curl -F 'file=@D.ttl' http://localhost:3030/ds/data
+
+# Quads to GSP
+
+## curl -F 'file=@D.ttl' http://localhost:3030/ds/data
+## curl -F 'file=@D.trig' http://localhost:3030/ds/data
+
+# Quads to graph : NGs in data ignored
+# curl -F 'file=@D.trig' 'http://localhost:3030/ds/data?default'
+#curl -F 'file=@D.trig' 'http://localhost:3030/ds/data?graph=http://example/G'
+
+# Dataset
+## curl -F 'file=@D.trig' http://localhost:3030/ds
+
+# Upload service
+## curl -F 'file=@D.trig' -F 'name=http://graph/' 
'http://localhost:3030/ds/upload'
+
+
+echo "==== Dataset"
+curl  http://localhost:3030/ds

http://git-wip-us.apache.org/repos/asf/jena/blob/36855e1b/jena-fuseki2/examples/README
----------------------------------------------------------------------
diff --git a/jena-fuseki2/examples/README b/jena-fuseki2/examples/README
new file mode 100644
index 0000000..1c51b9e
--- /dev/null
+++ b/jena-fuseki2/examples/README
@@ -0,0 +1,6 @@
+This directory includes some examples - they will need to be adapted to
+local requirements.
+
+service-* ; Examples of service assembler descriptions
+
+jetty-fuseki.xml : A Jetty XML configuration file.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jena/blob/36855e1b/jena-fuseki2/examples/jetty-fuseki.xml
----------------------------------------------------------------------
diff --git a/jena-fuseki2/examples/jetty-fuseki.xml 
b/jena-fuseki2/examples/jetty-fuseki.xml
new file mode 100644
index 0000000..4087364
--- /dev/null
+++ b/jena-fuseki2/examples/jetty-fuseki.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" 
"http://www.eclipse.org/jetty/configure.dtd";>
+ 
+<!-- 
+Simple example of using a jetty configuration file for setting up a Jetty 
server.
+-->
+
+<!-- 
+http://www.eclipse.org/jetty/documentation/current/configuring-connectors.html
+-->
+
+<Configure id="Server" class="org.eclipse.jetty.server.Server">
+  <Call name="addConnector">
+    <Arg>
+      <New class="org.eclipse.jetty.server.ServerConnector">
+       <Arg name="server"><Ref refid="Server" /></Arg>
+       <Arg name="factories">
+         <Array type="org.eclipse.jetty.server.ConnectionFactory">
+           <Item>
+             <New class="org.eclipse.jetty.server.HttpConnectionFactory">
+               <Arg name="config"><Ref refid="httpConfig" /></Arg>
+             </New>
+           </Item>
+         </Array>
+       </Arg>
+        <Set name="port"><Property name="jetty.port" default="3535" /></Set>
+       <!--<Set name="host"><Property name="jetty.host" default="localhost" 
/></Set>-->
+      </New>
+    </Arg>
+  </Call>
+</Configure>

http://git-wip-us.apache.org/repos/asf/jena/blob/36855e1b/jena-fuseki2/examples/service-inference-1.ttl
----------------------------------------------------------------------
diff --git a/jena-fuseki2/examples/service-inference-1.ttl 
b/jena-fuseki2/examples/service-inference-1.ttl
new file mode 100644
index 0000000..5fe894b
--- /dev/null
+++ b/jena-fuseki2/examples/service-inference-1.ttl
@@ -0,0 +1,39 @@
+## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
+
+# Example of a data service with only SPARQL query on an 
+# in-memory inference model.  Data is taken from a file
+# when the data service is started.
+
+@prefix :        <#> .
+@prefix fuseki:  <http://jena.apache.org/fuseki#> .
+@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .
+@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
+
+## Service with only SPARQL query on an inference model.
+## Inference model bbase data in TDB.
+
+<#service1>  rdf:type fuseki:Service ;
+    fuseki:name              "inf-mem" ;
+    fuseki:serviceQuery      "sparql" ;          # SPARQL query service
+    fuseki:dataset           <#dataset> ;
+    .
+
+# Dataset with only the default graph.
+<#dataset> rdf:type       ja:RDFDataset ;
+    ja:defaultGraph       <#model_inf> ;
+     .
+
+# The inference model
+<#model_inf> a ja:InfModel ;
+     ja:baseModel <#baseModel> ;
+     ja:reasoner [
+         ja:reasonerURL <http://jena.hpl.hp.com/2003/OWLFBRuleReasoner>
+     ] .
+
+# The base data.
+<#baseModel> a ja:MemoryModel ;
+    ja:content [ja:externalContent <file:Data/data.ttl> ] ;
+    .

http://git-wip-us.apache.org/repos/asf/jena/blob/36855e1b/jena-fuseki2/examples/service-inference-2.ttl
----------------------------------------------------------------------
diff --git a/jena-fuseki2/examples/service-inference-2.ttl 
b/jena-fuseki2/examples/service-inference-2.ttl
new file mode 100644
index 0000000..b036fa6
--- /dev/null
+++ b/jena-fuseki2/examples/service-inference-2.ttl
@@ -0,0 +1,43 @@
+## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
+
+@prefix :        <#> .
+@prefix fuseki:  <http://jena.apache.org/fuseki#> .
+@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .
+@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
+
+# Example of a data service with SPARQL query abnd update on an 
+# inference model.  Data is taken from TDB.
+
+## ---------------------------------------------------------------
+## Service with only SPARQL query on an inference model.
+## Inference model base data is in TDB.
+
+<#service2>  rdf:type fuseki:Service ;
+    fuseki:name              "inf" ;             # http://host/inf
+    fuseki:serviceQuery      "sparql" ;          # SPARQL query service
+    fuseki:serviceUpdate     "update" ;
+    fuseki:dataset           <#dataset> ;
+    .
+
+<#dataset> rdf:type       ja:RDFDataset ;
+    ja:defaultGraph       <#model_inf> ;
+     .
+
+<#model_inf> a ja:InfModel ;
+     ja:baseModel <#tdbGraph> ;
+     ja:reasoner [
+         ja:reasonerURL <http://jena.hpl.hp.com/2003/OWLFBRuleReasoner>
+     ] .
+
+## Base data in TDB.
+<#tdbDataset> rdf:type tdb:DatasetTDB ;
+    tdb:location "DB" ;
+    # If the unionDefaultGraph is used, then the "update" service should be 
removed.
+    # tdb:unionDefaultGraph true ;
+    .
+
+<#tdbGraph> rdf:type tdb:GraphTDB ;
+    tdb:dataset <#tdbDataset> .

http://git-wip-us.apache.org/repos/asf/jena/blob/36855e1b/jena-fuseki2/examples/service-tdb-1.ttl
----------------------------------------------------------------------
diff --git a/jena-fuseki2/examples/service-tdb-1.ttl 
b/jena-fuseki2/examples/service-tdb-1.ttl
new file mode 100644
index 0000000..8f0c34a
--- /dev/null
+++ b/jena-fuseki2/examples/service-tdb-1.ttl
@@ -0,0 +1,29 @@
+## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
+
+## Example of a TDB dataset published using Fuseki
+## Persistent storage.
+## read-only
+
+@prefix :        <#> .
+@prefix fuseki:  <http://jena.apache.org/fuseki#> .
+@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .
+@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
+
+## Read-only TDB dataset (only read services enabled).
+
+<#service_tdb_read_only> rdf:type fuseki:Service ;
+    rdfs:label                      "TDB Service (R)" ;
+    fuseki:name                     "ds" ;
+    fuseki:serviceQuery             "query" ;
+    fuseki:serviceQuery             "sparql" ;
+    fuseki:serviceReadGraphStore    "data" ;
+    fuseki:serviceReadGraphStore    "get" ;
+    fuseki:dataset           <#tdb_dataset_read> ;
+    .
+
+<#tdb_dataset_read> rdf:type      tdb:DatasetTDB ;
+    tdb:location "DB1" ;
+    tdb:unionDefaultGraph true ;
+    .

http://git-wip-us.apache.org/repos/asf/jena/blob/36855e1b/jena-fuseki2/examples/service-tdb-2.ttl
----------------------------------------------------------------------
diff --git a/jena-fuseki2/examples/service-tdb-2.ttl 
b/jena-fuseki2/examples/service-tdb-2.ttl
new file mode 100644
index 0000000..09a2151
--- /dev/null
+++ b/jena-fuseki2/examples/service-tdb-2.ttl
@@ -0,0 +1,32 @@
+## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
+
+## Example of a TDB dataset published using Fuseki
+## Persistent storage.  
+## All services enabled.
+
+@prefix :        <#> .
+@prefix fuseki:  <http://jena.apache.org/fuseki#> .
+@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .
+@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
+
+<#service_tdb_all> rdf:type fuseki:Service ;
+    rdfs:label                      "TDB Service (RW)" ;
+    fuseki:name                     "data" ;
+    fuseki:serviceQuery             "query" ;
+    fuseki:serviceQuery             "sparql" ;
+    fuseki:serviceUpdate            "update" ;
+    fuseki:serviceUpload            "upload" ;
+    fuseki:serviceReadWriteGraphStore      "data" ;
+    # A separate read-only graph store endpoint:
+    fuseki:serviceReadGraphStore       "get" ;
+    fuseki:dataset           <#tdb_dataset_readwrite> ;
+    .
+
+<#tdb_dataset_readwrite> rdf:type      tdb:DatasetTDB ;
+    tdb:location "DB2" ;
+##     # Query timeout on this dataset (milliseconds)
+##     ja:context [ ja:cxtName "arq:queryTimeout" ;  ja:cxtValue "1000" ] ;
+##     # Default graph for query is the (read-only) union of all named graphs.
+     .

http://git-wip-us.apache.org/repos/asf/jena/blob/36855e1b/jena-fuseki2/examples/service-tdb-mem.ttl
----------------------------------------------------------------------
diff --git a/jena-fuseki2/examples/service-tdb-mem.ttl 
b/jena-fuseki2/examples/service-tdb-mem.ttl
new file mode 100644
index 0000000..82a3fc2
--- /dev/null
+++ b/jena-fuseki2/examples/service-tdb-mem.ttl
@@ -0,0 +1,32 @@
+## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
+
+## An in-memory TDB datasets - for testing.
+
+@prefix :        <#> .
+@prefix fuseki:  <http://jena.apache.org/fuseki#> .
+@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+
+@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .
+@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
+
+<#service_tdb> rdf:type fuseki:Service ;
+    rdfs:label                      "TDB(mem) Service" ;
+    fuseki:name                     "MEM" ;
+    fuseki:serviceQuery             "query" ;
+    fuseki:serviceQuery             "sparql" ;
+    fuseki:serviceUpdate            "update" ;
+    fuseki:serviceUpload            "upload" ;
+    fuseki:serviceReadWriteGraphStore      "data" ;
+    # A separate read-only graph store endpoint:
+    fuseki:serviceReadGraphStore       "get" ;
+    fuseki:dataset           <#tdb_dataset> ;
+    .
+
+<#tdb_dataset> rdf:type      tdb:DatasetTDB ;
+    tdb:location "--mem--" ;
+    ## Query timeout on this dataset (milliseconds)
+    ja:context [ ja:cxtName "arq:queryTimeout" ;  ja:cxtValue "1000" ] ;
+    ## Default graph for query is the (read-only) union of all named graphs.
+    tdb:unionDefaultGraph true ;
+   .

http://git-wip-us.apache.org/repos/asf/jena/blob/36855e1b/jena-fuseki2/fuseki
----------------------------------------------------------------------
diff --git a/jena-fuseki2/fuseki b/jena-fuseki2/fuseki
new file mode 100644
index 0000000..5e0ca07
--- /dev/null
+++ b/jena-fuseki2/fuseki
@@ -0,0 +1,477 @@
+#!/usr/bin/env bash
+
+# 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.
+#
+# =========
+#
+# Startup script for Fuseki under *nix systems (works with cygwin too)
+#
+# Configuration
+# -------------
+# Default values are loaded from /etc/default/fuseki, if it exists.
+#
+# JAVA
+#   Command to invoke Java. If not set, java (from the PATH) will be used.
+#
+# JAVA_OPTIONS
+#   Extra options to pass to the JVM.
+#
+# FUSEKI_HOME
+#   Where Fuseki is installed.  If not set, the script will try
+#   to guess it based on the script invokation path.
+# 
+# FUSEKI_BASE
+#   The root of the runtime area - logs files, system files, local 
configuration.
+#   Defaults to /etc/fuseki.
+#
+# FUSEKI_RUN
+#   Where the fuseki.pid file should be stored.  It defaults
+#   first available of /var/run, /usr/var/run, and /tmp if not set.
+#
+# FUSEKI_PID
+#   The FUSEKI PID file, defaults to $FUSEKI_RUN/fuseki.pid
+#
+# FUSEKI_ARGS
+#   The arguments to pass to the Fuseki server on the command line. Defaults 
to:
+#                                        # if FUSEKI_CONF is not set
+#    --config=$FUSEKI_CONF               # if FUSEKI_CONF is set
+#
+# FUSEKI_START
+#   Path to the jar file. Defaults to $FUSEKI_HOME/fuseki-server.jar 
+
+# FUSEKI_CONF
+#   The Fuseki configuration file, usually in RDF Turtle notation.
+#
+# FUSEKI_USER
+#   If set, the server will be run as this user
+#
+# FUSEKI_LOGS
+#   Directory where logs will be generated. 
+#   Fixed as $FUSEKI_BASE/logs.
+#
+# FUSEKI_LOGS_STDERROUT
+#   Log file with stderr and stdout log output from Fuseki. 
+#   Defaults to $FUSEKI_LOGS/stderrout.log
+
+### BEGIN INIT INFO
+# Provides:          fuseki
+# Required-Start:    $remote_fs $network
+# Required-Stop:     $remote_fs $network
+# Default-Start:     3 4 5
+# Default-Stop:      0 1 2 6
+# Short-Description: Start Jena Fuseki at boot time
+# Description:       Jena Fuseki is a service that provides a SPARQL API over 
HTTP
+### END INIT INFO
+
+# DEBUG=1
+NAME=fuseki
+if [ -f /etc/default/$NAME ]; then
+  . /etc/default/$NAME
+fi
+
+if [ -f /lib/lsb/init-functions ]; then
+  . /lib/lsb/init-functions
+else
+  # simple replacements for LSB daemon logging functions if not defined
+  log_daemon_msg() {
+    echo $1
+  }
+  log_begin_msg() {
+    echo $1
+  }
+  log_end_msg() {
+    if [ $1 -eq 0]; then
+      echo '[OK]'
+    else
+      echo '[failed]'
+    fi
+  }
+fi
+
+usage()
+{
+  echo "Usage: ${0##*/} {start|stop|restart|run|status}"
+  exit 1
+}
+
+[ $# -gt 0 ] || usage
+CMD="$1"
+
+# Utility functions
+
+findDirectory()
+{
+  local L OP=$1
+  shift
+  for L in "$@"; do
+    [ "$OP" "$L" ] || continue
+    printf %s "$L"
+    break
+  done
+}
+
+findFile()
+{
+  local L F=$1
+  shift
+  for L in "$@"; do
+    [ -f "${L}/${F}" ] || continue
+    printf %s "${L}/${F}"
+    break
+  done
+}
+
+running()
+{
+  local PID=$(cat "$1" 2>/dev/null) || return 1
+  ps -p "$PID" >/dev/null 2>&1
+}
+
+# Are we running in cygwin?
+cygwin=false
+case "`uname`" in
+    CYGWIN*) cygwin=true;;
+esac
+
+# Set FUSKEI_HOME to the script invocation directory if it is not specified
+if [ -z "$FUSEKI_HOME" ]
+then
+  SCRIPT="$0"
+  # Catch common issue: script has been symlinked
+  if [ -L "$SCRIPT" ]
+  then
+    SCRIPT="$(readlink "$0")"
+    # If link is relative
+    case "$SCRIPT" in
+      /*) ;; # fine
+      *) SCRIPT=$( dirname "$0" )/$SCRIPT;; # fix
+    esac
+  fi
+
+  # Work out root from script location
+  FUSEKI_HOME="$( cd "$( dirname "$SCRIPT" )" && pwd )"
+
+fi
+
+# Deal with Cygwin path issues
+if [ "$cygwin" == "true" ]
+then
+  FUSEKI_HOME=`cygpath -w "$FUSEKI_HOME"`
+fi
+
+if [ ! -e "$FUSEKI_HOME" ]
+then
+  log_daemon_msg "FUSEKI_HOME '$FUSEKI_HOME' does not exist" 1>&2
+  exit 1
+fi
+
+if [ -z "$FUSEKI_BASE" ]
+then
+  FUSEKI_BASE="/etc/fuseki"
+fi
+
+if [ "$cygwin" == "true" ]
+then
+  FUSEKI_BASE=`cygpath -w "$FUSEKI_BASE"`
+fi
+
+
+if [ ! -e "$FUSEKI_BASE" -o ! -d "$FUSEKI_BASE" ]
+then
+  log_daemon_msg "FUSEKI_BASE '$FUSEKI_BASE' does not exist or is not a 
directory" 1>&2
+  exit 1
+fi
+
+if [ ! -w "$FUSEKI_BASE" ]
+then
+  log_daemon_msg "FUSEKI_BASE '$FUSEKI_BASE' is not writable." 1>&2
+  exit 1
+fi
+
+
+# Deal with Cygwin path issues
+if [ "$cygwin" == "true" ]
+then
+  FUSEKI_HOME=`cygpath -w "$FUSEKI_HOME"`
+  FUSEKI_BASE=`cygpath -w "$FUSEKI_BASE"`
+ fi
+
+# Find a location for the pid file
+if [ -z "$FUSEKI_RUN" ]
+then
+  FUSEKI_RUN=$(findDirectory -w /var/run /usr/var/run $FUSEKI_HOME /tmp)
+fi
+
+# Get PID file name
+if [ -z "$FUSEKI_PID" ]
+then
+  FUSEKI_PID="$FUSEKI_RUN/fuseki.pid"
+fi
+
+# Log directory
+if [ -n "$FUSEKI_LOGS" ]
+then
+    log_daemon_message "FUSEKI_LOGS can not be set externally - ignored" 1>&2
+fi
+FUSEKI_LOGS="$FUSEKI_BASE/logs"
+
+# Std Err and Out log
+if [ -z "$FUSEKI_LOGS_STDERROUT" ]
+then
+  FUSEKI_LOGS_STDERROUT="$FUSEKI_LOGS/stderrout.log"
+fi
+
+# Data directory
+if [ -z "$FUSEKI_DATA_DIR" ]
+then
+  FUSEKI_DATA_DIR="$FUSEKI_HOME/DB"
+fi
+
+# Set up JAVA if not set
+if [ -z "$JAVA" ]
+then
+  JAVA=$(which java)
+fi
+if [ -z "$JAVA" ]
+then
+  echo "Cannot find a Java JDK. Please set either set JAVA or put java (>=1.7) 
in your PATH." 2>&2
+  exit 1
+fi
+
+# The location of the start up JAR
+FUSEKI_START=${FUSEKI_START:-$FUSEKI_HOME/fuseki-server.jar}
+
+# Deal with Cygwin path issues
+if [ "$cygwin" == "true" ]
+then
+  DATA_DIR=`cygpath -w "$FUSEKI_DATA_DIR"`
+  FUSEKI_START=`cygpath -w "$FUSEKI_START"`
+else
+  DATA_DIR="$FUSEKI_DATA_DIR"
+fi
+
+# Some JVM settings
+if [ -z "$JAVA_OPTIONS" ]
+then
+  JAVA_OPTIONS="-Xmx1200M"
+fi
+
+# Default Fuseki Arguments
+if [ -z "$FUSEKI_ARGS" ]
+then
+  if [ -z "$FUSEKI_CONF" ]
+  then
+    FUSEKI_ARGS=""
+  else
+    FUSEKI_ARGS="--config=$FUSEKI_CONF"
+  fi
+fi
+
+# Run command
+
+RUN_ARGS=(${JAVA_OPTIONS[@]} -jar "$FUSEKI_START" $FUSEKI_ARGS)
+RUN_CMD=("$JAVA" ${RUN_ARGS[@]})
+
+
+#####################################################
+# Comment these out after you're happy with what
+# the script is doing.
+#####################################################
+if (( DEBUG ))
+then
+  log_daemon_msg "FUSEKI_HOME    =  $FUSEKI_HOME"
+  log_daemon_msg "FUSEKI_CONF    =  $FUSEKI_CONF"
+  log_daemon_msg "FUSEKI_RUN     =  $FUSEKI_RUN"
+  log_daemon_msg "FUSEKI_PID     =  $FUSEKI_PID"
+  log_daemon_msg "FUSEKI_ARGS    =  $FUSEKI_ARGS"
+  log_daemon_msg "FUSEKI_START   =  $FUSEKI_START"
+  log_daemon_msg "CONFIGS        =  ${CONFIGS[*]}"
+  log_daemon_msg "JAVA           =  $JAVA"
+  log_daemon_msg "JAVA_OPTIONS   =  ${JAVA_OPTIONS[*]}"
+  log_daemon_msg "RUN_ARGS       =  ${RUN_ARGS[@]}"
+  log_daemon_msg "RUN_CMD        =  ${RUN_CMD[@]}"
+fi
+
+NO_START=0
+
+# Life cycle functions
+start() {
+  if (( NO_START )); then
+    log_daemon_msg "Not starting Fuseki - NO_START=1"
+    exit
+  fi
+
+  # Make sure the data and log directories exist
+  mkdir -p "$FUSEKI_DATA_DIR"
+  mkdir -p "$FUSEKI_LOGS"
+
+  # Make sure the .jar file exists
+  if [ ! -e $FUSEKI_START ]; then
+    log_daemon_msg "Could not see Fuseki .jar file: \$FUSEKI_START has value 
'$FUSEKI_START'"
+    exit 1
+  fi
+
+  log_begin_msg "Starting Fuseki"
+  if type start-stop-daemon > /dev/null 2>&1
+  then
+    unset CH_USER
+    if [ -n "$FUSEKI_USER" ]
+    then
+      CH_USER="--chuid $FUSEKI_USER"
+    fi
+    if start-stop-daemon --start $CH_USER --chdir "$FUSEKI_HOME" --background 
--make-pidfile --pidfile "$FUSEKI_PID" --startas "$JAVA" -- "${RUN_ARGS[@]}"
+    then
+      sleep 2
+      if running "$FUSEKI_PID"
+      then
+        log_end_msg 0
+        print_started
+      else
+        log_end_msg 1
+      fi
+    else
+      log_end_msg 1
+      log_daemon_msg "** start-stop-daemon failed to run"
+    fi
+  else
+    if running $FUSEKI_PID
+    then
+      log_end_msg 1
+      log_daemon_msg 'Already Running!'
+      exit 1
+    else
+      # dead pid file - remove
+      rm -f "$FUSEKI_PID"
+    fi
+
+    if [ "$FUSEKI_USER" ]
+    then
+      touch "$FUSEKI_PID"
+      chown "$FUSEKI_USER" "$FUSEKI_PID"
+      su - "$FUSEKI_USER" -c "
+        log_daemon_msg "Redirecting Fuseki stderr/stdout to 
$FUSEKI_LOGS_STDERROUT"
+        exec ${RUN_CMD[*]} &
+        disown \$!
+        echo \$! > '$FUSEKI_PID'"
+    else
+      #log_daemon_msg "Redirecting Fuseki stderr/stdout to 
$FUSEKI_LOGS_STDERROUT"
+      exec "${RUN_CMD[@]}" &> "$FUSEKI_LOGS_STDERROUT" &
+      disown $!
+      echo $! > "$FUSEKI_PID"
+    fi
+
+    log_end_msg 0
+    print_started
+  fi
+}
+
+print_started() {
+  log_daemon_msg "STARTED Fuseki `date`"
+  log_daemon_msg "PID=$(cat "$FUSEKI_PID" 2>/dev/null)"
+}
+
+delete_fuseki_pid_file() {
+  rm -f "$FUSEKI_PID"
+}
+
+stop() {
+  log_begin_msg "Stopping Fuseki: "
+
+  if ! running "$FUSEKI_PID"
+  then
+    log_end_msg 1
+
+    # if a stop rather than a restart, signal failure to stop
+    if [ -z "$1" ]
+    then
+      exit 1
+    fi
+  fi
+
+  ###############################################################
+  # !!!! This code needs to be improved, too many repeats !!!!  #
+  ###############################################################
+  if type start-stop-daemon > /dev/null 2>&1; then
+    start-stop-daemon --stop --pidfile "$FUSEKI_PID" --chdir "$FUSEKI_HOME" 
--startas "$JAVA" --signal HUP
+
+    ## Die after a 30 second timeout
+    TIMEOUT=30
+    while running "$FUSEKI_PID"; do
+      if (( TIMEOUT-- == 0 )); then
+        start-stop-daemon --stop --pidfile "$FUSEKI_PID" --chdir 
"$FUSEKI_HOME" --startas "$JAVA" --signal KILL
+      fi
+        sleep 1
+    done
+    delete_fuseki_pid_file
+    log_end_msg 0
+  else
+    PID=$(cat "$FUSEKI_PID" 2>/dev/null)
+    kill "$PID" 2>/dev/null
+
+    TIMEOUT=30
+    while running $FUSEKI_PID; do
+      if (( TIMEOUT-- == 0 )); then
+        kill -KILL "$PID" 2>/dev/null
+      fi
+      sleep 1
+    done
+    delete_fuseki_pid_file
+    log_end_msg 0
+  fi
+}
+
+
+# Run in the foreground, as the current user
+run() {
+  # Make sure the .jar file exists
+  if [ ! -e $FUSEKI_START ]; then
+    log_daemon_msg "Could not see Fuseki .jar file: \$FUSEKI_START has value 
'$FUSEKI_START'"
+    exit 1
+  fi
+  exec "${RUN_CMD[@]}"
+}
+
+case $CMD in
+  start)
+    start
+  ;;
+  stop)
+    stop
+  ;;
+  restart)
+    stop "restarting"
+    start
+  ;;
+  run)
+    run
+  ;;
+  status)
+    FUSEKI_PID=$(findFile fuseki.pid /var/run /usr/var/run $FUSEKI_HOME /tmp)
+    if running $FUSEKI_PID
+    then
+      PID=`cat "$FUSEKI_PID"`
+      log_daemon_msg "Fuseki is running with pid: $PID"
+    else
+      log_daemon_msg "Fuseki is not running"
+    fi
+  ;;
+  *)
+    usage
+  ;;
+esac
+
+exit 0

http://git-wip-us.apache.org/repos/asf/jena/blob/36855e1b/jena-fuseki2/fuseki-server
----------------------------------------------------------------------
diff --git a/jena-fuseki2/fuseki-server b/jena-fuseki2/fuseki-server
new file mode 100755
index 0000000..679b3bd
--- /dev/null
+++ b/jena-fuseki2/fuseki-server
@@ -0,0 +1,64 @@
+#!/bin/sh
+# 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.
+
+# Run fuseki as a standalone server
+
+export FUSEKI_HOME="${FUSEKI_HOME:-$PWD}"
+
+if [ ! -e "$FUSEKI_HOME" ]
+then
+    echo "$FUSEKI_HOME does not exist" 1>&2
+    exit 1
+    fi
+
+JAR1="$FUSEKI_HOME/fuseki-server.jar"
+JAR2="$FUSEKI_HOME/jena-fuseki-*-server.jar"
+JAR=""
+
+for J in "$JAR1" "$JAR2"
+do
+    # Expand
+    J="$(echo $J)"
+    if [ -e "$J" ]
+    then
+       JAR="$J"
+       break
+    fi
+done
+
+if [ "$JAR" = "" ]
+then
+    echo "Can't find jarfile to run"
+    exit 1
+fi
+
+# Deal with Cygwin path issues
+cygwin=false
+case "`uname`" in
+    CYGWIN*) cygwin=true;;
+esac
+if [ "$cygwin" = "true" ]
+then
+    JAR=`cygpath -w "$JAR"`
+    FUSEKI_HOME=`cygpath -w "$FUSEKI_HOME"`
+fi
+
+export FUSEKI_BASE="${FUSEKI_BASE:-$PWD/run}"
+
+JVM_ARGS=${JVM_ARGS:--Xmx1200M}
+
+exec java  $JVM_ARGS -jar "$JAR" "$@"

http://git-wip-us.apache.org/repos/asf/jena/blob/36855e1b/jena-fuseki2/fuseki-server.bat
----------------------------------------------------------------------
diff --git a/jena-fuseki2/fuseki-server.bat b/jena-fuseki2/fuseki-server.bat
new file mode 100644
index 0000000..6bfd370
--- /dev/null
+++ b/jena-fuseki2/fuseki-server.bat
@@ -0,0 +1,3 @@
+@echo off
+@REM modify this to name the server jar
+java -Xmx1200M -jar fuseki-server.jar %*

http://git-wip-us.apache.org/repos/asf/jena/blob/36855e1b/jena-fuseki2/make-html
----------------------------------------------------------------------
diff --git a/jena-fuseki2/make-html b/jena-fuseki2/make-html
new file mode 100755
index 0000000..e998657
--- /dev/null
+++ b/jena-fuseki2/make-html
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+for f in "$@"
+do
+    echo "==== $f"
+    B="$(basename $f .md)"
+    D="$(dirname $f)"
+    X="$D/$B.html"
+    curl -s -XPOST -H 'Content-type:text/plain' \
+       --data-binary @$f \
+       https://api.github.com/markdown/raw \
+       > $X
+    
+done

http://git-wip-us.apache.org/repos/asf/jena/blob/36855e1b/jena-fuseki2/make_cp_mvn
----------------------------------------------------------------------
diff --git a/jena-fuseki2/make_cp_mvn b/jena-fuseki2/make_cp_mvn
new file mode 100755
index 0000000..94cb84b
--- /dev/null
+++ b/jena-fuseki2/make_cp_mvn
@@ -0,0 +1,34 @@
+#!/usr/bin/env perl
+# Make the maven classpath
+
+$POM="pom.xml" ;
+$POM = @ARGV[0] if ( defined(@ARGV[0]) ) ;
+
+if ( ! -e "$POM" )
+{
+    print STDERR "No POM file: $POM\n" ;
+    exit 1 ;
+}
+$M2=$ENV{'M2_REPO'} ;
+print "#!/bin/bash\n" ;
+print "\n" ;
+print 'XCP="' ;
+
+open(X, "mvn -f $POM dependency:build-classpath -DincludeScope=runtime |") ;
+while(<X>)
+{
+    next if /\[INFO\]/ ;
+    next if /^Download/ ;
+    chop ;
+    #s!$M2/org/apache/jena/jena-[^/]*/[^/]*/[^/]*.jar:!!g ;
+    print "$_" ;
+}
+print "\"\n" ;
+print "\n" ;
+
+print "if [ \"\$CP\" != \'\' ]\n" ;
+print "then\n" ;
+print "   XCP=\"\$CP:\$XCP\"\n" ;
+print "fi\n" ;
+print "\n" ;
+print "echo \"\$XCP\"\n"

http://git-wip-us.apache.org/repos/asf/jena/blob/36855e1b/jena-fuseki2/make_links
----------------------------------------------------------------------
diff --git a/jena-fuseki2/make_links b/jena-fuseki2/make_links
new file mode 100755
index 0000000..76efd4c
--- /dev/null
+++ b/jena-fuseki2/make_links
@@ -0,0 +1,9 @@
+#!/bin/bash
+# Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
+
+SOH=${SOH:-soh}
+for s in s-head s-get s-put s-post s-delete s-query s-update s-update-form
+do
+    rm -f $s
+    ln -s "$SOH" $s
+done

http://git-wip-us.apache.org/repos/asf/jena/blob/36855e1b/jena-fuseki2/pom.xml
----------------------------------------------------------------------
diff --git a/jena-fuseki2/pom.xml b/jena-fuseki2/pom.xml
new file mode 100644
index 0000000..b2fff59
--- /dev/null
+++ b/jena-fuseki2/pom.xml
@@ -0,0 +1,434 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+
+  <name>Apache Jena - Fuseki (SPARQL 1.1 Server)</name>
+  <artifactId>jena-fuseki</artifactId>
+  <version>2.0.0.beta-1-SNAPSHOT</version>
+
+  <parent>
+    <groupId>org.apache.jena</groupId>
+    <artifactId>jena-parent</artifactId>
+    <version>11-SNAPSHOT</version>
+    <relativePath>../jena-parent</relativePath>
+  </parent> 
+
+  <!-- We make the JAR file so that the shade plugin includes it.
+       The war:war goal is added to the package phase.
+  -->
+  <packaging>jar</packaging>
+  <description>Fuseki is a SPARQL 1.1 Server which provides query, update and 
graph store protocol endpoints that can be used to expose triple stores over 
HTTP</description>
+  <url>http://jena.apache.org/</url>
+
+
+  <!-- Need if the parent is a snapshot -->
+  <repositories>
+    <repository>
+      <id>apache.snapshots</id>
+      <name>Apache Snapshot Repository</name>
+      <url>http://repository.apache.org/snapshots</url>
+      <releases>
+        <enabled>false</enabled>
+      </releases>
+    </repository>
+  </repositories>
+
+  <organization>
+    <name>Apache Jena</name>
+    <url>http://jena.apache.org/</url>
+  </organization>
+
+  <licenses>
+    <license>
+      <name>Apache 2.0 License</name>
+      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
+    </license>
+  </licenses>
+
+  <properties>
+    <this.root>${project.artifactId}-${project.version}</this.root>
+    
+    <server.jar.name>${this.root}-server</server.jar.name>
+    <!-- Eventually, move to jena-parent -->
+    <ver.jetty>9.1.1.v20140108</ver.jetty>
+    <ver.shiro>1.2.2</ver.shiro>
+
+    
<maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ssZ</maven.build.timestamp.format>
+    <build.time.xsd>${maven.build.timestamp}</build.time.xsd>  
+  </properties>
+
+  <dependencies>
+
+    <dependency>
+      <groupId>org.apache.jena</groupId>
+      <artifactId>jena-arq</artifactId>
+      <version>2.12.2-SNAPSHOT</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.jena</groupId>
+      <artifactId>jena-arq</artifactId>
+      <version>2.12.2-SNAPSHOT</version>
+      <classifier>tests</classifier>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.jena</groupId>
+      <artifactId>jena-core</artifactId>
+      <version>2.12.2-SNAPSHOT</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.jena</groupId>
+      <artifactId>jena-tdb</artifactId>
+      <version>1.1.2-SNAPSHOT</version>
+    </dependency>
+
+    <!--
+    <dependency>
+      <groupId>org.apache.jena</groupId>
+      <artifactId>sdb</artifactId>
+      <version>${ver.sdb}</version>
+      <optional>true</optional>
+    </dependency>
+    -->
+
+    <dependency>
+      <groupId>org.apache.jena</groupId>
+      <artifactId>jena-text</artifactId>
+      <version>1.1.2-SNAPSHOT</version>
+      <exclusions>
+        <!-- 
+          Get this via commons-fileupload and also via jena-text/sol4j
+        -->
+        <exclusion>
+          <groupId>commons-io</groupId>
+          <artifactId>commons-io</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.jena</groupId>
+      <artifactId>jena-spatial</artifactId>
+      <version>1.1.2-SNAPSHOT</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.shiro</groupId>
+      <artifactId>shiro-core</artifactId>
+      <version>${ver.shiro}</version>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.apache.shiro</groupId>
+      <artifactId>shiro-web</artifactId>
+      <version>${ver.shiro}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.httpcomponents</groupId>
+      <artifactId>httpclient</artifactId>
+      <exclusions>
+        <!-- Replace with slf4j adapter -->
+        <exclusion>
+          <groupId>commons-logging</groupId>
+          <artifactId>commons-logging</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+
+    <dependency>
+      <groupId>commons-fileupload</groupId>
+      <artifactId>commons-fileupload</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-webapp</artifactId>
+      <version>${ver.jetty}</version>
+    </dependency>    
+
+
+    <!--
+    <dependency>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-runner</artifactId>
+      <version>${ver.jetty}</version>
+    </dependency>    
+    -->
+
+    <!-- Development and standalone jar (if built) -->
+    <!-- Jetty's useful servlets, inc compression -->
+    <dependency>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-servlets</artifactId>
+      <version>${ver.jetty}</version>
+    </dependency>    
+    
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+    </dependency>
+
+    <!-- Intercept any uses of Jakarta Commons Logging e.g. Apache Common HTTP 
client. -->
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>jcl-over-slf4j</artifactId>
+    </dependency>
+
+    <!-- Needed because the Fuseki command line and the test suite reset 
logging levels -->
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>javax.jms</groupId>
+          <artifactId>jms</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>com.sun.jdmk</groupId>
+          <artifactId>jmxtools</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>com.sun.jmx</groupId>
+          <artifactId>jmxri</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>javax.mail</groupId>
+          <artifactId>mail</artifactId>
+        </exclusion>
+      </exclusions> 
+    </dependency>
+  </dependencies>
+
+  <build>
+    <resources>
+      <resource>
+        <filtering>false</filtering>
+        <directory>src/main/resources</directory>
+        <excludes>
+          <exclude>org/apache/jena/fuseki/fuseki-properties.xml</exclude>
+        </excludes>
+      </resource>
+      <resource>
+        <filtering>true</filtering>
+        <directory>src/main/resources</directory>
+        <includes>
+          <include>org/apache/jena/fuseki/fuseki-properties.xml</include>
+        </includes>
+      </resource>
+    </resources>
+    
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <encoding>UTF-8</encoding>
+          <optimize>true</optimize>
+          <debug>true</debug>
+          <debuglevel>source,lines,vars</debuglevel>
+          <source>1.7</source>
+          <target>1.7</target>
+        </configuration>
+      </plugin>
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-source-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>attach-sources</id>
+            <phase>package</phase>
+            <goals>
+              <goal>jar-no-fork</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+
+      <!--
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <configuration>
+          <version>true</version>
+          <show>public</show>
+          <quiet>true</quiet>
+          <encoding>UTF-8</encoding>
+          <windowtitle>Apache Jena Fuseki</windowtitle>
+          <doctitle>Apache Jena Fuseki ${project.version}</doctitle>
+          <bottom>Licenced under the Apache License, Version 2.0</bottom>
+        </configuration>
+      </plugin>
+      -->
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <executions>
+          <execution>
+            <goals>
+              <goal>test-jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <includes>
+            <include>**/TS_*.java</include>
+          </includes>
+        </configuration>
+      </plugin>
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <configuration>
+          <overWriteReleases>false</overWriteReleases>
+          <overWriteIfNewer>true</overWriteIfNewer>
+        </configuration>
+      </plugin>
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>2.1</version>
+        <configuration>
+          <shadedArtifactAttached>true</shadedArtifactAttached>
+          <shadedClassifierName>server</shadedClassifierName>
+          <transformers>
+            <transformer 
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+              <mainClass>org.apache.jena.fuseki.FusekiCmd</mainClass>
+            </transformer>
+            <transformer 
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"
 />
+            <transformer 
implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"
 />
+            <transformer 
implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
+              <addHeader>false</addHeader>
+            </transformer>
+          </transformers>
+          <filters>
+            <filter>
+              <artifact>*:*</artifact>
+              <excludes>
+                <!-- Some jars are signed but shading breaks that.
+                     Don't include signing files.
+                -->
+                <exclude>META-INF/*.SF</exclude>
+                <exclude>META-INF/*.DSA</exclude>
+                <exclude>META-INF/*.RSA</exclude>
+              </excludes>
+            </filter>
+          </filters>
+        </configuration>
+        <executions>
+          <execution>
+           <phase>package</phase>
+           <!--<phase/><!- - Switch off -->
+            <goals>
+              <goal>shade</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-war-plugin</artifactId>
+        <version>2.4</version>
+        <executions> 
+          <execution>
+            <id>generate-webapp</id>
+            <phase>package</phase>
+            <goals><goal>war</goal></goals>
+          </execution>
+        </executions>
+        <configuration>
+          <webappDirectory>${project.build.webappDirectory}</webappDirectory>
+          <!-- This can't be set because then maven will not install/deploy 
the war file -->
+          <!--<warName>${webapp.name}</warName>-->
+          <!-- Don't put in the Jetty dependency nor javax.servlet -->
+          
<packagingExcludes>WEB-INF/lib/jetty-*,WEB-INF/lib/javax.servlet*</packagingExcludes>
+        </configuration>
+      </plugin>
+
+      <!-- Untested.
+      <plugin>
+        <groupId>org.eclipse.jetty</groupId>
+        <artifactId>jetty-maven-plugin</artifactId>
+        <version>${ver.jetty}</version>
+        <configuration>
+          <war>target/${this.root}.war</war>
+        </configuration>
+      </plugin>
+      -->
+
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <!-- After shaded jar, after war file - same phase -->
+        <executions>
+          <execution>
+            <id>create-zip-assembly</id>
+           <phase>package</phase>
+           <!--<phase/>-->
+            <goals><goal>single</goal></goals>
+            <configuration>
+              <!--
+              <finalName>${assembly.zip.name}</finalName>
+              <appendAssemblyId>false</appendAssemblyId>
+              -->
+              <descriptors>
+                <descriptor>assembly-dist.xml</descriptor>
+              </descriptors>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-resources-plugin</artifactId>
+        <configuration>
+          <encoding>UTF-8</encoding>
+        </configuration>
+      </plugin>
+
+    </plugins>
+
+  </build>
+  
+</project>

http://git-wip-us.apache.org/repos/asf/jena/blob/36855e1b/jena-fuseki2/run-fuseki
----------------------------------------------------------------------
diff --git a/jena-fuseki2/run-fuseki b/jena-fuseki2/run-fuseki
new file mode 100755
index 0000000..588c4a0
--- /dev/null
+++ b/jena-fuseki2/run-fuseki
@@ -0,0 +1,78 @@
+#!/usr/bin/env bash
+
+# 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.
+
+## Run Fuseki, include development code if it looks like it's available.
+## Or --pages=
+
+function check_dir() {
+    local NAME="$1"
+    local DIR="$2"
+    if [ ! -e "$DIR" ]
+    then
+       echo "$NAME: '$DIR' does not exist" 1>&2
+       exit 1
+    fi
+    if [ ! -d "$DIR" ]
+    then
+       echo "$NAME: '$DIR' exists but is not a directory" 1>&2
+    exit 1
+    fi
+}
+
+export FUSEKI_HOME="${FUSEKI_HOME:-$PWD}"
+check_dir "FUSEKI_HOME" "$FUSEKI_HOME"
+
+export FUSEKI_BASE="${FUSEKI_BASE:-$FUSEKI_HOME/run}"
+check_dir "FUSEKI_BASE" "$FUSEKI_BASE"
+
+CPF="$PWD/fuseki.classpath"
+
+if [ ! -e "$CPF" ]; then
+    echo "Creating Fuseki classpath file"
+    "$PWD/make_cp_mvn" > $CPF
+fi
+
+CP="$(. $CPF)"
+
+# Add development directories.
+if [ -e "$FUSEKI_HOME/classes" ]
+then
+    CP="$FUSEKI_HOME/classes:$CP"
+elif [ -e "$FUSEKI_HOME/target/classes" ]
+then
+    CP="$FUSEKI_HOME/target/classes:$CP"
+fi
+
+# Prepend any development directories here
+DEVDIRS="jena-core jena-tdb jena-arq jena-text"
+for X in $DEVDIRS
+do
+    CPX="$FUSEKI_HOME/../$X/classes"
+    if [ -e "$CPX" ]
+    then
+       CP="$CPX:$CP"
+    fi
+done
+
+FUSEKI_LOG=${FUSEKI_LOG:-}
+JVM_ARGS="${JVM_ARGS:--Xmx1200M}"
+
+exec java -cp "$CP" $JVM_ARGS $FUSEKI_LOG org.apache.jena.fuseki.FusekiCmd "$@"
+
+# Run as war file.
+# java -jar jetty-runner.jar fuseki-server.war
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jena/blob/36855e1b/jena-fuseki2/src-dev/dev/BackwardForwardDescribeFactory.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/src-dev/dev/BackwardForwardDescribeFactory.java 
b/jena-fuseki2/src-dev/dev/BackwardForwardDescribeFactory.java
new file mode 100644
index 0000000..2322929
--- /dev/null
+++ b/jena-fuseki2/src-dev/dev/BackwardForwardDescribeFactory.java
@@ -0,0 +1,95 @@
+/*
+ * 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 dev;
+
+import com.hp.hpl.jena.query.Dataset;
+import com.hp.hpl.jena.rdf.model.Model;
+import com.hp.hpl.jena.rdf.model.ModelFactory;
+import com.hp.hpl.jena.rdf.model.RDFNode;
+import com.hp.hpl.jena.rdf.model.Resource;
+import com.hp.hpl.jena.sparql.ARQConstants;
+import com.hp.hpl.jena.sparql.core.Quad;
+import com.hp.hpl.jena.sparql.core.describe.DescribeHandler;
+import com.hp.hpl.jena.sparql.core.describe.DescribeHandlerFactory;
+import com.hp.hpl.jena.sparql.core.describe.DescribeHandlerRegistry;
+import com.hp.hpl.jena.sparql.util.Context;
+import com.hp.hpl.jena.tdb.TDB ;
+import com.hp.hpl.jena.util.iterator.ExtendedIterator;
+import com.hp.hpl.jena.vocabulary.RDFS;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class BackwardForwardDescribeFactory implements DescribeHandlerFactory {
+
+    final static Logger log = 
LoggerFactory.getLogger(BackwardForwardDescribeFactory.class);
+
+    static {
+        TDB.init();
+        log.info("Attaching replacement describe handler");
+        DescribeHandlerRegistry reg = DescribeHandlerRegistry.get();
+        log.info("Clearing existing describe handlers");
+        reg.clear();
+        reg.add(new BackwardForwardDescribeFactory());
+        log.info("Attached");
+    }
+
+    @Override
+    public DescribeHandler create() {
+        return new BackwardForwardDescribe();
+    }
+
+    public static class BackwardForwardDescribe implements DescribeHandler {
+
+        private Dataset dataset;
+        private Model result;
+        private Model defaultModel;
+        private Model unionModel;
+
+        @Override
+        public void start(Model accumulateResultModel, Context qContext) {
+            this.result = accumulateResultModel;
+            this.dataset = (Dataset) 
qContext.get(ARQConstants.sysCurrentDataset);
+            this.defaultModel = dataset.getDefaultModel();
+            this.unionModel = dataset.getNamedModel(Quad.unionGraph.getURI());
+        }
+
+        @Override
+        public void describe(Resource resource) {
+            result.add(defaultModel.listStatements(resource, null, (RDFNode) 
null));
+            result.add(defaultModel.listStatements(null, null, resource));
+            result.add(unionModel.listStatements(resource, null, (RDFNode) 
null));
+            result.add(unionModel.listStatements(null, null, resource));
+
+            // Gather labels for dangling refs
+            Model labels = ModelFactory.createDefaultModel();
+            ExtendedIterator<RDFNode> it = 
result.listObjects().andThen(result.listSubjects());
+            while (it.hasNext()) {
+                RDFNode node = it.next();
+                if (node.isLiteral() || resource.equals(node)) continue;
+                labels.add(defaultModel.listStatements((Resource) node, 
RDFS.label, (RDFNode) null));
+                labels.add(unionModel.listStatements((Resource) node, 
RDFS.label, (RDFNode) null));
+            }
+            result.add(labels);
+        }
+
+        @Override
+        public void finish() {
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/36855e1b/jena-fuseki2/src-dev/dev/PROJECT.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/src-dev/dev/PROJECT.java 
b/jena-fuseki2/src-dev/dev/PROJECT.java
new file mode 100644
index 0000000..ec5b386
--- /dev/null
+++ b/jena-fuseki2/src-dev/dev/PROJECT.java
@@ -0,0 +1,80 @@
+/**
+ * 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 dev;
+
+public class PROJECT {
+    
+    // URI parsed during execCommonWorker and again in uber dispatch
+    //  --> do once. Info in action (context path, dataset name, operation) + 
admin
+    
+    // UI "reset" to reread configuration
+    // And poll read configuration files.
+    
+    // Refindable backups
+    // Name of backup in the response to back up starting.
+    //   Task specific return as well?
+    
+    // Use void for the system DB - drive service description from this.
+    // RDF Patch (logging and as mime type)
+    // POM changes from jena-fuseki.??
+    
+    // Convert FmtLog to own logging.
+    
+    // Use Action(Container)Item for ActionStats
+    
+    // Assembler file mgt
+    
+    // Tests for DataServiceDesc and configuration.
+    // Other DataServiceDesc
+    //  -- contains a DS and can't put it down (update/in-memory) (+file)
+    //  -- TDB various
+    
+    // --set affects the system DB! 
+    
+    // Backup task + polling
+    //  Generalize to queries, updates, etc
+    //   /dataset/operation/1234
+    //   /dataset/query/1234
+    
+    // Create dataset - check for existing. 
+    // Timeouts
+    // Check variable names on DataAccessPoint,  DataService, Endpoint
+    // Per HTTP operation counters
+    // Per service timeouts. e.g. 
+    // Per service context setting e.g. timeouts, tdb:unionDefaultGraph
+    //   SPARQL_Query.setAnyTimeouts
+    
+    // Shiro - log failures?
+    
+    /* Use of:
+<context-param>
+  <param-name>org.apache.jena.fuseki.config</param-name>
+  <param-value>{webapp}/WEB-INF/app.conf</param-value>
+</context-param>
+     */
+    // TDB : insert a lock file?
+    
+    // async operations e.g. backup, stats
+    
+    // RDF patch
+    //   /ds/patch service to apply a patch.
+    // All TODO and XXX
+    // Document (write/update) all protocol modes.
+}
+

http://git-wip-us.apache.org/repos/asf/jena/blob/36855e1b/jena-fuseki2/src-dev/dev/RunAsWebapp.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/src-dev/dev/RunAsWebapp.java 
b/jena-fuseki2/src-dev/dev/RunAsWebapp.java
new file mode 100644
index 0000000..586a5e6
--- /dev/null
+++ b/jena-fuseki2/src-dev/dev/RunAsWebapp.java
@@ -0,0 +1,50 @@
+/**
+ * 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 dev;
+
+import java.nio.file.Paths ;
+
+import org.apache.jena.fuseki.FusekiLogging ;
+import org.apache.jena.fuseki.jetty.JettyFuseki ;
+import org.apache.jena.fuseki.server.FusekiServer ;
+import org.apache.jena.fuseki.server.FusekiServletContextListener ;
+import org.eclipse.jetty.server.Server ;
+
+public class RunAsWebapp
+{
+ // See also 
http://www.eclipse.org/jetty/documentation/current/embedded-examples.html#embedded-one-webapp
+    public static void main(String[] args) //throws Exception
+    {
+        FusekiServer.FUSEKI_HOME = Paths.get("").toAbsolutePath() ;
+        FusekiServer.FUSEKI_BASE = Paths.get("run") ;
+        FusekiLogging.setLogging() ; 
+        // No command line.
+        FusekiServletContextListener.initialSetup = null ;
+        // Create a basic jetty-hosted Fuseki server
+        Server server = JettyFuseki.create("/fuseki", 3030) ;
+        try {
+            server.start();
+            server.join();
+        } catch (Exception ex) {
+            System.out.flush() ;
+            ex.printStackTrace(System.err);
+        }
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/jena/blob/36855e1b/jena-fuseki2/src-dev/dev/RunFuseki2.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/src-dev/dev/RunFuseki2.java 
b/jena-fuseki2/src-dev/dev/RunFuseki2.java
new file mode 100644
index 0000000..86364bc
--- /dev/null
+++ b/jena-fuseki2/src-dev/dev/RunFuseki2.java
@@ -0,0 +1,96 @@
+/*
+ * 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 dev;
+
+import java.nio.file.Paths ;
+
+import org.apache.jena.fuseki.FusekiCmd ;
+import org.apache.jena.fuseki.server.FusekiServer ;
+
+public class RunFuseki2
+{
+    public static void main(String[] args) throws Exception {
+        //demo() ;
+        //FusekiCmd.main("--config=config.ttl") ; System.exit(0) ;
+        main1() ;
+    }
+    
+    public static void demo() {
+        String DIR="DemoServer" ;
+        FusekiCmd.main("--config="+name(DIR,"config.ttl"), 
"--pages="+name(DIR, "demo-pages")) ;
+        System.exit(0) ;
+    }
+    
+    public static String name(String DIR, String filename) {
+        StringBuilder sb = new StringBuilder() ;
+        if ( ! filename.startsWith("/") )
+        {
+            sb.append(DIR) ;
+            if ( ! DIR.endsWith("/") )
+                sb.append("/") ;
+        }
+        sb.append(filename) ;
+        return sb.toString() ;
+    }
+    
+    private static void main1() {
+        FusekiServer.FUSEKI_HOME = Paths.get("").toAbsolutePath() ;
+        FusekiServer.FUSEKI_BASE = Paths.get("run") ;
+        FusekiServer.init() ;
+        
+        String tmpdir = System.getenv("TMPDIR") ;
+        if ( tmpdir == null )
+            tmpdir = System.getenv("TMP") ;
+        if ( tmpdir == null )
+            tmpdir = System.getenv("HOME")+"/tmp" ;
+        if ( ! tmpdir.endsWith("/") )
+            tmpdir = tmpdir+"/" ;
+        
+        FusekiCmd.main(
+                     //  "-v",
+                     //"--update", "--memtdb", "--mgt", "/ds"
+                     
+                     "--strict", "--update", "--mem", "/ds"
+                     
+                     //"--update", "--loc="+tmpdir+"DB", 
"--set=tdb:unionDefaultGraph=true", "/ds"
+                     //"--update", "--mem", "/ds"
+
+                     //"--update", "--memtdb", 
"--set=tdb:unionDefaultGraph=true", "/ds"
+                     
+                    //"--debug",
+                    //"--update",
+                    //"--timeout=1000,5000",
+                    //"--set=arq:queryTimeout=1000",
+                    //"--port=3030",
+                    //"--mgtPort=3031",
+                    //"--mem",
+                    //"--home=/home/afs/Projects/Fuseki",
+                    //"--loc=DB",
+                    //"--file=D.nt",
+                    //"--gzip=no",
+                    //"--desc=desc.ttl",
+                    //--pages=
+                    //"--jetty-config=jetty-fuseki.xml",
+                    //"--config=config-tdb.ttl"
+                    // "/ds"
+                    ) ;
+        System.exit(0) ;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/36855e1b/jena-fuseki2/src/main/java/org/apache/jena/fuseki/DEF.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/src/main/java/org/apache/jena/fuseki/DEF.java 
b/jena-fuseki2/src/main/java/org/apache/jena/fuseki/DEF.java
new file mode 100644
index 0000000..8d8495a
--- /dev/null
+++ b/jena-fuseki2/src/main/java/org/apache/jena/fuseki/DEF.java
@@ -0,0 +1,79 @@
+/*
+ * 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;
+
+import org.apache.jena.atlas.web.AcceptList ;
+import org.apache.jena.atlas.web.MediaType ;
+import static org.apache.jena.riot.WebContent.* ;
+
+public class DEF
+{
+    public static final MediaType acceptRDFXML        = 
MediaType.create(contentTypeRDFXML) ;
+    public static final MediaType acceptNQuads        = 
MediaType.create(contentTypeNQuads) ;
+    public static final MediaType acceptRSXML         = 
MediaType.create(contentTypeResultsXML) ;
+    public static final MediaType acceptJSON          = 
MediaType.create(contentTypeJSON) ;
+    
+    public static final AcceptList jsonOffer          = 
AcceptList.create(contentTypeJSON) ;
+
+    public static final AcceptList rdfOffer           = 
AcceptList.create(contentTypeTurtle, 
+                                                                          
contentTypeTurtleAlt1,
+                                                                          
contentTypeTurtleAlt2,
+                                                                          
contentTypeNTriples,
+                                                                          
contentTypeNTriplesAlt,
+                                                                          
contentTypeRDFXML,
+                                                                          
contentTypeJSONLD,
+                                                                          
contentTypeRDFJSON,
+                                                                          
contentTypeRDFThrift
+                                                                          ) ;
+    
+    public static final AcceptList quadsOffer         = 
AcceptList.create(contentTypeTriG,
+                                                                          
contentTypeTriGAlt1,
+                                                                          
contentTypeTriGAlt2,
+                                                                          
contentTypeJSONLD,
+                                                                          
contentTypeNQuads,
+                                                                          
contentTypeNQuadsAlt1,
+                                                                          
contentTypeNQuadsAlt2 
+                                                                          ) ;
+    
+    // Offer for SELECT
+    public static final AcceptList rsOfferTable       = 
AcceptList.create(contentTypeResultsJSON,
+                                                                          
contentTypeTextCSV,
+                                                                          
contentTypeTextTSV,
+                                                                          
contentTypeResultsXML,
+                                                                          
contentTypeResultsThrift,
+                                                                          
contentTypeTextPlain
+                                                                          ) ;
+         
+    // Offer for ASK
+    public static final AcceptList rsOfferBoolean      = 
AcceptList.create(contentTypeResultsJSON,
+                                                                           
contentTypeTextCSV,
+                                                                           
contentTypeTextTSV,
+                                                                           
contentTypeResultsXML,
+                                                                           
contentTypeTextPlain
+                                                                           ) ;
+
+    
+    // Names for services in the default configuration
+    public static final String ServiceQuery         = "query" ;
+    public static final String ServiceQueryAlt      = "sparql" ;
+    public static final String ServiceUpdate        = "update" ;
+    public static final String ServiceData          = "data" ;
+    public static final String ServiceUpload        = "upload" ;
+    public static final String ServiceGeneralQuery  = "/sparql" ;
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/36855e1b/jena-fuseki2/src/main/java/org/apache/jena/fuseki/Fuseki.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/src/main/java/org/apache/jena/fuseki/Fuseki.java 
b/jena-fuseki2/src/main/java/org/apache/jena/fuseki/Fuseki.java
new file mode 100644
index 0000000..b2bea5b
--- /dev/null
+++ b/jena-fuseki2/src/main/java/org/apache/jena/fuseki/Fuseki.java
@@ -0,0 +1,225 @@
+/*
+ * 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 ;
+
+import java.util.Calendar ;
+import java.util.TimeZone ;
+import java.util.concurrent.TimeUnit ;
+
+import org.apache.jena.riot.RIOT ;
+import org.apache.jena.riot.system.stream.LocatorFTP ;
+import org.apache.jena.riot.system.stream.LocatorHTTP ;
+import org.apache.jena.riot.system.stream.StreamManager ;
+import org.slf4j.Logger ;
+import org.slf4j.LoggerFactory ;
+
+import com.hp.hpl.jena.query.ARQ ;
+import com.hp.hpl.jena.sparql.SystemARQ ;
+import com.hp.hpl.jena.sparql.lib.Metadata ;
+import com.hp.hpl.jena.sparql.mgt.SystemInfo ;
+import com.hp.hpl.jena.sparql.util.Context ;
+import com.hp.hpl.jena.sparql.util.MappingRegistry ;
+import com.hp.hpl.jena.sparql.util.Utils ;
+import com.hp.hpl.jena.tdb.TDB ;
+import com.hp.hpl.jena.tdb.transaction.TransactionManager ;
+
+public class Fuseki {
+    // General fixed constants.
+    // See also FusekiServer for the naming on the filesystem
+    
+    /** Path to ??? */
+    static public String    PATH                         = 
"org.apache.jena.fuseki" ;
+
+    /** a unique IRI for the Fuseki namespace */
+    static public String    FusekiIRI                    = 
"http://jena.apache.org/Fuseki"; ;
+
+    /**
+     * a unique IRI including the symbol notation for which properties should 
be
+     * appended
+     */
+    static public String    FusekiSymbolIRI              = 
"http://jena.apache.org/fuseki#"; ;
+
+    /** Default location of the pages for the Fuseki UI  */
+    static public String    PagesStatic                  = "pages" ;
+    
+    /** Dummy base URi string for parsing SPARQL Query and Update requests */
+    static public final String BaseParserSPARQL          = 
"http://server/unset-base/"; ;
+    
+    /** Dummy base URi string for parsing SPARQL Query and Update requests */
+    static public final String BaseUpload                = 
"http://server/unset-base/"; ;
+
+    /**
+     * A relative resources path to the location of 
+     * <code>fuseki-properties.xml</code> file.
+     */
+    static private String   metadataLocation             = 
"org/apache/jena/fuseki/fuseki-properties.xml" ;
+
+    /**
+     * Object which holds metadata specified within
+     * {@link Fuseki#metadataLocation}
+     */
+    static private Metadata metadata                     = initMetadata() ;
+
+    private static Metadata initMetadata() {
+        Metadata m = new Metadata() ;
+        // m.addMetadata(metadataDevLocation) ;
+        m.addMetadata(metadataLocation) ;
+        return m ;
+    }
+
+    /** The name of the Fuseki server. Set to the string <code>Fuseki</code> 
by default. */
+    static public final String        NAME              = "Fuseki" ;
+
+    /** Version of this Fuseki instance */
+    static public final String        VERSION           = metadata.get(PATH + 
".version", "development") ;
+
+    /** Date when Fuseki was built */
+    static public final String        BUILD_DATE        = metadata.get(PATH + 
".build.datetime", "unknown") ;
+
+    /** An identifier for the HTTP Fuseki server instance */
+    static public final String        serverHttpName    = NAME + " (" + 
VERSION + ")" ;
+
+    /** Loger name for operations */
+    public static final String        actionLogName     = PATH + ".Fuseki" ;
+
+    /** Instance of log for operations */
+    public static final Logger        actionLog         = 
LoggerFactory.getLogger(actionLogName) ;
+
+    /** Logger name for standard webserver log file request log */
+    public static final String        requestLogName    = PATH + ".Request" ;
+
+    // See HttpAction.finishRequest.
+    /** Instance of log for operations */
+    public static final Logger        requestLog        = null ; // 
LoggerFactory.getLogger(requestLogName) ;
+
+    /** Admin log file for operations */
+    public static final String        adminLogName      = PATH + ".Admin" ;
+
+    /** Instance of log for operations */
+    public static final Logger        adminLog          = 
LoggerFactory.getLogger(adminLogName) ;
+
+    /** Admin log file for operations */
+    public static final String        builderLogName    = PATH + ".Builder" ;
+
+    /** Instance of log for operations */
+    public static final Logger        builderLog        = 
LoggerFactory.getLogger(builderLogName) ;
+
+    /** Validation log file for operations */
+    public static final String        validationLogName = PATH + ".Validate" ;
+
+    /** Instance of log for validation */
+    public static final Logger        validationLog     = 
LoggerFactory.getLogger(adminLogName) ;
+
+    /** Actual log file for general server messages. */
+    public static final String        serverLogName     = PATH + ".Server" ;
+
+    /** Instance of log for general server messages */
+    public static final Logger        serverLog         = 
LoggerFactory.getLogger(serverLogName) ;
+
+    /** Logger used for the servletContent.log operations (if settable -- 
depends on environment) */
+    public static final String        servletRequestLogName     = PATH + 
".Request" ;
+
+    /** Actual log file for config server messages. */
+    public static final String        configLogName     = PATH + ".Config" ;
+
+    /** Instance of log for config server message s */
+    public static final Logger        configLog         = 
LoggerFactory.getLogger(configLogName) ;
+
+    /** Instance of log for config server message s */
+    public static boolean             verboseLogging    = false ;
+
+    /**
+     * An instance of management for stream opening, including redirecting
+     * through a location mapper whereby a name (e.g. URL) is redirected to
+     * another name (e.g. local file).
+     * */
+    public static final StreamManager webStreamManager ;
+    static {
+        webStreamManager = new StreamManager() ;
+        // Only know how to handle http URLs
+        webStreamManager.addLocator(new LocatorHTTP()) ;
+        webStreamManager.addLocator(new LocatorFTP()) ;
+    }
+
+    /** Default (and development) root of the Fuseki installation for fixed 
files. */ 
+    public static String DFT_FUSEKI_HOME = "." ;
+    /** Default (and development) root of the varying files in this 
deployment. */ 
+    public static String DFT_FUSEKI_BASE = "." ;
+    
+    private static boolean            initialized       = false ;
+    
+    // Serevr start time and uptime.
+    private static final long startMillis = System.currentTimeMillis() ;
+    // Hide server locale
+    private static final Calendar cal = 
Calendar.getInstance(TimeZone.getTimeZone("00:00")) ; 
+    static { cal.setTimeInMillis(startMillis) ; }  // Exactly the same start 
point!
+    
+    private static final String startDateTime = 
Utils.calendarToXSDDateTimeString(cal) ; 
+    
+    /** Return the number of milliseconds since the server started */  
+    public static long serverUptimeMillis() {
+        return System.currentTimeMillis() - startMillis ;
+    }
+    
+    /** Server uptime in seconds */ 
+    public static long serverUptimeSeconds() {
+        long x = System.currentTimeMillis() - startMillis ;
+        return TimeUnit.MILLISECONDS.toSeconds(x) ;
+    }
+    
+    /** XSD DateTime for when the server started */
+    public static String serverStartedAt() {
+        return startDateTime ;
+    }
+
+
+    /**
+     * Initialize an instance of the Fuseki server stack.
+     */
+    public synchronized static void init() {
+        if ( initialized )
+            return ;
+        initialized = true ;
+        ARQ.init() ;
+        SystemInfo sysInfo = new SystemInfo(FusekiIRI, PATH, VERSION, 
BUILD_DATE) ;
+        SystemARQ.registerSubSystem(sysInfo) ;
+        RIOT.init() ;
+        TDB.init() ;
+        MappingRegistry.addPrefixMapping("fuseki", FusekiSymbolIRI) ;
+
+        TDB.setOptimizerWarningFlag(false) ;
+        // Don't set TDB batch commits.
+        // This can be slower, but it less memory hungry and more predictable.
+        TransactionManager.QueueBatchSize = 0 ;
+    }
+    
+    /**
+     * Get server global {@link com.hp.hpl.jena.sparql.util.Context}.
+     * 
+     * @return {@link com.hp.hpl.jena.query.ARQ#getContext()}
+     */
+    public static Context getContext() {
+        return ARQ.getContext() ;
+    }
+
+    // Force a call to init.
+    static {
+        init() ;
+    }
+}

Reply via email to