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

104 update mongodb #821

Closed
wants to merge 201 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
201 commits
Select commit Hold shift + click to select a range
bd25235
enabled all rest controllers
giraygi Dec 27, 2023
8811ab9
added imports
giraygi Dec 27, 2023
865418e
added skos tree generation controllers
giraygi Jan 3, 2024
5db94ef
enabled hastopconcept option by making conceptSchema a term
giraygi Jan 3, 2024
fb211c8
implemented graph definition call for visualization
giraygi Feb 15, 2024
d2df44f
removed yet to be introduced caching for now and moved graph method b…
giraygi Feb 15, 2024
c7f8de2
renamed call signatures with respect to EBI conventions in #625
giraygi Feb 16, 2024
5080ff8
handled null relations for some ontologies in EBISPOT#625 and TIBHann…
giraygi Feb 19, 2024
c249078
changed skos variable name in the config file
giraygi Feb 20, 2024
0f88d25
added skos tree configuration parameters for frontend in EBISPOT#625 …
giraygi Feb 20, 2024
4fd8952
added ontology filter methods based on ontology metadata
giraygi Jan 9, 2024
bc6edaf
enabled collection and subject variables in config
giraygi Jan 10, 2024
02bc447
added composite classification variable for filtering
giraygi Jan 18, 2024
38265db
enabled filtering from composite type
giraygi Feb 2, 2024
34b8be8
filtering for filterby, search, select, suggest methods
giraygi Feb 9, 2024
367ff54
added classifications as a composite variable to the config
giraygi Feb 13, 2024
c551e67
implemented call for listing available schema keys
giraygi Feb 13, 2024
c84cca6
implemented schema values method
giraygi Feb 13, 2024
49af55c
paginated the schemakeys and schemavalues methods
giraygi Feb 13, 2024
6fc77ea
enabled all rest controllers
giraygi Dec 27, 2023
c3b37fa
added imports
giraygi Dec 27, 2023
0151b49
added config file for testing in #3
giraygi Feb 21, 2024
111b42a
moved sample labeled config to configs directory in #3
giraygi Feb 21, 2024
285857b
renamed test config file and corrected variable name inside it for #3
giraygi Feb 22, 2024
e87dcd3
refactored and added repo_url config variable
giraygi Feb 22, 2024
071cdfc
added composite license variable in config for #3
giraygi Feb 29, 2024
e56e916
refactored and handled null cases
giraygi Mar 4, 2024
757cd4e
implemented statistics method enhanced with filtering for #3
giraygi Mar 7, 2024
35a0409
refactored statistics methods
giraygi Mar 8, 2024
09b268b
implemented call that retrieves all statistics with respect to schema
giraygi Mar 11, 2024
02cf1ff
handled null case and added swagger documentation
giraygi Mar 11, 2024
a807363
implemented filtering for v2 ontology controller
giraygi Mar 27, 2024
5baa4f3
changed the underlying ontology repository class to v2 for ontology s…
giraygi Mar 28, 2024
49b63a4
implemented skos v2 api for EBISPOT#625 and TIBHannover#1
giraygi Apr 3, 2024
e4205e7
refactored with enum for skos relations
giraygi Apr 10, 2024
60eb886
refactored the whole skos functionaliuty of v1 and v2 for EBISPOT#625…
giraygi Apr 11, 2024
6afd55f
reverted the get first method of olssolrclient
giraygi Apr 11, 2024
c34ac3d
Merge pull request #6 from TIBHannover/1-skos-api-support
giraygi Apr 11, 2024
1b05e38
added composite classification based filtering as well as string and …
giraygi Apr 15, 2024
ebbeeca
added filter option for licenses in #3
giraygi Apr 16, 2024
da48284
Merge branch 'EBISPOT:dev' into dev
giraygi Apr 16, 2024
8e6be2d
added composite and license type filtering options to v1 api for #3
giraygi Apr 16, 2024
976c2d1
documented the filteroption parameter in all endpoints. Removed unnec…
giraygi Apr 17, 2024
edef65a
Merge branch 'dev' into 3-ontology-filtering
giraygi Apr 17, 2024
5590f5f
Merge pull request #4 from TIBHannover/3-ontology-filtering
giraygi Apr 17, 2024
af1d757
updated some docker files and scripts for #8
giraygi Apr 22, 2024
78cb7a0
updated pom file and neo4j command script for #8
giraygi Apr 25, 2024
8528555
initialized a neo4j import module for #8
giraygi May 24, 2024
6f4431d
added a split function to extract json in csv and a routine for gener…
giraygi May 27, 2024
a6dde72
added ontology remove, ingest and authentication menu options to CSV …
giraygi May 28, 2024
8a78b12
added commons cli dependency
giraygi May 28, 2024
fef2e40
changed condition for input files in #8
giraygi May 28, 2024
1bf0bcd
Merge pull request #12 from TIBHannover/8-neo4j-5
giraygi May 28, 2024
f0bbf59
Added null check while parsing anootators
deepananbu May 29, 2024
5d32434
Merge pull request #15 from TIBHannover/11-several-ontologies-of-tib-…
giraygi Jun 3, 2024
594c388
handled exceptions and made transaction safe mode optional
giraygi Jun 3, 2024
80ddb9d
narrowed down relationship creation query for #14
giraygi Jun 7, 2024
9124d45
added logic to convert ontologies to RDF/XML format before parsing
deepananbu Jun 12, 2024
2a186af
handled several buggy cases in query creation for #14
giraygi Jun 14, 2024
061f546
added logic to convert ontologies to rdf format. Added "convertToRDF" as
deepananbu Jun 18, 2024
20bcaf9
owl & ttl files required for the conversion
deepananbu Jun 18, 2024
721adb1
added filter to the relation creation query for #14
giraygi Jun 18, 2024
882cb46
Merge remote-tracking branch 'origin/dev' into
deepananbu Jun 24, 2024
72798ac
reimplemented csv2neo with commons-csv and opencsv parsers for #14
giraygi Jul 18, 2024
26f0177
Merge pull request #18 from TIBHannover/11-several-ontologies-of-tib-…
giraygi Jul 24, 2024
c84bc3d
trimmed leading and trailing blanks in parser and corrected missing b…
giraygi Jul 24, 2024
e56c9ba
made indexes conditional for #14
giraygi Jul 24, 2024
d4aa43b
updated dataload documentation for #14
giraygi Jul 24, 2024
d2062f4
updated numbering on dataload documentation for #14
giraygi Jul 24, 2024
00b2fa6
refactored query execution for #14
giraygi Jul 24, 2024
6a1cb6a
handled specific json syntax exception for #14
giraygi Jul 25, 2024
ade7754
handled specific uncoercible value exception for #14
giraygi Jul 25, 2024
6cb4995
Merge pull request #16 from TIBHannover/14-improve-ingestion-performance
giraygi Jul 25, 2024
a1f9556
Merge branch 'dev' into 17-facet-data-is-missing-from-the-search-call…
giraygi Jul 25, 2024
21b4ee7
Merge pull request #20 from TIBHannover/17-facet-data-is-missing-from…
giraygi Jul 25, 2024
8202820
added missing import
giraygi Jul 25, 2024
3628f88
implemented alternative query generation approach with external query…
giraygi Aug 6, 2024
efe7dc6
refactored for #22
giraygi Aug 6, 2024
5b53025
Merge pull request #23 from TIBHannover/22-special-character-problem-…
giraygi Aug 6, 2024
653162b
batch based solution is implemented for query based data creation in #25
giraygi Aug 7, 2024
8903a7a
multithreading is implemented for query based data creation in #25
giraygi Aug 8, 2024
d6cc84d
Merge pull request #26 from TIBHannover/25-huge-ontologies-are-ingest…
giraygi Aug 8, 2024
03bb06b
resolved conflicts for #27
giraygi Aug 9, 2024
d8f108b
implemented routine for array type query along with string type queri…
giraygi Aug 12, 2024
9f104b9
Merge pull request #34 from TIBHannover/30-test
giraygi Aug 13, 2024
3f5c4ea
Merge pull request #35 from TIBHannover/sync2
giraygi Aug 13, 2024
435cb7f
added count queries for #29
giraygi Aug 12, 2024
4df6e36
revised command line modes and added metadata summary option to be us…
giraygi Aug 14, 2024
0fb5919
implemented configurable multiple attempts for each transaction in #29
giraygi Aug 15, 2024
fb6e2f0
Merge pull request #36 from TIBHannover/29-fault-tolerance
giraygi Aug 15, 2024
76b9999
converted the rest statistics functionality from ols3 to ols4 for #10
giraygi Aug 22, 2024
30959cb
removed the experimentall call that lists all rest calls for #10
giraygi Aug 22, 2024
7145594
removed unnecessary import
giraygi Aug 22, 2024
f3a3a37
Merge pull request #40 from TIBHannover/10-rest-call-statistics-fix
giraygi Aug 22, 2024
0965245
formatted code as it is in EBI
deepananbu Aug 26, 2024
1b20eee
resolved conflicts
giraygi Aug 26, 2024
cb86463
Merge branch 'EBISPOT-dev' into formattingIssues
giraygi Aug 26, 2024
70a7902
Merge pull request #42 from TIBHannover/formattingIssues
giraygi Aug 26, 2024
d7bfc13
Merge branch 'EBISPOT:dev' into dev
giraygi Sep 1, 2024
3aace52
Merge branch 'EBISPOT:dev' into dev
giraygi Sep 4, 2024
841cb43
set convertToRDF option not to have argument for #46
giraygi Sep 5, 2024
e66ea8a
assigned purl as the iri to ontologies with no iri for #48
giraygi Sep 5, 2024
344fe68
Merge pull request #49 from TIBHannover/48-null-iri-in-rdf2json-output
giraygi Sep 9, 2024
62d25e0
made rdf2json idependent from execution directory and default input o…
giraygi Sep 10, 2024
a2fe9e6
handled the rdf conversion exception when the ontology isn't availabl…
giraygi Sep 11, 2024
a654904
Merge pull request #52 from TIBHannover/46-problems-in-robot-based-co…
giraygi Sep 11, 2024
ade66cf
prevented double ontology assignment for #46
giraygi Sep 11, 2024
b8ff3ce
Merge pull request #53 from TIBHannover/46-problems-in-robot-based-co…
giraygi Sep 11, 2024
ba4931f
used approved url protocol for ontology without a raw file for #46
giraygi Sep 12, 2024
e0d824e
Merge pull request #54 from TIBHannover/46-problems-in-robot-based-co…
giraygi Sep 12, 2024
4b1409c
added an obo to owl conversion routine to rdf2json for #47
giraygi Sep 13, 2024
6f0a27f
ensured structure of rdf ontologies and refactored for #47
giraygi Sep 13, 2024
cd5b8c1
implemented save functionality of original and refactored ontologies …
giraygi Sep 13, 2024
6560381
ensured always the converted rdf to be parsed and refactored the exce…
giraygi Sep 13, 2024
a1953d7
Merge pull request #55 from TIBHannover/47-ontology-parsing-errors-of…
giraygi Sep 13, 2024
12ee415
refactored ontology conversion to detect source ontology type and do …
giraygi Sep 16, 2024
4bef785
implemented automatic conversion to RDF option upon ontology parsing …
giraygi Sep 16, 2024
3c78d8d
stored converted imports in different files and handled exceptions fo…
giraygi Sep 23, 2024
07c5f75
Merge pull request #57 from TIBHannover/56-automatic-conversion-to-rdf
giraygi Sep 23, 2024
7942066
resolved conflicts
giraygi Sep 23, 2024
90d6a33
Merge branch 'EBISPOT-dev' into dev
giraygi Sep 23, 2024
c839786
made correction in displaycsv numbers for #44
giraygi Sep 24, 2024
04b7dcd
provided more accurate data and put latccountdown to the final reacha…
giraygi Sep 25, 2024
a329971
displayed differences between planned and ingested for #44
giraygi Sep 25, 2024
f4f38f4
fixed UnsupportedOperationException for #44
giraygi Sep 25, 2024
402065a
fixed plan and result calculation for #44
giraygi Sep 27, 2024
f750ed2
implemented multiple removal options for #44
giraygi Sep 27, 2024
9dec176
Merge pull request #62 from TIBHannover/44-csv2neo-does-not-finalize-…
giraygi Sep 27, 2024
f4062a8
detected self importing IRIs that cause a loop for #63
giraygi Sep 28, 2024
3594f49
simplified loop detection for #63
giraygi Sep 28, 2024
e3d54c9
ensured importUrls list size in loop detection for #63
giraygi Sep 28, 2024
c6ada35
contains check instead of equality check in loop detection for #63
giraygi Sep 28, 2024
0198c76
ensured RDFXML format in convertToRDF option for #63
giraygi Sep 29, 2024
6f87627
generalized detection of import loops for #63
giraygi Sep 30, 2024
ab23684
avoided null property value for #63
giraygi Sep 30, 2024
e955e55
Merge pull request #64 from TIBHannover/63-more-parsing-errors-in-rdf…
giraygi Oct 1, 2024
4e637f2
debug the cause of relation loop
giraygi Oct 2, 2024
3beb4a7
splitted output files based on ontology for #60
giraygi Oct 8, 2024
0198cdd
closed all PrintWriters by the end of execution for #60
giraygi Oct 8, 2024
2f37563
updated load into solr script based on the json2solr module outputs f…
giraygi Oct 9, 2024
7f6c6d7
Merge pull request #66 from TIBHannover/60-split-json2solr-output-int…
giraygi Oct 11, 2024
fc78422
ensure output csv directory is present
giraygi Oct 11, 2024
995d079
Merge pull request #67 from TIBHannover/60-split-json2solr-output-int…
giraygi Oct 11, 2024
634f4e5
Merge remote-tracking branch 'origin/dev' into 65-annotation-error-re…
deepananbu Oct 14, 2024
a402de4
added condition to remove self reference in relatedFrom property
deepananbu Oct 14, 2024
1ccd7cf
merged with Dev
deepananbu Oct 21, 2024
eb75938
merged import from Dev
deepananbu Oct 21, 2024
41c27d4
added null check for JSONElement in solr response
deepananbu Oct 22, 2024
9ce1709
updated dockerized dataload based on csv2neo for #76
giraygi Oct 23, 2024
9757b6e
Merge pull request #79 from TIBHannover/77-search-filtering-based-on-…
deepananbu Oct 24, 2024
de3434b
added fix for "expanded" in search result. Fixes #78
deepananbu Oct 24, 2024
46e9335
added old neo4j load script as backup and disabled duplicate start of…
giraygi Oct 25, 2024
0ae7a5c
Merge pull request #81 from TIBHannover/78-search-field-expanded-is-m…
giraygi Oct 25, 2024
626396a
added JsonNull check in objectToString. Fixes #83
deepananbu Oct 25, 2024
39297ad
Merge pull request #84 from TIBHannover/83-ontology-list-returns-500-…
deepananbu Oct 25, 2024
3b2a3df
initialized null jsonelements with default jsonobject and generalized…
giraygi Oct 25, 2024
aa811df
Merge pull request #86 from TIBHannover/85-graph-endpont-returns-500
giraygi Oct 25, 2024
275a834
added logic for unconfigured preferredprefixes on #73
giraygi Oct 27, 2024
fa23a4d
corrected logic for #73
giraygi Oct 28, 2024
a099163
corrected logic for #73
giraygi Oct 28, 2024
7e7b70b
Merge pull request #87 from TIBHannover/73-ontology_prefix-is-sometim…
giraygi Oct 28, 2024
25c4137
added convertToRDF parameter to rdf2json in dockerized installation f…
giraygi Oct 28, 2024
362ab3d
removed duplicate neo4j index step for #76
giraygi Oct 29, 2024
139cead
reverted changes in unused create neo4j indexes script for #76
giraygi Oct 29, 2024
5083153
made dockerized csv2neo configurable for #76
giraygi Oct 29, 2024
df44edd
updated uri writing to json.
deepananbu Oct 29, 2024
06d28df
Merge pull request #82 from TIBHannover/76-dockerized-use-of-csv2neo-…
giraygi Oct 30, 2024
e9df063
configured max row size in filter queries for #72
giraygi Nov 4, 2024
5ed85b5
Merge pull request #88 from TIBHannover/72-search-filter-based-on-col…
giraygi Nov 4, 2024
46eff0b
Merge pull request #75 from TIBHannover/65-annotation-error-related-t…
giraygi Nov 5, 2024
154865d
updated neo4j and solr and made their download optional for #59
giraygi Nov 5, 2024
8daf273
placed copy and build commands in order for #59
giraygi Nov 5, 2024
f4463e8
added code to retrieve FullJSTree with viewMode and siblings. Fixes #74
deepananbu Nov 12, 2024
055c2d1
Merge pull request #89 from TIBHannover/59-update-solr-and-neo4j
giraygi Nov 14, 2024
a8bd1ea
ontology filters are converted to default COMPOSITE in v2 statistics …
giraygi Nov 15, 2024
6246cd3
computed last loaded time for subset of ontologies in #91
giraygi Nov 18, 2024
38bc3f8
handled null and empty cases in composite filter for #91
giraygi Nov 18, 2024
2bdb9db
added logic to handle property fullTree. Fixes #74
deepananbu Nov 19, 2024
585aa68
removed unnecessary parameter from allstatsbyschema endpoint for #91
giraygi Nov 19, 2024
2b3086c
Merge pull request #92 from TIBHannover/91-stats-endpoints
giraygi Nov 19, 2024
9afe62a
readded schema parameter on allstatsbyschema endpoint for #91
giraygi Nov 19, 2024
a115771
Merge pull request #94 from TIBHannover/91-stats-endpoints
giraygi Nov 19, 2024
ba1a070
used annotation extractor class for mapping in #96
giraygi Nov 20, 2024
55597ca
Merge pull request #97 from TIBHannover/96-annotations-field-is-null-…
giraygi Nov 20, 2024
a91be29
added relatedfrom and equivalentclasses endpoint for #98
giraygi Nov 21, 2024
d8d7890
updated logic to get label for relationship. Fixes #99
deepananbu Nov 21, 2024
79bca06
Merge pull request #95 from TIBHannover/74-viewmode=all-does-not-work…
giraygi Nov 22, 2024
3fce34b
added a paginated term instances endpoint and made related from and e…
giraygi Nov 22, 2024
b8a0bcd
added json endpoint for v1 term in #98
giraygi Nov 22, 2024
2247f76
added superclasses endpoint for #98
giraygi Nov 23, 2024
3542b96
removed unnecessary parameters from json endpoint for #98
giraygi Nov 25, 2024
5404548
Merge pull request #100 from TIBHannover/99-graph-endpoint-only-retur…
giraygi Nov 25, 2024
cd9a5e4
Merge pull request #101 from TIBHannover/98-equivalent-class-and-rela…
giraygi Nov 25, 2024
6fdcc69
resolved conflicts
giraygi Dec 6, 2024
17ba0c9
Merge branch 'EBISPOT-dev' into sync4 with unresolved contribution fo…
giraygi Dec 6, 2024
3a5067b
merged with EBI latest changes and included fix for fibo
deepananbu Dec 10, 2024
704a3a9
updated null check for fillerNode
deepananbu Dec 10, 2024
2cb66aa
Merge pull request #103 from TIBHannover/resolve-relatedAnnotator-con…
giraygi Jan 3, 2025
c011477
Merge pull request #102 from TIBHannover/sync4
giraygi Jan 3, 2025
480ac13
updated mongo and neo4j versions for #104
giraygi Jan 9, 2025
8f85fe8
updated mongo to latest for #104
giraygi Jan 9, 2025
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
3 changes: 1 addition & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

