diff --git a/pom.xml b/pom.xml index c9fcd74..2674edd 100644 --- a/pom.xml +++ b/pom.xml @@ -29,8 +29,8 @@ Ruben Verborgh ruben.verborgh@ugent.be http://ruben.verborgh.org - iMinds - http://iminds.be + imec + http://imec.be Europe/Brussels @@ -39,7 +39,7 @@ miel.vandersande@ugent.be http://semweb.mmlab.be iMinds - http://iminds.be + http://imec.be Europe/Brussels @@ -60,22 +60,22 @@ org.apache.jena jena-core - 3.0.0 + 3.0.1 org.apache.jena jena-arq - 3.0.0 + 3.0.1 org.apache.httpcomponents httpclient - 4.3.5 + 4.3.6 com.google.code.gson gson - 2.5 + 2.7 javax.servlet diff --git a/src/main/java/org/linkeddatafragments/servlet/LinkedDataFragmentServlet.java b/src/main/java/org/linkeddatafragments/servlet/LinkedDataFragmentServlet.java index 10797d1..7b897cd 100644 --- a/src/main/java/org/linkeddatafragments/servlet/LinkedDataFragmentServlet.java +++ b/src/main/java/org/linkeddatafragments/servlet/LinkedDataFragmentServlet.java @@ -4,6 +4,8 @@ import java.io.File; import java.io.FileReader; import java.io.IOException; +import java.io.InputStream; +import java.net.URL; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -13,8 +15,6 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.ModelFactory; import org.apache.jena.riot.Lang; import org.linkeddatafragments.config.ConfigReader; import org.linkeddatafragments.datasource.DataSourceFactory; @@ -46,7 +46,7 @@ public class LinkedDataFragmentServlet extends HttpServlet { /** * */ - public final static String CFGFILE = "configFile"; + public final static String CFGFILE = "configFile"; private ConfigReader config; private final HashMap dataSources = new HashMap<>(); diff --git a/src/main/java/org/linkeddatafragments/standalone/JettyServer.java b/src/main/java/org/linkeddatafragments/standalone/JettyServer.java index 8e3a294e..a73fce0 100644 --- a/src/main/java/org/linkeddatafragments/standalone/JettyServer.java +++ b/src/main/java/org/linkeddatafragments/standalone/JettyServer.java @@ -1,20 +1,15 @@ package org.linkeddatafragments.standalone; +import java.net.URL; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.DefaultParser; import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.Options; -import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.ContextHandler; -import org.eclipse.jetty.server.handler.ContextHandlerCollection; -import org.eclipse.jetty.server.handler.ResourceHandler; import org.eclipse.jetty.servlet.DefaultServlet; import org.eclipse.jetty.servlet.ServletContextHandler; -import org.eclipse.jetty.servlet.ServletHandler; import org.eclipse.jetty.servlet.ServletHolder; -import org.eclipse.jetty.util.resource.Resource; import org.linkeddatafragments.servlet.LinkedDataFragmentServlet; /** @@ -36,7 +31,7 @@ public class JettyServer { private static void printHelp(Options options) { HelpFormatter formatter = new HelpFormatter(); - formatter.printHelp(JettyServer.class.getName() + " [config-example.json] []", + formatter.printHelp("java -jar target/ldf-server.jar [config-example.json] []", "Starts a standalone LDF Triple Pattern server. Options:", options, ""); } @@ -52,13 +47,13 @@ public static void main(String[] args) throws Exception { CommandLineParser parser = new DefaultParser(); CommandLine commandLine = parser.parse(options, args); - + String config = null; if (!commandLine.getArgList().isEmpty()) { config = commandLine.getArgs()[0]; } - if (config == null || commandLine.hasOption('h')) { + if (commandLine.hasOption('h')) { printHelp(options); System.exit(-1); } diff --git a/src/main/resources/views/base.ftl.html b/src/main/resources/views/base.ftl.html index 78ef1a5..c7bd137 100644 --- a/src/main/resources/views/base.ftl.html +++ b/src/main/resources/views/base.ftl.html @@ -4,7 +4,8 @@ - ${ title!header!"Linked Data Fragments Server" } + ${ title!header!"Linked Data Fragments Server" } + @@ -22,7 +23,7 @@

${header!"Linked Data Fragments Server"}

Powered by a Linked Data Fragments Server - ©2013–${date?string.yyyy} Multimedia Lab – iMinds – Ghent University + ©2013–${date?string.yyyy} Ghent University - imec

diff --git a/src/main/resources/views/fragment.ftl.html b/src/main/resources/views/fragment.ftl.html index 55fb4b2..d7b2327 100644 --- a/src/main/resources/views/fragment.ftl.html +++ b/src/main/resources/views/fragment.ftl.html @@ -52,14 +52,38 @@

Matches in ${datasource.getTitle()} for ${ (query.getPat <#assign object = triple.getObject().asNode().toString()>
  • - <#if (subject?last_index_of("/") > -1)>${ subject?keep_after_last("/") }<#else>${ subject } + + <#if (subject?last_index_of("#") > -1) > + ${ subject?keep_after_last("#") } + <#elseif (subject?last_index_of("/") > -1)> + ${ subject?keep_after_last("/") } + <#else> + ${ subject } + + - ${predicate?keep_after_last("/")} + + <#if (predicate?last_index_of("#") > -1) > + ${ predicate?keep_after_last("#") } + <#elseif (predicate?last_index_of("/") > -1)> + ${ predicate?keep_after_last("/") } + <#else> + ${ predicate } + + <#if !triple.getObject().isLiteral()> - <#if (object?last_index_of("/") > -1)>${ object?keep_after_last("/") }<#else>${ object } + + <#if (object?last_index_of("#") > -1) > + ${ object?keep_after_last("#") } + <#elseif (object?last_index_of("/") > -1)> + ${ object?keep_after_last("/") } + <#else> + ${ object } + + . <#else> ${object}.