You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2017/06/25 14:36:22 UTC

[3/6] jena git commit: JENA-1366: Fuseki embedded as a standalone server

JENA-1366: Fuseki embedded as a standalone server


Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/2e361dab
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/2e361dab
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/2e361dab

Branch: refs/heads/master
Commit: 2e361daba1e3e2432c197b2e99cc2cc34c2bae54
Parents: 63e452e
Author: Andy Seaborne <an...@apache.org>
Authored: Wed Jun 21 19:13:49 2017 +0100
Committer: Andy Seaborne <an...@apache.org>
Committed: Wed Jun 21 19:19:38 2017 +0100

----------------------------------------------------------------------
 jena-fuseki2/jena-fuseki-basic/pom.xml          |  256 +
 jena-fuseki2/jena-fuseki-basic/run-sparqler     |    8 +
 .../jena-fuseki-basic/sparqler/data/books.ttl   |   46 +
 .../jena-fuseki-basic/sparqler/data/empty.nt    |    1 +
 .../sparqler/data/sparql-data.ttl               |  101 +
 .../sparqler/data/underground.ttl               | 8996 ++++++++++++++++++
 .../sparqler/log4j-foreground.properties        |   44 +
 .../sparqler/log4j-server.properties            |   44 +
 .../jena-fuseki-basic/sparqler/pages/D.nt       |    0
 .../jena-fuseki-basic/sparqler/pages/D.rdf      |    8 +
 .../jena-fuseki-basic/sparqler/pages/D.ttl      |    3 +
 .../sparqler/pages/crossdomain.xml              |    3 +
 .../sparqler/pages/data-validator.html          |   48 +
 .../jena-fuseki-basic/sparqler/pages/doc.css    |  127 +
 .../jena-fuseki-basic/sparqler/pages/fuseki.css |  148 +
 .../jena-fuseki-basic/sparqler/pages/index.html |   73 +
 .../sparqler/pages/iri-validator.html           |   22 +
 .../sparqler/pages/query-validator.html         |   71 +
 .../jena-fuseki-basic/sparqler/pages/query.html |   63 +
 .../jena-fuseki-basic/sparqler/pages/robots.txt |    2 +
 .../sparqler/pages/sparql.html                  |   51 +
 .../sparqler/pages/update-validator.html        |   46 +
 .../sparqler/pages/update.html                  |   27 +
 .../sparqler/pages/validator.html               |   35 +
 .../sparqler/pages/xml-to-html-links.xsl        |  183 +
 .../sparqler/pages/xml-to-html-plain.xsl        |  187 +
 .../sparqler/pages/xml-to-html.xsl              |  187 +
 .../jena-fuseki-basic/sparqler/run-sparqler     |   63 +
 .../apache/jena/fuseki/cmds/FusekiBasicCmd.java |  468 +
 .../apache/jena/fuseki/cmds/PlatformInfo.java   |  122 +
 jena-fuseki2/pom.xml                            |    1 +
 31 files changed, 11434 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/pom.xml
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/pom.xml b/jena-fuseki2/jena-fuseki-basic/pom.xml
new file mode 100644
index 0000000..7f20361
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/pom.xml
@@ -0,0 +1,256 @@
+<?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 Basic Server</name>
+  <artifactId>jena-fuseki-basic</artifactId>
+
+  <parent>
+    <groupId>org.apache.jena</groupId>
+    <artifactId>jena-fuseki</artifactId>
+    <version>2.7.0-SNAPSHOT</version>
+  </parent> 
+
+  <packaging>jar</packaging>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.jena</groupId>
+      <artifactId>jena-cmds</artifactId>
+      <version>3.4.0-SNAPSHOT</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.jena</groupId>
+      <artifactId>jena-text</artifactId>
+      <version>3.4.0-SNAPSHOT</version>
+    </dependency>
+
+    <!-- Add logging -->
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+      <optional>true</optional>
+    </dependency>
+
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <optional>true</optional>
+    </dependency>
+
+    <!-- This depends on jena-fuseki-core -->
+    <dependency>
+      <groupId>org.apache.jena</groupId>
+      <artifactId>jena-fuseki-embedded</artifactId>
+      <version>2.7.0-SNAPSHOT</version>
+
+      <!-- No specific logging - leave to the application -->
+      <exclusions>
+         <exclusion>
+           <groupId>org.apache.shiro</groupId>
+           <artifactId>shiro-core</artifactId>
+         </exclusion>
+         <exclusion>
+           <groupId>org.apache.shiro</groupId>
+           <artifactId>shiro-web</artifactId>
+         </exclusion>
+      </exclusions>
+    </dependency>
+
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+      </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-surefire-plugin</artifactId>
+        <configuration>
+          <includes>
+            <include>**/TS_*.java</include>
+          </includes>
+        </configuration>
+      </plugin>
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <configuration>
+          <skip>true</skip>
+        </configuration>
+      </plugin>
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <configuration>
+          <overWriteReleases>false</overWriteReleases>
+          <overWriteIfNewer>true</overWriteIfNewer>
+        </configuration>
+      </plugin>
+
+      <!-- Use <build><finalName> for chnage of artifact produced. -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <configuration>
+          <!--
+          <finalName>fuseki-basic</finalName>
+          <shadedArtifactAttached>false</shadedArtifactAttached>
+          -->
+          
+          <shadedArtifactAttached>true</shadedArtifactAttached>
+          <!-- Does not deploy? - ->
+          <shadedArtifactId></shadedArtifactId>
+          -->
+          <shadedClassifierName>server</shadedClassifierName>
+
+
+          <transformers>
+            <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+              <mainClass>org.apache.jena.fuseki.cmds.FusekiBasicCmd</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.rat</groupId>
+        <artifactId>apache-rat-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>rat-checks</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>check</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <excludeSubProjects>true</excludeSubProjects>
+          <excludes>
+            <exclude>**/sparqler/**</exclude>
+            <exclude>**/.project</exclude>
+            <exclude>**/.settings/**</exclude>
+            <exclude>**/.classpath</exclude>
+            <exclude>**/*.log</exclude>
+            <exclude>**/README.*</exclude>
+            <exclude>**/META-INF/services/*</exclude>
+            <!--
+                Javadoc add-ons files are required to be simple and our javadoc configuration
+                will ensure appropriate license and copyright statements are inserted
+                into generated documentation anyway so no need to put license statements in these
+                files
+            -->
+            <exclude>**/src/main/**/*.html</exclude>
+            <exclude>**/DEPENDENCIES</exclude>
+            <!--
+                Text and Markdown files are typically used only for documentation purposes
+                and license declarations are usually spurious in these files since often they
+                will refer to the LICENSE/NOTICE for users to find the actual licenses
+            -->
+            <exclude>**/*.txt</exclude>
+            <exclude>**/*.md</exclude>
+            <exclude>**/*.mdtext</exclude>
+            
+            <!--
+                META-INF services files can include comments but a license header would be
+                unecessarily clutter so we exclude these
+            -->
+            <exclude>**/META-INF/services/*</exclude>
+            
+            <!--
+                Jena historically has large numbers of small test file
+                with no license headers.  Such small files are not required 
+                to have headers. 
+
+                In addition, there are files with different Licenses
+                (e.g. W3C Software Licence, W3C Test Suite License) as
+                noted in the code tree.
+            -->
+            <exclude>**/testing/**/*</exclude>
+
+            <exclude>**/log4j.properties</exclude>
+            <exclude>**/log4j-testing.properties</exclude>
+            <exclude>**/DB/**/*</exclude>
+            <!-- TDB config files JSON - no comments allowed -->
+            <exclude>**/tdb*.cfg</exclude>
+            <!-- Exclude anything created during the build (plugin generated files) ->-->
+            <exclude>**/target/**/*</exclude>
+            <!-- MSHADE-124 -->
+            <exclude>**/dependency-reduced-pom.xml</exclude>
+          </excludes>
+        </configuration>
+      </plugin>
+
+
+    </plugins>
+
+  </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/run-sparqler
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/run-sparqler b/jena-fuseki2/jena-fuseki-basic/run-sparqler
new file mode 100755
index 0000000..89c38bd
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/run-sparqler
@@ -0,0 +1,8 @@
+#!/bin/bash
+## Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
+
+(
+    #echo "cd sparqler"
+    cd sparqler
+    env BACKGROUND=0 ./run-sparqler "$@"
+)

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/sparqler/data/books.ttl
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/sparqler/data/books.ttl b/jena-fuseki2/jena-fuseki-basic/sparqler/data/books.ttl
new file mode 100644
index 0000000..cece401
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/sparqler/data/books.ttl
@@ -0,0 +1,46 @@
+@prefix dc:        <http://purl.org/dc/elements/1.1/> .
+@prefix vcard:     <http://www.w3.org/2001/vcard-rdf/3.0#> .
+@prefix ns:        <http://example.org/ns#> .
+
+@prefix :          <http://example.org/book/> .
+
+# A small dataset for usage examples of Joseki
+# This data is intentionaly irregular (e.g. different ways to
+# record the book creator) as if the information is either an
+# aggregation or was created at different times.
+
+:book1
+    dc:title    "Harry Potter and the Philosopher's Stone" ;
+    dc:creator  "J.K. Rowling" ;
+    .
+    
+:book2
+    dc:title    "Harry Potter and the Chamber of Secrets" ;
+    dc:creator  _:a .
+    
+:book3
+    dc:title    "Harry Potter and the Prisoner Of Azkaban" ;
+    dc:creator  _:a .
+    
+:book4
+    dc:title    "Harry Potter and the Goblet of Fire" .
+    
+:book5
+    dc:title    "Harry Potter and the Order of the Phoenix";
+    dc:creator  "J.K. Rowling" ;
+    .
+
+:book6
+    dc:title    "Harry Potter and the Half-Blood Prince";
+    dc:creator  "J.K. Rowling" .
+
+:book7
+    dc:title    "Harry Potter and the Deathly Hallows" ;
+    dc:creator  "J.K. Rowling" .
+_:a
+    vcard:FN "J.K. Rowling" ;
+    vcard:N
+        [ vcard:Family "Rowling" ;
+          vcard:Given "Joanna" 
+        ]
+    .

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/sparqler/data/empty.nt
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/sparqler/data/empty.nt b/jena-fuseki2/jena-fuseki-basic/sparqler/data/empty.nt
new file mode 100644
index 0000000..739dd79
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/sparqler/data/empty.nt
@@ -0,0 +1 @@
+# This is empty (except for this line!).

