http://git-wip-us.apache.org/repos/asf/jena/blob/2fb788d3/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 deleted file mode 100644 index 09a2151..0000000 --- a/jena-fuseki2/examples/service-tdb-2.ttl +++ /dev/null @@ -1,32 +0,0 @@ -## 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/2fb788d3/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 deleted file mode 100644 index 82a3fc2..0000000 --- a/jena-fuseki2/examples/service-tdb-mem.ttl +++ /dev/null @@ -1,32 +0,0 @@ -## 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/2fb788d3/jena-fuseki2/fuseki ---------------------------------------------------------------------- diff --git a/jena-fuseki2/fuseki b/jena-fuseki2/fuseki deleted file mode 100644 index 5e0ca07..0000000 --- a/jena-fuseki2/fuseki +++ /dev/null @@ -1,477 +0,0 @@ -#!/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/2fb788d3/jena-fuseki2/fuseki-server ---------------------------------------------------------------------- diff --git a/jena-fuseki2/fuseki-server b/jena-fuseki2/fuseki-server deleted file mode 100755 index 679b3bd..0000000 --- a/jena-fuseki2/fuseki-server +++ /dev/null @@ -1,64 +0,0 @@ -#!/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/2fb788d3/jena-fuseki2/fuseki-server.bat ---------------------------------------------------------------------- diff --git a/jena-fuseki2/fuseki-server.bat b/jena-fuseki2/fuseki-server.bat deleted file mode 100644 index 6bfd370..0000000 --- a/jena-fuseki2/fuseki-server.bat +++ /dev/null @@ -1,3 +0,0 @@ -@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/2fb788d3/jena-fuseki2/make-html ---------------------------------------------------------------------- diff --git a/jena-fuseki2/make-html b/jena-fuseki2/make-html deleted file mode 100755 index e998657..0000000 --- a/jena-fuseki2/make-html +++ /dev/null @@ -1,14 +0,0 @@ -#!/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/2fb788d3/jena-fuseki2/make_cp_mvn ---------------------------------------------------------------------- diff --git a/jena-fuseki2/make_cp_mvn b/jena-fuseki2/make_cp_mvn deleted file mode 100755 index 94cb84b..0000000 --- a/jena-fuseki2/make_cp_mvn +++ /dev/null @@ -1,34 +0,0 @@ -#!/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/2fb788d3/jena-fuseki2/make_links ---------------------------------------------------------------------- diff --git a/jena-fuseki2/make_links b/jena-fuseki2/make_links deleted file mode 100755 index 76efd4c..0000000 --- a/jena-fuseki2/make_links +++ /dev/null @@ -1,9 +0,0 @@ -#!/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/2fb788d3/jena-fuseki2/pom.xml ---------------------------------------------------------------------- diff --git a/jena-fuseki2/pom.xml b/jena-fuseki2/pom.xml deleted file mode 100644 index b2fff59..0000000 --- a/jena-fuseki2/pom.xml +++ /dev/null @@ -1,434 +0,0 @@ -<?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/2fb788d3/jena-fuseki2/run-fuseki ---------------------------------------------------------------------- diff --git a/jena-fuseki2/run-fuseki b/jena-fuseki2/run-fuseki deleted file mode 100755 index 588c4a0..0000000 --- a/jena-fuseki2/run-fuseki +++ /dev/null @@ -1,78 +0,0 @@ -#!/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/2fb788d3/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 deleted file mode 100644 index 2322929..0000000 --- a/jena-fuseki2/src-dev/dev/BackwardForwardDescribeFactory.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package 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/2fb788d3/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 deleted file mode 100644 index ec5b386..0000000 --- a/jena-fuseki2/src-dev/dev/PROJECT.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package 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/2fb788d3/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 deleted file mode 100644 index 586a5e6..0000000 --- a/jena-fuseki2/src-dev/dev/RunAsWebapp.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package 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/2fb788d3/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 deleted file mode 100644 index 86364bc..0000000 --- a/jena-fuseki2/src-dev/dev/RunFuseki2.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package 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/2fb788d3/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 deleted file mode 100644 index 8d8495a..0000000 --- a/jena-fuseki2/src/main/java/org/apache/jena/fuseki/DEF.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package 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/2fb788d3/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 deleted file mode 100644 index b2bea5b..0000000 --- a/jena-fuseki2/src/main/java/org/apache/jena/fuseki/Fuseki.java +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package 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() ; - } -} http://git-wip-us.apache.org/repos/asf/jena/blob/2fb788d3/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiCmd.java ---------------------------------------------------------------------- diff --git a/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiCmd.java b/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiCmd.java deleted file mode 100644 index 745d430..0000000 --- a/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiCmd.java +++ /dev/null @@ -1,335 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.jena.fuseki ; - -import java.util.List ; - -import org.apache.jena.atlas.lib.FileOps ; -import org.apache.jena.fuseki.build.Template ; -import org.apache.jena.fuseki.jetty.JettyServerConfig ; -import org.apache.jena.fuseki.jetty.JettyFuseki ; -import org.apache.jena.fuseki.server.FusekiServletContextListener ; -import org.apache.jena.fuseki.server.ServerInitialConfig ; -import org.apache.jena.riot.Lang ; -import org.apache.jena.riot.RDFDataMgr ; -import org.apache.jena.riot.RDFLanguages ; -import org.slf4j.Logger ; -import arq.cmd.CmdException ; -import arq.cmdline.ArgDecl ; -import arq.cmdline.CmdARQ ; -import arq.cmdline.ModDatasetAssembler ; - -import com.hp.hpl.jena.query.ARQ ; -import com.hp.hpl.jena.query.Dataset ; -import com.hp.hpl.jena.sparql.core.DatasetGraphFactory ; -import com.hp.hpl.jena.tdb.TDB ; -import com.hp.hpl.jena.tdb.sys.Names ; -import com.hp.hpl.jena.tdb.transaction.TransactionManager ; - -public class FusekiCmd { - // This allows us to set logging before calling FusekiCmdInner - // FusekiCmdInner inherits from CmdMain which statically sets logging. - // By java classloading, super class statics run before the - // statics of a class are run. - // (Cmd logging should be done lower down but it's normally convenient - // to have to set in all circumstances). - static { FusekiLogging.setLogging() ; } - - static public void main(String... argv) { - FusekiCmdInner.main(argv); - } - - static class FusekiCmdInner extends CmdARQ { - // Legacy. - private static ArgDecl argMgt = new ArgDecl(ArgDecl.NoValue, "mgt") ; - private static ArgDecl argMgtPort = new ArgDecl(ArgDecl.HasValue, "mgtPort", "mgtport") ; - private static ArgDecl argHome = new ArgDecl(ArgDecl.HasValue, "home") ; - private static ArgDecl argPages = new ArgDecl(ArgDecl.HasValue, "pages") ; - - private static ArgDecl argMem = new ArgDecl(ArgDecl.NoValue, "mem") ; - private static ArgDecl argAllowUpdate = 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") ; - private static ArgDecl argTDB = new ArgDecl(ArgDecl.HasValue, "loc", "location") ; - 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 argFusekiConfig = new ArgDecl(ArgDecl.HasValue, "config", "conf") ; - private static ArgDecl argJettyConfig = new ArgDecl(ArgDecl.HasValue, "jetty-config") ; - private static ArgDecl argGZip = new ArgDecl(ArgDecl.HasValue, "gzip") ; - - // Deprecated. Use shiro. - private static ArgDecl argBasicAuth = new ArgDecl(ArgDecl.HasValue, "basic-auth") ; - - // private static ModLocation modLocation = new ModLocation() ; - private static ModDatasetAssembler modDataset = new ModDatasetAssembler() ; - - // fuseki [--mem|--desc assembler.ttl] [--port PORT] **** /datasetURI - - static public void main(String... argv) { - // Just to make sure ... - ARQ.init() ; - TDB.init() ; - Fuseki.init() ; - new FusekiCmdInner(argv).mainRun() ; - } - - private JettyServerConfig jettyServerConfig = new JettyServerConfig() ; - { - jettyServerConfig.port = 3030 ; - jettyServerConfig.contextPath = "/" ; - jettyServerConfig.jettyConfigFile = null ; - jettyServerConfig.pages = Fuseki.PagesStatic ; - jettyServerConfig.enableCompression = true ; - jettyServerConfig.verboseLogging = false ; - } - - private ServerInitialConfig cmdLineDataset = new ServerInitialConfig() ; - - 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(argPort, "--port", "Listen on this port number") ; - add(argPages, "--pages=DIR", "Set of pages to serve as static content") ; - // Set via jetty config file. - 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(argAllowUpdate, "--update", "Allow updates (via SPARQL Update and SPARQL HTTP Update)") ; - add(argFusekiConfig, "--config=", "Use a configuration file to determine the services") ; - add(argJettyConfig, "--jetty-config=FILE", "Set up the server (not services) with a Jetty XML file") ; - add(argBasicAuth) ; - //add(argMgt, "--mgt", "Enable the management commands") ; - add(argMgt) ; // Legacy - add(argMgtPort) ; // Legacy - //add(argMgtPort, "--mgtPort=port", "Port for management optations") ; - //add(argHome, "--home=DIR", "Root of Fuseki installation (overrides environment variable FUSEKI_HOME)") ; - add(argGZip, "--gzip=on|off", "Enable GZip compression (HTTP Accept-Encoding) if request header set") ; - - //add(argUber) ; - // add(argGSP) ; - - 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 ; - - if ( contains(argFusekiConfig) ) - cmdLineDataset.fusekiConfigFile = getValue(argFusekiConfig) ; - - ArgDecl assemblerDescDecl = new ArgDecl(ArgDecl.HasValue, "desc", "dataset") ; - - // ---- Datasets - - if ( contains(argMem) ) - x++ ; - if ( contains(argFile) ) - x++ ; - if ( contains(assemblerDescDecl) ) - x++ ; - if ( contains(argTDB) ) - x++ ; - if ( contains(argMemTDB) ) - x++ ; - - if ( cmdLineDataset.fusekiConfigFile != null ) { - if ( x > 1 ) - throw new CmdException("Dataset specified on the command line and also a configuration file specified.") ; - } else { - // if ( x == 0 ) - // throw new CmdException("Required: either --config=FILE or one of --mem, --file, --loc or --desc") ; - } - - if ( contains(argMem) ) { - log.info("Dataset: in-memory") ; - cmdLineDataset = new ServerInitialConfig() ; - cmdLineDataset.templateFile = Template.templateMemFN ; - // - } - - if ( contains(argFile) ) { - String filename = getValue(argFile) ; - log.info("Dataset: in-memory: load file: " + filename) ; - if ( !FileOps.exists(filename) ) - throw new CmdException("File not found: " + filename) ; - - // Directly populate the dataset. - cmdLineDataset = new ServerInitialConfig() ; - cmdLineDataset.dsg = DatasetGraphFactory.createMem() ; - - // INITIAL DATA. - Lang language = RDFLanguages.filenameToLang(filename) ; - if ( language == null ) - throw new CmdException("Can't guess language for file: " + filename) ; - RDFDataMgr.read(cmdLineDataset.dsg, filename) ; - } - - if ( contains(argMemTDB) ) { - //log.info("TDB dataset: in-memory") ; - cmdLineDataset = new ServerInitialConfig() ; - cmdLineDataset.templateFile = Template.templateTDBMemFN ; - cmdLineDataset.params.put(Template.DIR, Names.memName) ; - } - - if ( contains(argTDB) ) { - cmdLineDataset = new ServerInitialConfig() ; - cmdLineDataset.templateFile = Template.templateTDBDirFN ; - - String dir = getValue(argTDB) ; - cmdLineDataset.params.put(Template.DIR, dir) ; - } - - // Otherwise - if ( contains(assemblerDescDecl) ) { - log.info("Dataset from assembler") ; - // Need to add service details. - Dataset ds = modDataset.createDataset() ; - //cmdLineDataset.dsg = ds.asDatasetGraph() ; - } - - if ( cmdLineDataset != null ) { - if ( getPositional().size() > 1 ) - throw new CmdException("Multiple dataset path names given") ; - if ( getPositional().size() != 0 ) { - cmdLineDataset.datasetPath = getPositionalArg(0) ; - if ( cmdLineDataset.datasetPath.length() > 0 && !cmdLineDataset.datasetPath.startsWith("/") ) - throw new CmdException("Dataset path name must begin with a /: " + cmdLineDataset.datasetPath) ; - cmdLineDataset.allowUpdate = contains(argAllowUpdate) ; - if ( ! cmdLineDataset.allowUpdate ) - Fuseki.serverLog.info("Running in read-only mode for "+cmdLineDataset.datasetPath) ; - // Include the dataset name as NAME for any templates. - cmdLineDataset.params.put(Template.NAME, cmdLineDataset.datasetPath) ; - } - } - - // ---- Jetty server - if ( contains(argBasicAuth) ) - Fuseki.configLog.warn("--basic-auth ignored: Use Apache Shiro security - see shiro.ini") ; - - if ( contains(argPort) ) { - String portStr = getValue(argPort) ; - try { - jettyServerConfig.port = Integer.parseInt(portStr) ; - } catch (NumberFormatException ex) { - throw new CmdException(argPort.getKeyName() + " : bad port number: " + portStr) ; - } - } - - if ( contains(argMgt) ) - Fuseki.configLog.warn("Fuseki v2: Management functions are always enabled. --mgt not needed.") ; - - if ( contains(argMgtPort) ) - Fuseki.configLog.warn("Fuseki v2: Management functions are always on the same port as the server. --mgtPort ignored.") ; - -// if ( contains(argMgt) ) { -// jettyServerConfig.mgtPort = 0 ; -// if ( contains(argMgtPort) ) { -// String mgtPortStr = getValue(argMgtPort) ; -// try { -// jettyServerConfig.mgtPort = Integer.parseInt(mgtPortStr) ; -// } catch (NumberFormatException ex) { -// throw new CmdException("--"+argMgtPort.getKeyName() + " : bad port number: " + mgtPortStr) ; -// } -// } -// } - - if ( contains(argLocalhost) ) - jettyServerConfig.loopback = true ; - - if ( contains(argTimeout) ) { - String str = getValue(argTimeout) ; - ARQ.getContext().set(ARQ.queryTimeout, str) ; - } - - if ( contains(argJettyConfig) ) { - jettyServerConfig.jettyConfigFile = getValue(argJettyConfig) ; - if ( !FileOps.exists(jettyServerConfig.jettyConfigFile) ) - throw new CmdException("No such file: " + jettyServerConfig.jettyConfigFile) ; - } - - if ( contains(argBasicAuth) ) { - jettyServerConfig.authConfigFile = getValue(argBasicAuth) ; - if ( !FileOps.exists(jettyServerConfig.authConfigFile) ) - throw new CmdException("No such file: " + jettyServerConfig.authConfigFile) ; - } - - if ( contains(argHome) ) { - Fuseki.configLog.warn("--home ignored (use enviroment variables $FUSEKI_HOME and $FUSEKI_BASE)") ; -// List<String> args = super.getValues(argHome) ; -// homeDir = args.get(args.size() - 1) ; - } - - if ( contains(argPages) ) { - List<String> args = super.getValues(argPages) ; - jettyServerConfig.pages = args.get(args.size() - 1) ; - } - - 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() { - //************* - FusekiServletContextListener.initialSetup = cmdLineDataset ; - // For standalone, command line use ... - JettyFuseki.initializeServer(jettyServerConfig) ; - JettyFuseki.instance.start() ; - JettyFuseki.instance.join() ; - System.exit(0) ; - } - - @Override - protected String getCommandName() { - return "fuseki" ; - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jena/blob/2fb788d3/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiConfigException.java ---------------------------------------------------------------------- diff --git a/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiConfigException.java b/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiConfigException.java deleted file mode 100644 index 5e1b018..0000000 --- a/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiConfigException.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.jena.fuseki; - - -public class FusekiConfigException extends FusekiException -{ - public FusekiConfigException(String msg, Throwable cause) { super(msg, cause) ; } - public FusekiConfigException(String msg) { super(msg) ; } - public FusekiConfigException(Throwable cause) { super(cause) ; } - public FusekiConfigException() { super() ; } -} http://git-wip-us.apache.org/repos/asf/jena/blob/2fb788d3/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiException.java ---------------------------------------------------------------------- diff --git a/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiException.java b/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiException.java deleted file mode 100644 index 04953ce..0000000 --- a/jena-fuseki2/src/main/java/org/apache/jena/fuseki/FusekiException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.jena.fuseki; - -import com.hp.hpl.jena.sparql.ARQException ; - -public class FusekiException extends ARQException -{ - public FusekiException(String msg, Throwable cause) { super(msg, cause) ; } - public FusekiException(String msg) { super(msg) ; } - public FusekiException(Throwable cause) { super(cause) ; } - public FusekiException() { super() ; } -}
