Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
d834b94
Added the add entity component and service
Sabermahjoub Apr 1, 2026
49aadb4
Merge branch 'main' of https://github.com/Sabermahjoub/Projet-RDF
Sabermahjoub Apr 1, 2026
8b32d97
ajouter rico à chaque ouverture d'un projet
CHAREFkhaoula Apr 2, 2026
b2d1013
fixing navigation
mehrezbey Apr 5, 2026
325d496
Merge pull request #36 from Sabermahjoub/fixing-navigation
mehrezbey Apr 5, 2026
32a2c16
return list of all rico classes
Sabermahjoub Apr 5, 2026
a917420
Merge pull request #37 from Sabermahjoub/front-gestion-ressources
Sabermahjoub Apr 5, 2026
bcd9668
Add fetching all predicates by selected entity type
Sabermahjoub Apr 6, 2026
22a79bc
Merge pull request #38 from Sabermahjoub/front-gestion-ressources
Sabermahjoub Apr 6, 2026
b755f9e
Fixed some bugs in the get predicates by type template
Sabermahjoub Apr 6, 2026
4f98da0
Merge pull request #39 from Sabermahjoub/front-gestion-ressources
Sabermahjoub Apr 6, 2026
e6e6c07
Added sparql component
Sabermahjoub Apr 9, 2026
3557357
Merge pull request #40 from Sabermahjoub/front-gestion-ressources
Sabermahjoub Apr 9, 2026
5592d34
fixed entity-details ontology tabs, and fixed some buttons
Sabermahjoub Apr 9, 2026
599dbe4
Merge pull request #41 from Sabermahjoub/front-gestion-ressources
Sabermahjoub Apr 9, 2026
5ad3a25
fixing navigation issues
mehrezbey Apr 9, 2026
ad56d7c
Merge pull request #42 from Sabermahjoub/ADD-NAVIGATION
mehrezbey Apr 9, 2026
2cef978
Added project deletion feature
Sabermahjoub Jun 27, 2026
8b1d658
Merge pull request #43 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jun 27, 2026
eacb95b
Added update project feature on back+front
Sabermahjoub Jun 28, 2026
d202fa1
Merge pull request #44 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jun 28, 2026
e25463d
Merge pull request #20 from Sabermahjoub/main
Sabermahjoub Jun 28, 2026
da94459
Issue#4 - Developed feature to visualize media files
Sabermahjoub Jun 29, 2026
77aae09
Merge pull request #45 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jun 29, 2026
d8fab76
Merge pull request #25 from Sabermahjoub/main
Sabermahjoub Jun 29, 2026
e42b577
Merge pull request #26 from Sabermahjoub/main
Sabermahjoub Jun 29, 2026
220ad99
Fixed the nav-bar styling
Sabermahjoub Jul 1, 2026
55d53f9
Fixed the nav-bar styling
Sabermahjoub Jul 1, 2026
6444ecf
Merge pull request #46 from sylvainloiseau/main
Sabermahjoub Jul 1, 2026
fd4cee2
Merge branch 'Dev-Enhancement-Branch' of https://github.com/sylvainlo…
Sabermahjoub Jul 1, 2026
326b5fa
Merge branch 'Dev-Enhancement-Branch' of https://github.com/sylvainlo…
Sabermahjoub Jul 1, 2026
7a25f0e
Merge pull request #27 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 1, 2026
69fdfdf
Merge pull request #47 from sylvainloiseau/main
Sabermahjoub Jul 1, 2026
deef334
Merge pull request #28 from Sabermahjoub/main
Sabermahjoub Jul 1, 2026
d6de191
Merge pull request #28 from Sabermahjoub/main
Sabermahjoub Jul 1, 2026
09ae108
Merge pull request #29 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 1, 2026
dd39873
Merge pull request #29 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 1, 2026
94442ee
Enhanced creation entity form
Sabermahjoub Jul 2, 2026
8acefb2
Enhanced creation entity form
Sabermahjoub Jul 2, 2026
3c38e44
Merge pull request #30 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 2, 2026
aa1ebe1
Merge pull request #30 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 2, 2026
77bc59e
Added a nested interface to create a new entity from the main entity …
Sabermahjoub Jul 2, 2026
5dfdbb0
Added a nested interface to create a new entity from the main entity …
Sabermahjoub Jul 2, 2026
c82a8c3
Merge pull request #31 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 2, 2026
edd9627
Merge pull request #31 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 2, 2026
2a758d0
Fixed entity creation error
Sabermahjoub Jul 3, 2026
46d67e5
Fixed entity creation error
Sabermahjoub Jul 3, 2026
059cd4d
Merge pull request #32 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 3, 2026
54ac05a
Merge pull request #32 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 3, 2026
35032a6
Refresh list of ranges when subentity is created in the entity creati…
Sabermahjoub Jul 3, 2026
44596b4
Refresh list of ranges when subentity is created in the entity creati…
Sabermahjoub Jul 3, 2026
653ae04
Merge pull request #33 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 3, 2026
a5964c4
Merge pull request #33 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 3, 2026
e57c91f
Added fileViewer from entityDetails Component to view and edit media …
Sabermahjoub Jul 3, 2026
078b34b
Added fileViewer from entityDetails Component to view and edit media …
Sabermahjoub Jul 3, 2026
eab1560
Merge pull request #38 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 3, 2026
e3b7dcc
Merge pull request #38 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 3, 2026
7518457
Added autocreation of internal datasources upon project creation
Sabermahjoub Jul 5, 2026
908d439
Added autocreation of internal datasources upon project creation
Sabermahjoub Jul 5, 2026
4fe9a23
Merge pull request #39 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 5, 2026
9d178eb
Merge pull request #39 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 5, 2026
9e95e15
The name of ranges of type IRIs is now displayed in the entity editio…
Sabermahjoub Jul 6, 2026
eb478bb
The name of ranges of type IRIs is now displayed in the entity editio…
Sabermahjoub Jul 6, 2026
500141b
Merge pull request #48 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 6, 2026
f54ea72
Merge pull request #48 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 6, 2026
b9dda2f
Fixed Issue#40
Sabermahjoub Jul 6, 2026
64ba39d
Fixed Issue#40
Sabermahjoub Jul 6, 2026
9bb1cea
Merge pull request #49 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 6, 2026
3920bdf
Merge pull request #49 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 6, 2026
f852b94
Added commonly used rico types on the entity list (left panel) for th…
Sabermahjoub Jul 7, 2026
3af0bbc
Added commonly used rico types on the entity list (left panel) for th…
Sabermahjoub Jul 7, 2026
0d4a4cd
Merge pull request #51 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 7, 2026
cecbf3d
Merge pull request #51 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 7, 2026
5ea5730
Changed the packages and folders names
Sabermahjoub Jul 7, 2026
6d937ee
Changed the packages and folders names
Sabermahjoub Jul 7, 2026
4568cff
Merge pull request #53 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 7, 2026
991ffb4
Merge pull request #53 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 7, 2026
6b72486
samples rdf graphs
sylvainloiseau Jul 8, 2026
eef31b9
samples rdf graphs
sylvainloiseau Jul 8, 2026
d2918f4
Implementation of the issue#41 (IRI generation for both project prefi…
Sabermahjoub Jul 9, 2026
0f0a0ad
Implementation of the issue#41 (IRI generation for both project prefi…
Sabermahjoub Jul 9, 2026
0c17926
Merge pull request #58 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 9, 2026
331c1d7
Merge pull request #58 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 9, 2026
724a88a
Implemented external TTL files import into internal DS of projects (N…
Sabermahjoub Jul 9, 2026
e71bed2
Implemented external TTL files import into internal DS of projects (N…
Sabermahjoub Jul 9, 2026
edea65a
Merge pull request #59 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 9, 2026
8200f06
Merge pull request #59 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 9, 2026
34584fd
Issue#60 : number of entities per accardion
Sabermahjoub Jul 10, 2026
087babb
Issue#60 : number of entities per accardion
Sabermahjoub Jul 10, 2026
58f61a9
Merge pull request #61 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 10, 2026
a476a5d
Merge pull request #61 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 10, 2026
55bea90
Implemented export of internal datasource of an open project
Sabermahjoub Jul 10, 2026
e22f6d1
Implemented export of internal datasource of an open project
Sabermahjoub Jul 10, 2026
0bf8b50
Merge pull request #63 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 10, 2026
a020780
Merge pull request #63 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 10, 2026
9e7395e
Added implementation to export project backup
Sabermahjoub Jul 11, 2026
a229782
Added implementation to export project backup
Sabermahjoub Jul 11, 2026
45c40ea
Merge pull request #64 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 11, 2026
0def2af
Merge pull request #64 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 11, 2026
65d0e3b
Added some logs to debug export on mac environements
Sabermahjoub Jul 13, 2026
79ed31f
Added some logs to debug export on mac environements
Sabermahjoub Jul 13, 2026
cd045c4
Merge pull request #65 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 13, 2026
bdc1b00
Merge pull request #65 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 13, 2026
4b05598
Kill Zombie Process in electron config
Sabermahjoub Jul 13, 2026
c9cb189
Kill Zombie Process in electron config
Sabermahjoub Jul 13, 2026
2ece815
Merge pull request #66 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 13, 2026
23d97de
Merge pull request #66 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 13, 2026
51a090e
Fixed 404 NOT Found on APIs error by referencing the correct jar file
Sabermahjoub Jul 13, 2026
ed99ab5
Fixed 404 NOT Found on APIs error by referencing the correct jar file
Sabermahjoub Jul 13, 2026
f6d37fe
Merge pull request #67 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 13, 2026
2128fe1
Merge pull request #67 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 13, 2026
1d6bc38
Implemented backup project import
Sabermahjoub Jul 14, 2026
0f17cfe
Implemented backup project import
Sabermahjoub Jul 14, 2026
2e643be
Merge pull request #70 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 14, 2026
95bdcaf
Merge pull request #70 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 14, 2026
265769d
Improved response message upon backup import and datasource import
Sabermahjoub Jul 15, 2026
70ce1f2
Improved response message upon backup import and datasource import
Sabermahjoub Jul 15, 2026
8977927
Merge pull request #72 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 15, 2026
abb32b8
Merge pull request #72 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 15, 2026
51fd454
Documentation material
sylvainloiseau Jul 15, 2026
5bd8305
Documentation material
sylvainloiseau Jul 15, 2026
607e164
Added a new modal window for the properties while creating new entity
Sabermahjoub Jul 16, 2026
400c3bd
Added a new modal window for the properties while creating new entity
Sabermahjoub Jul 16, 2026
fb27fa5
Merge pull request #74 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 16, 2026
912fe73
Merge pull request #74 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 16, 2026
d3ab1d2
Added filters in the properties selection of the entity creation (to …
Sabermahjoub Jul 16, 2026
dbae044
Added filters in the properties selection of the entity creation (to …
Sabermahjoub Jul 16, 2026
5112217
Merge pull request #76 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 16, 2026
28868fb
Merge pull request #76 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 16, 2026
524a6ab
Improved properties selection dialog
Sabermahjoub Jul 17, 2026
a54b5d9
Improved properties selection dialog
Sabermahjoub Jul 17, 2026
0d337d7
Merge pull request #77 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 17, 2026
582be59
Merge pull request #77 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 17, 2026
4576eec
Full implementation of EntityProperties component
Sabermahjoub Jul 17, 2026
1a0ca6e
Full implementation of EntityProperties component
Sabermahjoub Jul 17, 2026
9bc58e7
Merge pull request #78 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 17, 2026
3c06f98
Merge pull request #78 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 17, 2026
b103265
Added a divider
Sabermahjoub Jul 17, 2026
5c3aab8
Added a divider
Sabermahjoub Jul 17, 2026
65342e3
Merge pull request #79 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 17, 2026
f7dc428
Merge pull request #79 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 17, 2026
7023ea6
Storing repositories and projects in AppData directory of the user (M…
Sabermahjoub Jul 18, 2026
c3dd4d8
Storing repositories and projects in AppData directory of the user (M…
Sabermahjoub Jul 18, 2026
ee9c19e
Merge pull request #80 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 18, 2026
551ec0c
Merge pull request #80 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 18, 2026
a10015a
App deployment for end users (to be improved after validation)
Sabermahjoub Jul 20, 2026
302c1c8
Ignore build output directories
Sabermahjoub Jul 20, 2026
e292e92
Ignore build output directories
Sabermahjoub Jul 20, 2026
952515c
Merge branch 'main' into Dev-Enhancement-Branch
Sabermahjoub Jul 20, 2026
ac49ce0
Merge pull request #82 from sylvainloiseau/Dev-Enhancement-Branch
Sabermahjoub Jul 20, 2026
5193b3a
Added an ontology configuration file parsed by the backend
Sabermahjoub Jul 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file modified .gitignore
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 5 additions & 2 deletions RDF_Back/pom.xml → Backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.uspn</groupId>
<artifactId>RDF_Back</artifactId>
<artifactId>Backend</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>RDF_Back</name>
<name>Backend</name>
<description>RDF_Back</description>
<url/>
<licenses>
Expand All @@ -28,6 +28,9 @@
</scm>
<properties>
<java.version>17</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package fr.cnrs.lacito.fieldarchive;

import fr.cnrs.lacito.fieldarchive.example.Example;
import org.eclipse.rdf4j.spring.RDF4JConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Import;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;


@SpringBootApplication
@Import(RDF4JConfig.class)
public class RdfBackApplication {

public static void main(String[] args) {
SpringApplication.run(RdfBackApplication.class, args);
String dataPath = System.getenv("FIELD_ARCHIVE_DATA");

if (dataPath == null) {
throw new IllegalStateException("FIELD_ARCHIVE_DATA is not defined");
}

Path projectsPath = Paths.get(dataPath, "projects");

try {
Files.createDirectories(projectsPath);
} catch (IOException e) {
throw new IllegalStateException("Cannot create projects directory : " + projectsPath, e);
}

System.out.println("Projects directory: " + projectsPath);
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.uspn.rdf_back.config;
package fr.cnrs.lacito.fieldarchive.config;

import org.eclipse.rdf4j.repository.Repository;
import org.eclipse.rdf4j.repository.sail.SailRepository;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.uspn.rdf_back.config;
package fr.cnrs.lacito.fieldarchive.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.uspn.rdf_back.controllers;
package fr.cnrs.lacito.fieldarchive.controllers;

import com.uspn.rdf_back.dtos.CreateInternalDataSourceRequest;
import com.uspn.rdf_back.dtos.CreateExternalDataSourceRequest;
import com.uspn.rdf_back.dtos.DataSourceDto;
import com.uspn.rdf_back.dtos.UpdateDataSourceRequest;
import com.uspn.rdf_back.services.DataSourceService;
import fr.cnrs.lacito.fieldarchive.dtos.CreateInternalDataSourceRequest;
import fr.cnrs.lacito.fieldarchive.dtos.CreateExternalDataSourceRequest;
import fr.cnrs.lacito.fieldarchive.dtos.DataSourceDto;
import fr.cnrs.lacito.fieldarchive.dtos.UpdateDataSourceRequest;
import fr.cnrs.lacito.fieldarchive.services.DataSourceService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package com.uspn.rdf_back.controllers;
package fr.cnrs.lacito.fieldarchive.controllers;

import com.uspn.rdf_back.dtos.OntologyLabelDto;
import com.uspn.rdf_back.dtos.SaveOntologyLabelRequest;
import com.uspn.rdf_back.services.OntologyService;
import fr.cnrs.lacito.fieldarchive.dtos.OntologyLabelDto;
import fr.cnrs.lacito.fieldarchive.dtos.SaveOntologyLabelRequest;
import fr.cnrs.lacito.fieldarchive.services.OntologyService;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;

import com.uspn.rdf_back.dtos.OntologyClassDto;
import com.uspn.rdf_back.services.BuiltinOntologyService;
import fr.cnrs.lacito.fieldarchive.dtos.OntologyClassDto;
import fr.cnrs.lacito.fieldarchive.services.BuiltinOntologyService;

@RestController
@RequestMapping("/ontology")
Expand All @@ -26,7 +27,7 @@ public OntologyController(OntologyService ontologyService,
// TYPES RDF
// =============================
@GetMapping("/types")
public List<String> getTypes() {
public Map<String, Object> getTypes() {
return ontologyService.getAllTypes();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
package fr.cnrs.lacito.fieldarchive.controllers;

import fr.cnrs.lacito.fieldarchive.dtos.*;
import fr.cnrs.lacito.fieldarchive.dtos.*;
import fr.cnrs.lacito.fieldarchive.exceptions.ImportException;
import fr.cnrs.lacito.fieldarchive.services.FileExportService;
import fr.cnrs.lacito.fieldarchive.services.FileImportService;
import fr.cnrs.lacito.fieldarchive.services.ProjectService;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.util.Map;

@RestController
@RequestMapping("/projects")
public class ProjectController {

private final ProjectService projectService;
private final FileImportService fileImportService;
private final FileExportService fileExportService;

public ProjectController(ProjectService projectService, FileImportService fileImportService, FileExportService fileExportService) {
this.projectService = projectService;
this.fileImportService = fileImportService;
this.fileExportService = fileExportService;
}

@PostMapping(value = "/import-backup", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public ResponseEntity<Map<String, Object>> importBackup(@RequestParam("file") MultipartFile file) {
try (InputStream is = file.getInputStream()) {
ImportResult result = fileImportService.importBackup(is);
Map<String, Object> body = new HashMap<>();
body.put("status", "ok");
body.put("message", "Project is successfully restored !");
body.put("project", result.message);
return ResponseEntity.ok(body);

} catch (ImportException e) {
return ResponseEntity.badRequest().body(Map.of("status", "error", "message", e.getMessage()));
} catch (IllegalArgumentException e) {
return ResponseEntity.badRequest().body(Map.of("status", "error", "message", e.getMessage()));
} catch (IOException e) {
return ResponseEntity.internalServerError().body(Map.of("status", "error", "message", "Error while reading file."));
}
}

@GetMapping(value = "/export/backup", produces = "application/zip")
public void exportBackup(HttpServletResponse response) throws IOException {
response.setContentType("application/zip");
response.setHeader("Content-Disposition", "attachment; filename=\"project-backup.zip\"");
fileExportService.exportBackup(response.getOutputStream());
}

@GetMapping(value = "/export/internal", produces = "text/turtle")
public void exportInternal(HttpServletResponse response) throws IOException {
response.setContentType("text/turtle");
response.setHeader("Content-Disposition", "attachment; filename=\"internal-data.ttl\"");
fileExportService.exportInternalDataSource(response.getOutputStream());
}

@PostMapping(value = "/import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public ResponseEntity<Map<String, Object>> importExternalTurtle(
@RequestParam("file") MultipartFile file) {

try (InputStream is = file.getInputStream()) {
String baseURI = projectService.readCurrentProject().prefix;
ImportResult result = fileImportService.importTurtle(is, baseURI);
Map<String, Object> body = new HashMap<>();
body.put("status", "ok");
body.put("message", "Internal DataSource was successfully updated !");
body.put("project", result.message);
return ResponseEntity.ok(body);
} catch (ImportException e) {
return ResponseEntity.badRequest().body(Map.of("status", "error", "message", e.getMessage()));
} catch (IOException e) {
return ResponseEntity.internalServerError().build();
}
}

@PostMapping("/open")
public Map<String, Object> open(@RequestBody CreateProjectRequest req) {
ProjectDto dto = projectService.openProject(req.getName(), req.isPersistent(), req.getDescription(), req.getPrefix());
return Map.of(
"status", "ok",
"project", dto.name
);
}

@PostMapping("/create")
public Map<String, Object> create(@RequestBody CreateProjectRequest req) {
ProjectDto dto = projectService.createProject(req.getName(), req.isPersistent(), req.getDescription(), req.getPrefix());
return Map.of(
"status", "ok",
"project", dto.name
);
}

@GetMapping("/current")
public ProjectDto current() {
return projectService.readCurrentProject();
}

@DeleteMapping("/{projectName}")
public ResponseEntity<String> deleteProject(@PathVariable String projectName) {
try {
projectService.deleteProject(projectName);
return ResponseEntity.ok("Project deleted successfully");

} catch (IllegalArgumentException e) {
return ResponseEntity
.badRequest()
.body(e.getMessage());

} catch (FileNotFoundException e) {
return ResponseEntity
.status(HttpStatus.NOT_FOUND)
.body(e.getMessage());

} catch (IOException e) {
return ResponseEntity
.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body("Error deleting project");
}
}

@PostMapping("/close")
public Map<String, Object> close() {
projectService.closeProject();
return Map.of("status", "ok");
}

@PutMapping("/{oldProjectName}")
public ResponseEntity<?> updateProject(
@PathVariable String oldProjectName,
@RequestBody UpdateProjectObject newProject) {

try {

System.out.println("New Description is "+ newProject.description);
projectService.updateProject(
oldProjectName,
newProject.name,
newProject.description
);

return ResponseEntity.ok(
new ApiResponse<>(true, "Project updated successfully", null)
);

} catch (IllegalArgumentException e) {
return ResponseEntity
.badRequest()
.body(new ApiError(e.getMessage(), "VALIDATION_ERROR"));

} catch (IOException e) {
return ResponseEntity
.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(new ApiError("Internal error while updating project", "IO_ERROR"));

} catch (Exception e) {
return ResponseEntity
.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(new ApiError("Unexpected error", "UNKNOWN_ERROR"));
}
}
// Liste simple
// @GetMapping("/list")
// public List<String> listProjects() {
// return projectService.listProjects();
// }

// Liste détaillée
@GetMapping("/list/details")
public List<Map<String, Object>> listProjectsDetailed() {
return projectService.listProjectsDetailed();
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package com.uspn.rdf_back.controllers;
package fr.cnrs.lacito.fieldarchive.controllers;

import com.uspn.rdf_back.dtos.*;
import com.uspn.rdf_back.services.RdfEntityService;
import fr.cnrs.lacito.fieldarchive.dtos.*;
import fr.cnrs.lacito.fieldarchive.dtos.CreateRdfEntityRequest;
import fr.cnrs.lacito.fieldarchive.dtos.RdfEntityDto;
import fr.cnrs.lacito.fieldarchive.dtos.RdfEntitySummaryDto;
import fr.cnrs.lacito.fieldarchive.dtos.UpdateRdfEntityRequest;
import fr.cnrs.lacito.fieldarchive.services.RdfEntityService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.uspn.rdf_back.controllers;
package fr.cnrs.lacito.fieldarchive.controllers;

import com.uspn.rdf_back.services.SparqlService;
import fr.cnrs.lacito.fieldarchive.services.SparqlService;
import org.springframework.web.bind.annotation.*;

import java.util.List;
Expand All @@ -18,7 +18,9 @@ public SparqlController(SparqlService service) {

@PostMapping("/select")
public List<Map<String, String>> select(@RequestBody Map<String, String> body) {
return service.select(body.get("query"));
String query = body.get("query");
// System.out.println("SPARQL QUERY:\n" + query);
return service.select(query);
}

@PostMapping("/update")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.uspn.rdf_back.core;
package fr.cnrs.lacito.fieldarchive.core;

import org.eclipse.rdf4j.repository.Repository;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
package com.uspn.rdf_back.core;
package fr.cnrs.lacito.fieldarchive.core;
//un contexte = un graphe nommé
public final class RdfContexts {
private RdfContexts() {}

// Contexte où on stocke les METADONNEES des sources (en RDF)
// graphe nommé pour les métadonnées (projet, sources de données, etc.)
public static final String CTX_META = RdfNamespaces.APP + "context/metadata";

// Contexte éditable interne (source interne)
public static final String CTX_INTERNAL = RdfNamespaces.APP + "context/internal";

public static final String CTX_ONTO_RICO = RdfNamespaces.APP + "context/ontology/rico";
public static final String CTX_META = RdfNamespaces.APP + "/context/metadata";
public static final String CTX_ONTO_RICO = RdfNamespaces.APP + "/context/ontology/rico";
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.uspn.rdf_back.core;
package fr.cnrs.lacito.fieldarchive.core;

public final class RdfNamespaces {
private RdfNamespaces() {}

// Namespace interne de l'application
public static final String APP = "http://uspn.fr/app#";
//public static final String APP = "http://example.org/app#";
public static final String APP = "http://cnrs.lacito/app#";
// RIC-O
public static final String RICO = "https://www.ica.org/standards/RiC/ontology#";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.uspn.rdf_back.dtos;
package fr.cnrs.lacito.fieldarchive.dtos;

public record ApiError(
String message,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.uspn.rdf_back.dtos;
package fr.cnrs.lacito.fieldarchive.dtos;

public record ApiResponse<T>(
boolean success,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.uspn.rdf_back.dtos;
package fr.cnrs.lacito.fieldarchive.dtos;


import lombok.Getter;
Expand Down
Loading