#FROM maven:3.6.3-adoptopenjdk-14
FROM maven:3.8-jdk-11
FROM maven:3.9.6-eclipse-temurin-17

RUN mkdir /opt/ols && mkdir /opt/ols/backend && mkdir /opt/ols/ols-shared
COPY ./backend /opt/ols/backend
Expand Down
40 changes: 32 additions & 8 deletions backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
</parent>

<properties>
<java.version>11</java.version>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<java.version>17</java.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>

<dependencies>
Expand All @@ -32,11 +32,23 @@
<version>2.8.9</version>
</dependency>

<dependency>
<groupId>org.neo4j.driver</groupId>
<artifactId>neo4j-java-driver</artifactId>
<version>4.4.1</version>
</dependency>
<dependency>
<groupId>org.neo4j.driver</groupId>
<artifactId>neo4j-java-driver</artifactId>
<version>5.19.0</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
<version>2.7.5</version>
</dependency>

<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<version>2.2</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -149,6 +161,18 @@
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.6.4</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.13.0</version>
<scope>compile</scope>
</dependency>

<!-- Logging -->
<!-- <dependency>-->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package uk.ac.ebi.spot.ols.config;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.HandlerInterceptor;

import uk.ac.ebi.spot.ols.reststatistics.service.RestCallHandlerService;

public class RestCallInterceptor implements HandlerInterceptor {
private final RestCallHandlerService restCallHandlerService;

@Autowired
public RestCallInterceptor(RestCallHandlerService restCallHandlerService) {
this.restCallHandlerService = restCallHandlerService;
}

@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
if (!request.getRequestURL().toString().contains("/api")
|| request.getRequestURL().toString().contains("/api/rest/statistics")) {
return true;
}


restCallHandlerService.handle(request);

return true;
}
}
30 changes: 14 additions & 16 deletions backend/src/main/java/uk/ac/ebi/spot/ols/config/WebConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.http.MediaType;
import org.springframework.web.filter.CharacterEncodingFilter;
import org.springframework.web.servlet.config.annotation.*;
import org.springframework.web.util.UrlPathHelper;
import uk.ac.ebi.spot.ols.reststatistics.service.RestCallHandlerService;

/**
* @author Simon Jupp
Expand All @@ -25,6 +21,10 @@ public class WebConfig extends WebMvcConfigurerAdapter {
*
* @param configurer
*/

@Autowired
RestCallHandlerService restCallHandlerService;

@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
// UrlPathHelper urlPathHelper = new UrlPathHelper();
Expand All @@ -36,17 +36,15 @@ public void configurePathMatch(PathMatchConfigurer configurer) {

}