http://git-wip-us.apache.org/repos/asf/jena/blob/2e361dab/jena-fuseki2/jena-fuseki-basic/sparqler/data/sparql-data.ttl
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-basic/sparqler/data/sparql-data.ttl b/jena-fuseki2/jena-fuseki-basic/sparqler/data/sparql-data.ttl
new file mode 100755
index 0000000..d38ecd9
--- /dev/null
+++ b/jena-fuseki2/jena-fuseki-basic/sparqler/data/sparql-data.ttl
@@ -0,0 +1,101 @@
+## People
+## Books + Prices
+## Reviews
+
+@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
+@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix fn:      <http://www.w3.org/2005/xpath-functions#> .
+@prefix foaf: 	 <http://xmlns.com/foaf/0.1/> .
+@prefix skos:    <http://www.w3.org/2008/05/skos#> .
+@prefix dc10:    <http://purl.org/dc/elements/1.0/> .
+@prefix dc11:    <http://purl.org/dc/elements/1.1/> .
+@prefix dc:      <http://purl.org/dc/elements/1.1/> .
+@prefix :        <http://example/> .
+
+:A  a           foaf:Person ;
+    foaf:mbox <ma...@example.net> ;
+    foaf:name   "Alice" ;
+    foaf:birthday "20-05" ;
+    foaf:knows  :B ;
+    foaf:knows  :C .
+
+:B  a          foaf:Person ;
+    foaf:name   "Bob" ;
+    foaf:birthday "13-06" ;
+    foaf:knows  :A ;
+    foaf:knows  :C .
+
+
+:C  a           foaf:Person ;
+    foaf:name   "Charlie"  ;
+    foaf:knows  :A ;
+    foaf:knows  :B .
+
+
+:D  a           foaf:Person ;
+    foaf:name   "Dave" ;
+    foaf:knows  :B .
+
+:E  a           foaf:Person ;
+    foaf:name   "EveBot" .
+
+
+@prefix stock: <http://example.org/stock#> .
+@prefix inv: <http://example.org/inventory#> .
+
+stock:book1 dc:title "SPARQL Query Language Tutorial" ;
+            inv:price 10 ;
+            inv:quantity 3 .
+
+stock:book2 dc:title "SPARQL Query Language (2nd ed)" ;
+            inv:price 20 ;
+            inv:quantity 5 .
+
+stock:book3 dc:title "Moving from SQL to SPARQL" ;
+            inv:price 5 ;
+            inv:quantity 0 .
+
+stock:book4 dc:title "Applying XQuery" ;
+            inv:price 20 ;
+            inv:quantity 8 .
+
+## Reviews
+## Record some rating as 1 (low) to 5 (high)
+
+:review1
+    dc:creator  :A ;
+    :about      stock:book1 ;
+    :rating     4 .
+
+:review2
+    dc:creator  :B ;
+    :about      stock:book1 ;
+    :rating     5 .
+
+:review3
+    dc:creator  :B ;
+    :about      stock:book2 ;
+    :rating     4 .
+
+:review4
+    dc:creator  :B ;
+    :about      stock:book3 ;
+    :rating     3 .
+
+:review5
+    dc:creator  :B ;
+    :about      stock:book3 ;
+    :rating     1 .
+
+:review5
+    dc:creator  :B ;
+    :about      stock:book3 ;
+    :rating     1 .
+
+:review6
+    dc:creator  :E ;
+    :about      stock:book3 ;
+    :rating     4 .
+
+