Commit 4b15a735 authored by LAVENIER's avatar LAVENIER
Browse files

[fix] Fix RDF URIs

parent 70180a10
......@@ -30,7 +30,7 @@ import org.apache.jena.rdf.model.*;
* see http://www.sandre.eaufrance.fr/atlas/srv/fre/catalog.search#/metadata/0bea2eb9-a4ee-4a81-b494-bd4fb5338ef8
*/
public class APT {
public static final String NS = "http://id.eaufrance.fr/ddd/APT/";
public static final String NS = "http://id.eaufrance.fr/ddd/APT/2.1/";
public static final String PREFIX = "apt";
public static String getURI() {
return NS;
......
......@@ -33,7 +33,7 @@ import org.w3.GEO;
* see http://www.sandre.eaufrance.fr/atlas/srv/fre/catalog.search#/metadata/0bea2eb9-a4ee-4a81-b494-bd4fb5338ef8
*/
public class INC {
public static final String NS = "http://id.eaufrance.fr/ddd/INC/";
public static final String NS = "http://id.eaufrance.fr/ddd/INC/1.0/";
public static final String PREFIX = "inc";
public static String getURI() {
......@@ -52,14 +52,14 @@ public class INC {
public static final Resource Interlocuteur = resource("Interlocuteur");
public static final Resource AdresseInterlocuteur = resource("1.0/#AdresseInterlocuteur");
public static final Resource Compl2Adresse = resource("1.0/Compl2Adresse");
public static final Resource Compl3Adresse = resource("1.0/Compl3Adresse");
public static final Resource NumLbVoieAdresse = resource("1.0/NumLbVoieAdresse");
public static final Resource LgAcheAdresse = resource("1.0/LgAcheAdresse");
public static final Resource PaysInterlocuteur = resource("1.0/PaysInterlocuteur");
public static final Resource CdPays = resource("1.0/CdPays");
public static final Resource DateCreInterlocuteur = resource("1.0/DateCreInterlocuteur");
public static final Resource DateMAJInterlocuteur = resource("1.0/DateMAJInterlocuteur");
public static final Resource AdresseInterlocuteur = resource("AdresseInterlocuteur");
public static final Resource Compl2Adresse = resource("Compl2Adresse");
public static final Resource Compl3Adresse = resource("Compl3Adresse");
public static final Resource NumLbVoieAdresse = resource("NumLbVoieAdresse");
public static final Resource LgAcheAdresse = resource("LgAcheAdresse");
public static final Resource PaysInterlocuteur = resource("PaysInterlocuteur");
public static final Resource CdPays = resource("CdPays");
public static final Resource DateCreInterlocuteur = resource("DateCreInterlocuteur");
public static final Resource DateMAJInterlocuteur = resource("DateMAJInterlocuteur");
}
......@@ -73,18 +73,17 @@ public class ModelURIs {
// TaxonConcept
.put("txn", "http://lod.taxonconcept.org/ontology/txn.owl")
// Data catalog
.put("dcat", "http://www.w3.org/ns/dcat")
// Sandre
.put("apt", APT.NS)
.put("apt2", APT.NS + "2.1/")
.put("inc", INC.NS)
.put("inc1", INC.NS + "1.0/")
// TaxRef (MNHN)
.put("taxref", "http://taxref.mnhn.fr/lod/")
.put("taxrefprop", "http://taxref.mnhn.fr/lod/property/")
// Data catalog
.put("dcat", "http://www.w3.org/ns/dcat")
.build();
......
......@@ -22,7 +22,7 @@
package net.sumaris.server.http;
public interface RestPaths {
public interface RdfRestPaths {
String SPARQL_ENDPOINT = "/sparql";
String ONTOLOGY_BASE_PATH = "/ontology";
......
......@@ -25,7 +25,7 @@ package net.sumaris.server.http.config;
import net.sumaris.rdf.config.RdfConfiguration;
import net.sumaris.rdf.model.ModelURIs;
import net.sumaris.rdf.util.RdfFormat;
import net.sumaris.server.http.RestPaths;
import net.sumaris.server.http.RdfRestPaths;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
......@@ -145,13 +145,13 @@ public class RdfWebConfiguration {
public void addCorsMappings(CorsRegistry registry) {
// Enable Global CORS support for the application
//See https://stackoverflow.com/questions/35315090/spring-boot-enable-global-cors-support-issue-only-get-is-working-post-put-and
registry.addMapping(RestPaths.SPARQL_ENDPOINT + "/**")
registry.addMapping(RdfRestPaths.SPARQL_ENDPOINT + "/**")
.allowedOriginPatterns("*")
.allowedMethods("GET", "POST", "PUT", "DELETE", "HEAD", "OPTIONS")
.allowedHeaders("accept", "access-control-allow-origin", "authorization", "content-type")
.allowCredentials(true);
registry.addMapping(RestPaths.ONTOLOGY_BASE_PATH + "/**")
registry.addMapping(RdfRestPaths.ONTOLOGY_BASE_PATH + "/**")
.allowedOriginPatterns("*")
.allowedMethods("GET", "POST", "PUT", "DELETE", "HEAD", "OPTIONS")
.allowedHeaders("accept", "access-control-allow-origin", "authorization", "content-type")
......
......@@ -37,7 +37,7 @@ import net.sumaris.rdf.service.schema.RdfSchemaService;
import net.sumaris.rdf.util.ModelUtils;
import net.sumaris.rdf.util.RdfFormat;
import net.sumaris.rdf.util.RdfMediaType;
import net.sumaris.server.http.RestPaths;
import net.sumaris.server.http.RdfRestPaths;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.jena.rdf.model.Model;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
......@@ -61,7 +61,7 @@ import java.util.Objects;
@RestController
@ConditionalOnBean({WebMvcConfigurer.class, RdfConfiguration.class})
@Slf4j
public class OntologyRestController implements RestPaths {
public class OntologyRdfRestController implements RdfRestPaths {
protected static final String EXTENSION_PATH_PARAM = ".{extension:[a-z0-9-_]+}";
......
......@@ -34,7 +34,7 @@ import net.sumaris.rdf.service.store.RdfDatasetService;
import net.sumaris.rdf.util.ModelUtils;
import net.sumaris.rdf.util.RdfFormat;
import net.sumaris.rdf.util.RdfMediaType;
import net.sumaris.server.http.RestPaths;
import net.sumaris.server.http.RdfRestPaths;
import org.apache.jena.query.*;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
......@@ -64,7 +64,7 @@ import java.util.Optional;
@RestController
@ConditionalOnBean({WebMvcConfigurer.class, RdfConfiguration.class})
@Slf4j
public class SparqlRestController implements RestPaths {
public class SparqlRdfRestController implements RdfRestPaths {
@Resource
private RdfSchemaService schemaService;
......
......@@ -33,7 +33,7 @@ import net.sumaris.rdf.service.RdfModelService;
import net.sumaris.rdf.util.ModelUtils;
import net.sumaris.rdf.util.RdfFormat;
import net.sumaris.rdf.util.RdfMediaType;
import net.sumaris.server.http.RestPaths;
import net.sumaris.server.http.RdfRestPaths;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.jena.rdf.model.Model;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
......@@ -57,7 +57,7 @@ import java.util.Optional;
@RestController
@ConditionalOnBean({WebMvcConfigurer.class, RdfConfiguration.class})
@Slf4j
public class WebvowlRestController implements RestPaths {
public class WebvowlRdfRestController implements RdfRestPaths {
public static final String SERVER_TIMESTAMP_PATH = WEBVOWL_BASE_PATH +"/serverTimeStamp";
public static final String CONVERT_PATH = WEBVOWL_BASE_PATH + "/convert";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment