From 73fbdd57d59769d151bd85b4020e312651f2569c Mon Sep 17 00:00:00 2001 From: Emmanuel Date: Thu, 30 Nov 2023 15:39:24 +0100 Subject: [PATCH] fix: update the URL rewriting --- src/App.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/App.js b/src/App.js index bdd0052..56632b7 100644 --- a/src/App.js +++ b/src/App.js @@ -2,7 +2,7 @@ import "./App.css"; import { useEffect, useLayoutEffect, useRef, useState } from "react"; const defaultEndpoint = "http://rdf.insee.fr/sparql"; -const defaultPrefix = "https://rdf.insee.fr/sparql/describe?uri="; +const defaultPrefix = "https://rdf.insee.fr/sparql?query=DESCRIBE"; function Editor({ endpoint, queries, prefix }) { const [yasgui, setYasgui] = useState(); @@ -62,7 +62,7 @@ function Editor({ endpoint, queries, prefix }) { e.target.href.indexOf("http://id.insee.fr/") === 0 && e.target.href.indexOf(prefix) !== 0 ) { - e.target.href = prefix + encodeURIComponent(e.target.href); + e.target.href = prefix + encodeURIComponent(`<${e.target.href}>`); } }} > @@ -89,7 +89,7 @@ function App() { .then((response) => response.json()) .then((configuration) => { setEndpoint(configuration.sparql_endpoint ?? defaultEndpoint); - setPrefix(configuration.prefix ?? defaultPrefix) + setPrefix(configuration.prefix ?? defaultPrefix); }) .catch(() => { setEndpoint(defaultEndpoint);