Skip to content

Commit d3b8ef5

Browse files
authored
Depndency on com.atomgraph.server instead of com.atomgraph.processor (#177)
* `com.atomgraph.linkeddatahub` depends on the new `com.atomgraph.server` instead of `com.atomgraph.processor` Caching ontologies by default Registered Server's `NotAcceptableExceptionMapper` * Copied vocabulary files from Processor -- they were missing since LDH now only depends on Server, which does not include them * Bumped Server to 4.1.0-SNAPSHOT * Bump to Server 4.1.2
1 parent 3999038 commit d3b8ef5

27 files changed

Lines changed: 2146 additions & 68 deletions

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@
128128
<!-- TO-DO: replace with AtomGraph Core -->
129129
<dependency>
130130
<groupId>${project.groupId}</groupId>
131-
<artifactId>processor</artifactId>
132-
<version>4.0.1</version>
131+
<artifactId>server</artifactId>
132+
<version>4.1.2</version>
133133
</dependency>
134134
<dependency>
135135
<groupId>${project.groupId}</groupId>

src/main/java/com/atomgraph/linkeddatahub/Application.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,9 @@
124124
import com.atomgraph.linkeddatahub.writer.XSLTWriterBase;
125125
import com.atomgraph.linkeddatahub.writer.factory.ModeFactory;
126126
import com.atomgraph.linkeddatahub.writer.function.DecodeURI;
127-
import com.atomgraph.processor.vocabulary.AP;
128-
import com.atomgraph.processor.vocabulary.LDT;
127+
import com.atomgraph.server.mapper.NotAcceptableExceptionMapper;
128+
import com.atomgraph.server.vocabulary.LDT;
129129
import com.atomgraph.server.mapper.OntologyExceptionMapper;
130-
import com.atomgraph.server.mapper.ParameterExceptionMapper;
131130
import com.atomgraph.server.mapper.jena.DatatypeFormatExceptionMapper;
132131
import com.atomgraph.server.mapper.jena.QueryParseExceptionMapper;
133132
import com.atomgraph.server.mapper.jena.RiotExceptionMapper;
@@ -304,7 +303,6 @@ public Application(@Context ServletConfig servletConfig) throws URISyntaxExcepti
304303
servletConfig.getServletContext().getInitParameter(A.maxGetRequestSize.getURI()) != null ? Integer.valueOf(servletConfig.getServletContext().getInitParameter(A.maxGetRequestSize.getURI())) : null,
305304
servletConfig.getServletContext().getInitParameter(A.cacheModelLoads.getURI()) != null ? Boolean.parseBoolean(servletConfig.getServletContext().getInitParameter(A.cacheModelLoads.getURI())) : true,
306305
servletConfig.getServletContext().getInitParameter(A.preemptiveAuth.getURI()) != null ? Boolean.parseBoolean(servletConfig.getServletContext().getInitParameter(A.preemptiveAuth.getURI())) : false,
307-
servletConfig.getServletContext().getInitParameter(AP.cacheSitemap.getURI()) != null ? Boolean.parseBoolean(servletConfig.getServletContext().getInitParameter(AP.cacheSitemap.getURI())) : true,
308306
new PrefixMapper(servletConfig.getServletContext().getInitParameter(AC.prefixMapping.getURI()) != null ? servletConfig.getServletContext().getInitParameter(AC.prefixMapping.getURI()) : null),
309307
com.atomgraph.client.Application.getSource(servletConfig.getServletContext(), servletConfig.getServletContext().getInitParameter(AC.stylesheet.getURI()) != null ? servletConfig.getServletContext().getInitParameter(AC.stylesheet.getURI()) : null),
310308
servletConfig.getServletContext().getInitParameter(AC.cacheStylesheet.getURI()) != null ? Boolean.parseBoolean(servletConfig.getServletContext().getInitParameter(AC.cacheStylesheet.getURI())) : false,
@@ -363,7 +361,6 @@ public Application(@Context ServletConfig servletConfig) throws URISyntaxExcepti
363361
* @param maxGetRequestSize maximum <code>GET</code> request size
364362
* @param cacheModelLoads true if model loads should be cached
365363
* @param preemptiveAuth true if HTTP Basic auth credentials should be sent preemptively
366-
* @param cacheSitemap true if app's ontology should be cached
367364
* @param locationMapper Jena's <code>LocationMapper</code> instance
368365
* @param stylesheet stylesheet URI
369366
* @param cacheStylesheet true if stylesheet should be cached
@@ -404,7 +401,7 @@ public Application(@Context ServletConfig servletConfig) throws URISyntaxExcepti
404401
* @param googleClientSecret client secret for Google's OAuth
405402
*/
406403
public Application(final ServletConfig servletConfig, final MediaTypes mediaTypes,
407-
final Integer maxGetRequestSize, final boolean cacheModelLoads, final boolean preemptiveAuth, final boolean cacheSitemap,
404+
final Integer maxGetRequestSize, final boolean cacheModelLoads, final boolean preemptiveAuth,
408405
final LocationMapper locationMapper, final Source stylesheet, final boolean cacheStylesheet, final boolean resolvingUncached,
409406
final String clientKeyStoreURIString, final String clientKeyStorePassword,
410407
final String secretaryCertAlias,
@@ -671,7 +668,7 @@ public Application(final ServletConfig servletConfig, final MediaTypes mediaType
671668
ontModelSpec = OntModelSpec.OWL_MEM_RDFS_INF;
672669
ontModelSpec.setImportModelGetter(dataManager);
673670
OntDocumentManager.getInstance().setFileManager((FileManager)dataManager);
674-
OntDocumentManager.getInstance().setCacheModels(cacheSitemap); // need to re-set after changing FileManager
671+
OntDocumentManager.getInstance().setCacheModels(true); // need to re-set after changing FileManager
675672
ontModelSpec.setDocumentManager(OntDocumentManager.getInstance());
676673

677674
if (mailUser != null && mailPassword != null) // enable SMTP authentication
@@ -969,10 +966,10 @@ protected void registerExceptionMappers()
969966
register(SPINConstraintViolationExceptionMapper.class);
970967
register(SHACLConstraintViolationExceptionMapper.class);
971968
register(DatatypeFormatExceptionMapper.class);
972-
register(ParameterExceptionMapper.class);
973969
register(QueryExecExceptionMapper.class);
974970
register(RiotExceptionMapper.class);
975971
register(RiotParseExceptionMapper.class); // move to Processor?
972+
register(NotAcceptableExceptionMapper.class);
976973
register(ClientErrorExceptionMapper.class);
977974
register(HttpHostConnectExceptionMapper.class);
978975
register(BadGatewayExceptionMapper.class);

src/main/java/com/atomgraph/linkeddatahub/apps/model/Application.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,21 @@
2626
*
2727
* @author Martynas Jusevičius {@literal <martynas@atomgraph.com>}
2828
*/
29-
public interface Application extends Resource, com.atomgraph.processor.model.Application
29+
public interface Application extends Resource, com.atomgraph.core.model.Application
3030
{
3131

3232
/**
3333
* The relative path of the content-addressed file container.
3434
*/
3535
public static final String UPLOADS_PATH = "uploads";
3636

37+
/**
38+
* Returns the application's namespace ontology.
39+
*
40+
* @return ontology resource
41+
*/
42+
Resource getOntology();
43+
3744
/**
3845
* Returns the agent who created this application.
3946
*

src/main/java/com/atomgraph/linkeddatahub/apps/model/impl/ApplicationImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import com.atomgraph.linkeddatahub.model.Service;
2222
import com.atomgraph.linkeddatahub.vocabulary.FOAF;
2323
import com.atomgraph.linkeddatahub.vocabulary.LAPP;
24-
import com.atomgraph.processor.vocabulary.LDT;
24+
import com.atomgraph.server.vocabulary.LDT;
2525
import org.apache.jena.enhanced.EnhGraph;
2626
import org.apache.jena.graph.Node;
2727
import org.apache.jena.rdf.model.Resource;

src/main/java/com/atomgraph/linkeddatahub/apps/model/impl/DatasetImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import com.atomgraph.linkeddatahub.apps.model.Dataset;
2020
import com.atomgraph.linkeddatahub.model.Service;
2121
import com.atomgraph.linkeddatahub.vocabulary.LAPP;
22-
import com.atomgraph.processor.vocabulary.LDT;
22+
import com.atomgraph.server.vocabulary.LDT;
2323
import java.net.URI;
2424
import jakarta.ws.rs.core.UriBuilder;
2525
import org.apache.jena.enhanced.EnhGraph;

src/main/java/com/atomgraph/linkeddatahub/model/impl/UserAccountImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import org.apache.jena.graph.Node;
2020
import com.atomgraph.linkeddatahub.model.UserAccount;
21-
import com.atomgraph.processor.vocabulary.SIOC;
21+
import com.atomgraph.linkeddatahub.vocabulary.SIOC;
2222
import org.apache.jena.enhanced.EnhGraph;
2323
import org.apache.jena.enhanced.EnhNode;
2424
import org.apache.jena.enhanced.Implementation;

src/main/java/com/atomgraph/linkeddatahub/resource/Generate.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
import com.atomgraph.linkeddatahub.server.util.Skolemizer;
2828
import com.atomgraph.linkeddatahub.vocabulary.LDH;
2929
import com.atomgraph.linkeddatahub.vocabulary.VoID;
30-
import com.atomgraph.processor.vocabulary.DH;
31-
import com.atomgraph.processor.vocabulary.SIOC;
30+
import com.atomgraph.linkeddatahub.vocabulary.DH;
31+
import com.atomgraph.linkeddatahub.vocabulary.SIOC;
3232
import com.atomgraph.spinrdf.vocabulary.SP;
3333
import com.atomgraph.spinrdf.vocabulary.SPIN;
3434
import java.net.URI;

src/main/java/com/atomgraph/linkeddatahub/resource/admin/SignUp.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
import com.atomgraph.linkeddatahub.vocabulary.Cert;
3636
import com.atomgraph.linkeddatahub.vocabulary.FOAF;
3737
import com.atomgraph.linkeddatahub.vocabulary.LACL;
38-
import com.atomgraph.processor.vocabulary.DH;
39-
import com.atomgraph.processor.vocabulary.SIOC;
38+
import com.atomgraph.linkeddatahub.vocabulary.DH;
39+
import com.atomgraph.linkeddatahub.vocabulary.SIOC;
4040
import com.atomgraph.server.exception.SPINConstraintViolationException;
4141
import com.atomgraph.server.exception.SkolemizationException;
4242
import com.atomgraph.spinrdf.constraints.ConstraintViolation;

src/main/java/com/atomgraph/linkeddatahub/resource/admin/oauth2/Login.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
import com.atomgraph.linkeddatahub.vocabulary.FOAF;
3737
import com.atomgraph.linkeddatahub.vocabulary.Google;
3838
import com.atomgraph.linkeddatahub.vocabulary.LACL;
39-
import com.atomgraph.processor.vocabulary.DH;
40-
import com.atomgraph.processor.vocabulary.SIOC;
39+
import com.atomgraph.linkeddatahub.vocabulary.DH;
40+
import com.atomgraph.linkeddatahub.vocabulary.SIOC;
4141
import com.auth0.jwt.JWT;
4242
import com.auth0.jwt.interfaces.DecodedJWT;
4343
import java.io.IOException;

src/main/java/com/atomgraph/linkeddatahub/server/filter/request/AuthorizationFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import com.atomgraph.linkeddatahub.server.security.AuthorizationContext;
2727
import com.atomgraph.linkeddatahub.vocabulary.ACL;
2828
import com.atomgraph.linkeddatahub.vocabulary.LACL;
29-
import com.atomgraph.processor.vocabulary.LDT;
29+
import com.atomgraph.server.vocabulary.LDT;
3030
import com.atomgraph.spinrdf.vocabulary.SPIN;
3131
import java.io.IOException;
3232
import java.util.Collections;

0 commit comments

Comments
 (0)