// @Bean
// MaintenanceInterceptor getMaintenanceInterceptor() {
// return new MaintenanceInterceptor();
// }

// @Autowired
// MaintenanceInterceptor interceptor;
// @Override
// public void addInterceptors(InterceptorRegistry registry) {
// registry.addInterceptor(interceptor);
// }
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(getRestCallInterceptor());
}

@Bean
public RestCallInterceptor getRestCallInterceptor() {
return new RestCallInterceptor(restCallHandlerService);
}

@Override
public void addCorsMappings(CorsRegistry registry) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package uk.ac.ebi.spot.ols.controller.api.v1;

public enum TopConceptEnum {
SCHEMA,
TOPCONCEPTOF_PROPERTY,
RELATIONSHIPS
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;

Expand All @@ -16,7 +15,7 @@
* @date 27/09/2016
* Samples, Phenotypes and Ontologies Team, EMBL-EBI
*/
@Controller
@RestController
public class V1ApiUnavailable {

@RequestMapping(path = "/api/unavailable", produces = {MediaType.APPLICATION_JSON_VALUE}, method = RequestMethod.GET)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
* @date 18/08/2015
* Samples, Phenotypes and Ontologies Team, EMBL-EBI
*/

@Tag(name = "Individual Controller", description = "NOTE: For IRI parameters, the value must be URL encoded. " +
"For example, the IRI http://purl.obolibrary.org/obo/IAO_0000124 should be encoded as http%3A%252F%2Fpurl.obolibrary.org%2Fobo%2FIAO_0000124.")
@RestController
Expand Down Expand Up @@ -97,7 +98,8 @@ HttpEntity<PagedModel<V1Individual>> getAllIndividuals(

return new ResponseEntity<>(assembler.toModel(terms, individualAssembler), HttpStatus.OK);
}



@RequestMapping(path = "/findByIdAndIsDefiningOntology/{iri}", produces = {MediaType.APPLICATION_JSON_VALUE, MediaTypes.HAL_JSON_VALUE}, method = RequestMethod.GET)
HttpEntity<PagedModel<V1Individual>> getAllIndividualsByIdAndIsDefiningOntology(
@PathVariable("iri")
Expand All @@ -111,11 +113,11 @@ HttpEntity<PagedModel<V1Individual>> getAllIndividualsByIdAndIsDefiningOntology(
decoded = UriUtils.decode(termId, "UTF-8");
return getAllIndividualsByIdAndIsDefiningOntology(decoded, null, null, lang, pageable, assembler);

}
@RequestMapping(path = "/findByIdAndIsDefiningOntology",
produces = {MediaType.APPLICATION_JSON_VALUE, MediaTypes.HAL_JSON_VALUE},
}


@RequestMapping(path = "/findByIdAndIsDefiningOntology",
produces = {MediaType.APPLICATION_JSON_VALUE, MediaTypes.HAL_JSON_VALUE},
method = RequestMethod.GET)
HttpEntity<PagedModel<V1Individual>> getAllIndividualsByIdAndIsDefiningOntology(
@RequestParam(value = "iri", required = false)
Expand Down Expand Up @@ -148,11 +150,11 @@ HttpEntity<PagedModel<V1Individual>> getAllIndividualsByIdAndIsDefiningOntology(

return new ResponseEntity<>(assembler.toModel(terms, individualAssembler), HttpStatus.OK);
}


@ResponseStatus(value = HttpStatus.NOT_FOUND, reason = "EntityModel not found")
@ExceptionHandler(ResourceNotFoundException.class)
public void handleError(HttpServletRequest req, Exception exception) {
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.data.rest.webmvc.RepositoryLinksResource;
import org.springframework.data.rest.webmvc.ResourceNotFoundException;
Expand All @@ -22,10 +23,14 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import io.swagger.v3.oas.annotations.Parameter;
import uk.ac.ebi.spot.ols.model.FilterOption;
import uk.ac.ebi.spot.ols.model.v1.V1Ontology;
import uk.ac.ebi.spot.ols.repository.v1.V1OntologyRepository;
import java.lang.reflect.*;
import java.util.*;

import javax.servlet.http.HttpServletRequest;

Expand All @@ -34,6 +39,7 @@
* @date 19/08/2015
* Samples, Phenotypes and Ontologies Team, EMBL-EBI
*/

@Tag(name = "Ontology Controller")
@RestController
@RequestMapping("/api/ontologies")
Expand Down Expand Up @@ -86,6 +92,65 @@ HttpEntity<EntityModel<V1Ontology>> getOntology(
return new ResponseEntity<>( documentAssembler.toModel(document), HttpStatus.OK);
}

@RequestMapping(path = "/filterby", produces = {MediaType.APPLICATION_JSON_VALUE, MediaTypes.HAL_JSON_VALUE}, method = RequestMethod.GET)
HttpEntity<PagedModel<V1Ontology>> getOntologiesByMetadata(
@RequestParam(value = "schema", required = true) Collection<String> schemas,
@RequestParam(value = "classification", required = true) Collection<String> classifications,
@Parameter(description = "Set to true (default setting is false) for intersection (default behavior is union) of classifications.")
@RequestParam(value = "exclusive", required = false, defaultValue = "false") boolean exclusive,
@Parameter(description = "Use License option to filter based on license.label, license.logo and license.url variables. " +
"Use Composite Option to filter based on the objects (i.e. collection, subject) within the classifications variable. " +
"Use Linear option to filter based on String and Collection<String> based variables.")
@RequestParam(value = "option", required = false, defaultValue = "LINEAR") FilterOption filterOption,
@PageableDefault(size = 100, page = 0) Pageable pageable,
@RequestParam(value = "lang", required = false, defaultValue = "en") String lang,
PagedResourcesAssembler assembler
) throws ResourceNotFoundException {
Set<V1Ontology> tempSet = new HashSet<V1Ontology>();
if (filterOption == FilterOption.LINEAR)
tempSet = ontologyRepository.filter(schemas,classifications,exclusive, lang);
else if (filterOption == FilterOption.COMPOSITE)
tempSet = ontologyRepository.filterComposite(schemas,classifications,exclusive, lang);
else if (filterOption == FilterOption.LICENSE)
tempSet = ontologyRepository.filterLicense(schemas,classifications,exclusive,lang);
List<V1Ontology> tempList = new ArrayList<V1Ontology>();
tempList.addAll(tempSet);
final int start = (int)pageable.getOffset();
final int end = Math.min((start + pageable.getPageSize()), tempSet.size());
Page<V1Ontology> document = new PageImpl<>(tempList.subList(start, end), pageable, tempSet.size());

return new ResponseEntity<>( assembler.toModel(document, documentAssembler), HttpStatus.OK);
}

@RequestMapping(path = "/schemakeys", produces = {MediaType.APPLICATION_JSON_VALUE, MediaTypes.HAL_JSON_VALUE}, method = RequestMethod.GET)
HttpEntity<Page<String>> filterKeys(
@PageableDefault(size = 100, page = 0) Pageable pageable,
@RequestParam(value = "lang", required = false, defaultValue = "en") String lang,
PagedResourcesAssembler assembler){
Set<String> tempSet = ontologyRepository.getSchemaKeys(lang);
List<String> tempList = new ArrayList<String>();
tempList.addAll(tempSet);
final int start = (int)pageable.getOffset();
final int end = Math.min((start + pageable.getPageSize()), tempSet.size());
Page<String> document = new PageImpl<>(tempList.subList(start, end), pageable, tempSet.size());
return new ResponseEntity<>(document, HttpStatus.OK);
}

@RequestMapping(path = "/schemavalues", produces = {MediaType.APPLICATION_JSON_VALUE, MediaTypes.HAL_JSON_VALUE}, method = RequestMethod.GET)
HttpEntity<Page<String>> filterValues(
@RequestParam(value = "schema", required = true) Collection<String> schemas,
@PageableDefault(size = 100, page = 0) Pageable pageable,
@RequestParam(value = "lang", required = false, defaultValue = "en") String lang,
PagedResourcesAssembler assembler){
Set<String> tempSet = ontologyRepository.getSchemaValues(schemas,lang);
List<String> tempList = new ArrayList<String>();
tempList.addAll(tempSet);
final int start = (int)pageable.getOffset();
final int end = Math.min((start + pageable.getPageSize()), tempSet.size());
Page<String> document = new PageImpl<>(tempList.subList(start, end), pageable, tempSet.size());
return new ResponseEntity<>(document, HttpStatus.OK);
}

@ResponseStatus(value = HttpStatus.NOT_FOUND, reason = "EntityModel not found")
@ExceptionHandler(ResourceNotFoundException.class)
public void handleError(HttpServletRequest req, Exception exception) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
import org.springframework.web.util.UriUtils;
import uk.ac.ebi.spot.ols.model.v1.V1Property;
import uk.ac.ebi.spot.ols.repository.v1.V1JsTreeRepository;
import uk.ac.ebi.spot.ols.repository.v1.V1JsTreeRepositoryExtn;
import uk.ac.ebi.spot.ols.repository.v1.V1PropertyRepository;
import uk.ac.ebi.spot.ols.service.Neo4jClient;
import uk.ac.ebi.spot.ols.service.ViewMode;

import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
Expand All @@ -43,6 +45,9 @@ public class V1OntologyPropertyController {

@Autowired
V1JsTreeRepository jsTreeRepository;

@Autowired
V1JsTreeRepositoryExtn jsTreeRepositoryExtn;

@Autowired
Neo4jClient neo4jClient;
Expand Down Expand Up @@ -269,7 +274,7 @@ HttpEntity<String> getJsTree(
try {
String decoded = UriUtils.decode(termId, "UTF-8");

Object object= jsTreeRepository.getJsTreeForProperty(decoded, ontologyId, lang);
Object object= jsTreeRepositoryExtn.getJsTreeForPropertyByViewMode(decoded, ontologyId, lang, ViewMode.getFromShortName(viewMode), siblings);
ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter();
return new HttpEntity<String>(ow.writeValueAsString(object));
} catch (JsonProcessingException e) {
Expand Down
Loading
Loading