Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to virt_jena3 and jena 3.10.0 #38

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2940343
patching 1.3 release to add virtuoso-impl to core build
tburdett Jul 31, 2015
b2d1ee5
fixed bug in rewriter, added virtusoso logo, updated virtuoso jena dr…
simonjupp Feb 24, 2016
06e000b
Merge branch 'master' into 1.4-release
simonjupp Feb 24, 2016
ec345bc
initial commit update master
LLTommy Jan 12, 2017
b883eb2
Reverte the namedGraph change because we are not happy with that impl…
LLTommy Jan 16, 2017
8b26877
Cleaning up History javascript
LLTommy Jan 17, 2017
04e7a36
Further clean up
LLTommy Jan 17, 2017
c49e749
Getting rid of remaining 'namedGraph' pieces
LLTommy Jan 23, 2017
e72edc6
Adding new default foundation css, making query history optional
LLTommy Jan 23, 2017
cbf9d3f
updated pom to use new ebi nexus repo
simonjupp Jul 22, 2017
4e57f24
merged master
simonjupp Jun 5, 2018
25b7000
Merge branch '1.4-release' into master
simonjupp Jun 5, 2018
bd7b884
Merge pull request #34 from LLTommy/master
simonjupp Jun 5, 2018
446b2be
merged poms
simonjupp Jun 5, 2018
5459139
merge new javascript and stylesheets, fix for category label
simonjupp Jun 5, 2018
02c1cee
setting lodestar version
simonjupp Jun 5, 2018
e6f4fe5
fixed history putting in duplciate prefixes and ASK queries working a…
simonjupp Jun 12, 2018
c44d408
Merge branch '1.3-release' of github.com:EBISPOT/lodestar
Nov 28, 2018
0f22d78
Merge branch '1.4-release' of github.com:EBISPOT/lodestar
Nov 28, 2018
4cd3d1d
Issue #23 - Import Jena version from parent pom properties
Mar 25, 2019
bd3dcd5
Issue #23 - load virt-jdbc4 and virt-jena through properties
Mar 25, 2019
f3640e2
Issue #23 - Update to virt-jena3.jar and Apache Jena 3.10.0
Mar 25, 2019
0861921
Issue #23 - Bump version and address security vulnerabilities
Mar 25, 2019
0f1ca74
Update lodestar to not use log4j but move to logback
Dec 14, 2021
c845365
Merge branch '1.4-release' of github.com:EBISPOT/lodestar into develop
Dec 14, 2021
fd27f3d
Update docker build to respect logback as well.
Dec 14, 2021
9017380
Merge branch 'develop' of github.com:HHS/lodestar into feature/jena3
Dec 14, 2021
7a02e90
Move back to log4j
Dec 15, 2021
d0304c8
Update Apache Jena as far as we can and get better at checking for CVEs.
Dec 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
target/
out
*~
.vscode/
.settings/
.project
.classpath
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ RUN mkdir $BUILD_DIR && \
WORKDIR $BUILD_DIR/lodestar/

ADD ./config-docker/lode.properties web-ui/src/main/resources/lode.properties
ADD ./config-docker/log4j.xml web-ui/src/main/resoures/log4j.xml

RUN mvn clean package && \
cp web-ui/target/lodestar.war $CATALINA_HOME/webapps/ && \
Expand Down
42 changes: 21 additions & 21 deletions lode-core-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>ebi-lode</artifactId>
<groupId>ebi-lode</groupId>
<version>1.4.1</version>
<version>1.4.1001-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>lode-core-api</artifactId>
Expand All @@ -26,10 +26,17 @@
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>apache-jena-libs</artifactId>
<version>2.12.0</version>
<version>${jena.version}</version>
<type>pom</type>
</dependency>

<!-- override version of commons-compress in Jena -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.21</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
Expand All @@ -39,65 +46,58 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20090211</version>
<version>20211205</version>
</dependency>

<!-- Override Jena dependencies on versions of httpclient and jackson with CVEs -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
<version>4.5.13</version>
</dependency>

<dependency>
<groupId>com.github.jsonld-java</groupId>
<artifactId>jsonld-java</artifactId>
<version>0.8.3</version>
<version>0.13.4</version>
</dependency>

<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
<version>0.15.0</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.8.4</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.4</version>
</dependency>

<!--
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>

<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.13</version>
</dependency>
-->


<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
<version>1.2</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.1</version>
</dependency>

<!-- jackson json mapping library, describes mappings from java to json for model objects -->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.5.3</version>
<version>3.12.0</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* Functional Genomics Group EMBL-EBI
*/
public class LodeException extends Exception {
private static final long serialVersionUID = 1L;

public LodeException() {
super();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
package uk.ac.ebi.fgpt.lode.impl;

import com.hp.hpl.jena.graph.Graph;
import com.hp.hpl.jena.graph.Node;
import com.hp.hpl.jena.graph.Triple;
import com.hp.hpl.jena.query.*;
import com.hp.hpl.jena.rdf.model.*;
import com.hp.hpl.jena.rdf.model.impl.ResourceImpl;
import com.hp.hpl.jena.sparql.syntax.ElementTriplesBlock;
import com.hp.hpl.jena.sparql.syntax.ElementUnion;
import java.net.URI;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

import org.apache.jena.graph.Graph;
import org.apache.jena.graph.NodeFactory;
import org.apache.jena.graph.Triple;
import org.apache.jena.query.Query;
import org.apache.jena.query.QueryExecution;
import org.apache.jena.query.QuerySolution;
import org.apache.jena.query.QuerySolutionMap;
import org.apache.jena.query.ResultSet;
import org.apache.jena.rdf.model.Literal;
import org.apache.jena.rdf.model.RDFNode;
import org.apache.jena.rdf.model.Resource;
import org.apache.jena.rdf.model.impl.ResourceImpl;
import org.apache.jena.sparql.syntax.ElementTriplesBlock;
import org.apache.jena.sparql.syntax.ElementUnion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;

import uk.ac.ebi.fgpt.lode.exception.LodeException;
import uk.ac.ebi.fgpt.lode.service.JenaQueryExecutionService;
import uk.ac.ebi.fgpt.lode.model.LabeledResource;
import uk.ac.ebi.fgpt.lode.model.RelatedResourceDescription;
import uk.ac.ebi.fgpt.lode.model.ShortResourceDescription;
import uk.ac.ebi.fgpt.lode.service.ExploreService;
import uk.ac.ebi.fgpt.lode.service.JenaQueryExecutionService;
import uk.ac.ebi.fgpt.lode.utils.SparqlQueryReader;

import java.net.URI;
import java.util.*;

/**
* @author Simon Jupp
* @date 03/05/2013
Expand Down Expand Up @@ -105,11 +117,13 @@ public void setQueryReader(SparqlQueryReader queryReader) {
this.queryReader = queryReader;
}

@Override
public Collection<RelatedResourceDescription> getRelatedResourceByProperty(URI resourceUri, Set<URI> propertyUris, Set<URI> excludeTypes, boolean ignoreBnodes) throws LodeException {
String query = getQueryReader().getSparqlQuery("PREFIX") + "\n\n" + getQueryReader().getSparqlQuery("RELATEDTO.PROPERTIES.QUERY");
return getRelatedResourceByProperty(resourceUri, query, propertyUris, excludeTypes, ignoreBnodes, false);
}

@Override
public Collection<RelatedResourceDescription> getRelatedToObjects(URI resourceUri, Set<URI> excludePropertyUris, Set<URI> excludeTypes, boolean ignoreBnodes) throws LodeException {

Set<URI> allRelatedProps = new HashSet<URI>();
Expand All @@ -123,6 +137,7 @@ public Collection<RelatedResourceDescription> getRelatedToObjects(URI resourceUr

}

@Override
public Collection<RelatedResourceDescription> getRelatedFromSubjects(URI resourceUri, Set<URI> excludePropertyUris, Set<URI> excludeTypes, boolean ignoreBnodes) throws LodeException {

Set<URI> allRelatedProps = new HashSet<URI>();
Expand All @@ -135,6 +150,7 @@ public Collection<RelatedResourceDescription> getRelatedFromSubjects(URI resourc
return getRelatedResourceByProperty(resourceUri, query, allRelatedProps, excludeTypes, ignoreBnodes, false);
}

@Override
public Collection<RelatedResourceDescription> getTypes(URI resourceUri, Set<URI> excludeTypes, boolean ignoreBnodes) throws LodeException {

String query = getQueryReader().getSparqlQuery("PREFIX") + "\n\n" + getQueryReader().getSparqlQuery("TYPES.QUERY");
Expand All @@ -150,7 +166,7 @@ public Collection<RelatedResourceDescription> getTypes(URI resourceUri, Set<URI>
try {
ResultSet results = endpoint.execSelect();
while (results.hasNext()) {
QuerySolution solution = (QuerySolution) results.next();
QuerySolution solution = results.next();
Resource res = solution.getResource("resource");
if (res.isAnon()) {
continue;
Expand Down Expand Up @@ -178,6 +194,7 @@ public Collection<RelatedResourceDescription> getTypes(URI resourceUri, Set<URI>
return Collections.singleton(resources);
}

@Override
public Collection<RelatedResourceDescription> getAllTypes(URI resourceUri, Set<URI> excludeTypes, boolean ignoreBnodes) throws LodeException {

String query = getQueryReader().getSparqlQuery("PREFIX") + "\n\n" + getQueryReader().getSparqlQuery("ALLTYPES.QUERY");
Expand All @@ -193,7 +210,7 @@ public Collection<RelatedResourceDescription> getAllTypes(URI resourceUri, Set<U
try {
ResultSet results = endpoint.execSelect();
while (results.hasNext()) {
QuerySolution solution = (QuerySolution) results.next();
QuerySolution solution = results.next();
Resource res = solution.getResource("resource");
if (res.isAnon()) {
continue;
Expand Down Expand Up @@ -221,6 +238,7 @@ public Collection<RelatedResourceDescription> getAllTypes(URI resourceUri, Set<U
return Collections.singleton(resources);
}

@Override
public ShortResourceDescription getShortResourceDescription(URI resourceUri, Set<URI> labelUris, Set<URI> descriptionUris) throws LodeException {
Graph g = getQueryExecutionService().getDefaultGraph();
ShortResourceDescription description1 = getShortResourceDescription(g, resourceUri, labelUris, descriptionUris);
Expand Down Expand Up @@ -251,13 +269,19 @@ private ShortResourceDescription getShortResourceDescription(Graph g, URI resour
ElementUnion union = new ElementUnion();
for (URI l : labelUris) {
ElementTriplesBlock labelPattern = new ElementTriplesBlock();
labelPattern.addTriple(new Triple(resourceNode.asNode(), new ResourceImpl(l.toString()).asNode(), Node.createVariable("label")));
labelPattern.addTriple(new Triple(
resourceNode.asNode(),
new ResourceImpl(l.toString()).asNode(),
NodeFactory.createVariable("label")));
union.addElement(labelPattern);
}

for (URI d : descriptionUris) {
ElementTriplesBlock descriptionPattern = new ElementTriplesBlock();
descriptionPattern.addTriple(new Triple(resourceNode.asNode(), new ResourceImpl(d.toString()).asNode(), Node.createVariable("description")));
descriptionPattern.addTriple(new Triple(
resourceNode.asNode(),
new ResourceImpl(d.toString()).asNode(),
NodeFactory.createVariable("description")));
union.addElement(descriptionPattern);
}

Expand All @@ -270,7 +294,7 @@ private ShortResourceDescription getShortResourceDescription(Graph g, URI resour
ResultSet results = endpoint.execSelect();

while (results.hasNext()) {
QuerySolution solution = (QuerySolution) results.next();
QuerySolution solution = results.next();

Literal labelNode = solution.getLiteral("label");
if (label == null && labelNode !=null) {
Expand All @@ -295,6 +319,7 @@ private ShortResourceDescription getShortResourceDescription(Graph g, URI resour
return new ShortResourceDescription(resourceUri.toString(), label, description, dataset);
}

@Override
public Collection<String> getResourceDepiction(URI subject, URI depictRelation) {

String query = getQueryReader().getSparqlQuery("PREFIX") + "\n\n" + getQueryReader().getSparqlQuery("DEPICT.QUERY");
Expand All @@ -312,7 +337,7 @@ public Collection<String> getResourceDepiction(URI subject, URI depictRelation)
ResultSet results = endpoint.execSelect();

while (results.hasNext()) {
QuerySolution solution = (QuerySolution) results.next();
QuerySolution solution = results.next();

Resource propertyNode = solution.getResource("img");
if (propertyNode != null) {
Expand Down Expand Up @@ -350,7 +375,7 @@ private Set<String> getRelatedProperties (URI resource, String binding) {
ResultSet results = endpoint.execSelect();

while (results.hasNext()) {
QuerySolution solution = (QuerySolution) results.next();
QuerySolution solution = results.next();

Resource propertyNode = solution.getResource("property");
if (propertyNode != null) {
Expand Down Expand Up @@ -387,7 +412,7 @@ private Collection<RelatedResourceDescription> getRelatedResourceByProperty(URI
ResultSet results = endpoint.execSelect();

while (results.hasNext()) {
QuerySolution solution = (QuerySolution) results.next();
QuerySolution solution = results.next();
String resource = null;
String resourceLabel = null;
String resourceType = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
package uk.ac.ebi.fgpt.lode.impl;

import com.hp.hpl.jena.graph.Graph;
import com.hp.hpl.jena.query.*;
import com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP;
import org.apache.jena.graph.Graph;
import org.apache.jena.query.ParameterizedSparqlString;
import org.apache.jena.query.Query;
import org.apache.jena.query.QueryExecution;
import org.apache.jena.query.QuerySolutionMap;
import org.apache.jena.sparql.engine.http.QueryEngineHTTP;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;

import uk.ac.ebi.fgpt.lode.exception.LodeException;
import uk.ac.ebi.fgpt.lode.service.JenaQueryExecutionService;

Expand Down Expand Up @@ -62,11 +66,13 @@ public static boolean isNullOrEmpty(Object o) {
return "".equals(o);
}

@Override
public Graph getDefaultGraph() {
return null;

}

@Override
public Graph getNamedGraph(String graphName) {
return null;
}
Expand Down
Loading