feat: Enhance dataset management and improve frontend components
Some checks failed
CI Pipeline / japa-tests (push) Failing after 1m0s
Some checks failed
CI Pipeline / japa-tests (push) Failing after 1m0s
- Added preloads 'allowed_extensions_mimetypes' and 'dependent_array_min_length' in adonisrc.ts - Updated @symfony/webpack-encore from ^4.6.1 to ^5.0.1 - AdminuserController: Implemented pagination for 10 records in index method - Enabled reviewers to reject datasets to editors with email notifications (DatasetController.ts) - Submitter DatasetController: Files now loaded in ascending order (sort_order) in edit mode - file.ts: Removed serialization of fileData due to browser issues - Modified FileUpload.vue to mark already uploaded files as deleted - Improved keyword search in SearchCategoryAutocomplete.vue - Started development on Category.vue for submitters to categorize DDC - Added new route /dataset/categorize in routes.ts - Introduced 2 new rules in start/rules: allowed_extensions_mimetypes.ts and dependent_array_min_length.ts - Performed npm updates
This commit is contained in:
parent
49bd96ee77
commit
f67b736a88
23 changed files with 2392 additions and 2759 deletions
|
@ -295,35 +295,10 @@ async function handleInput(e: Event) {
|
|||
// }
|
||||
// }
|
||||
|
||||
// Function to execute the SPARQL query against the endpoint
|
||||
async function request(url: string, param: string) {
|
||||
try {
|
||||
let query = encodeURIComponent(`
|
||||
PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
|
||||
select distinct (?label as ?title) ?s (strlen(str(?label)) as ?strlen)
|
||||
where
|
||||
{
|
||||
VALUES ?n {"${sparqlEncode(param.toLowerCase())}"}
|
||||
?s skos:prefLabel ?label .
|
||||
filter(lang(?label)='${language.value}')
|
||||
filter(regex(?label, ?n, "i")) # Case-insensitive regex match
|
||||
}
|
||||
order by ?label ?strlen
|
||||
|
||||
`);
|
||||
let response = await searchTerm(url + '?query=' + query + '&format=application/json');
|
||||
error.value = '';
|
||||
data.results = getResults(response);
|
||||
// // this.results = res.data;
|
||||
// // this.loading = false;
|
||||
} catch (error) {
|
||||
error.value = error.message;
|
||||
// this.loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function requestOriginal(url: string, param: string) {
|
||||
try {
|
||||
// Create SPARQL query to search for concepts by keyword
|
||||
let query = encodeURIComponent(`
|
||||
PREFIX dcterms:<http://purl.org/dc/terms/>
|
||||
PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
|
||||
|
@ -331,37 +306,69 @@ async function requestOriginal(url: string, param: string) {
|
|||
WHERE {
|
||||
VALUES ?n {"${sparqlEncode(param.toLowerCase())}"}
|
||||
VALUES ?p { skos:prefLabel skos:altLabel }
|
||||
?s a skos:Concept; ?p ?lEN . FILTER((lang(?lEN)="en"))
|
||||
|
||||
?s a skos:Concept; ?p ?lEN .
|
||||
FILTER((lang(?lEN)="en"))
|
||||
|
||||
# FILTER(regex(str(?s), 'ncl/geoera/keyword'))
|
||||
# New filter added to restrict the URIs to 'ncl/geoera/keyword'
|
||||
FILTER(regex(str(?s), 'ncl/geoera/keyword'))
|
||||
|
||||
OPTIONAL{?s ?p ?l . FILTER(lang(?l)="${language.value}")}
|
||||
BIND(COALESCE(?l, ?lEN) AS ?L) . FILTER(regex(?L,?n,"i"))
|
||||
BIND(COALESCE(?l, ?lEN) AS ?L) .
|
||||
FILTER(regex(?L, ?n, "i"))
|
||||
|
||||
# Exclude "(category)" in titles
|
||||
FILTER(!regex(?L, "\(category\)", "i"))
|
||||
FILTER(!regex(?L, "\(kategorie\)", "i"))
|
||||
|
||||
?s skos:prefLabel ?plEN . FILTER((lang(?plEN)="en"))
|
||||
|
||||
OPTIONAL{?s skos:prefLabel ?pl . FILTER(lang(?pl)="${language.value}")}
|
||||
BIND(COALESCE(?pl, ?plEN) AS ?title)
|
||||
BIND(CONCAT(STR(?p),"|",STR(?L)) AS ?text)
|
||||
BIND(IF(?p=skos:prefLabel,1,2) AS ?sort)
|
||||
BIND(CONCAT(STR(?p), "|", STR(?L)) AS ?text)
|
||||
BIND(IF(?p = skos:prefLabel, 1, 2) AS ?sort)
|
||||
}
|
||||
ORDER BY ?sort
|
||||
LIMIT 100`);
|
||||
|
||||
|
||||
let response = await searchTerm(url + '?query=' + query + '&format=application/json');
|
||||
let response = await searchTerm(url + '?query=' + query + '&format=application/json'); // Execute query
|
||||
error.value = '';
|
||||
data.results = getResults(response);
|
||||
// // this.results = res.data;
|
||||
// // this.loading = false;
|
||||
data.results = getResults(response); // Process results and store them
|
||||
} catch (error) {
|
||||
error.value = error.message;
|
||||
// this.loading = false;
|
||||
error.value = error.message; // Handle any errors in fetching the data
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// async function request(url: string, param: string) {
|
||||
// try {
|
||||
// let query = encodeURIComponent(`
|
||||
// PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
|
||||
// select distinct (?label as ?title) ?s (strlen(str(?label)) as ?strlen)
|
||||
// where
|
||||
// {
|
||||
// VALUES ?n {"${sparqlEncode(param.toLowerCase())}"}
|
||||
// ?s skos:prefLabel ?label .
|
||||
// filter(lang(?label)='${language.value}')
|
||||
// filter(regex(?label, ?n, "i")) # Case-insensitive regex match
|
||||
// }
|
||||
// order by ?label ?strlen
|
||||
|
||||
// `);
|
||||
// let response = await searchTerm(url + '?query=' + query + '&format=application/json');
|
||||
// error.value = '';
|
||||
// data.results = getResults(response);
|
||||
// // // this.results = res.data;
|
||||
// // // this.loading = false;
|
||||
// } catch (error) {
|
||||
// error.value = error.message;
|
||||
// // this.loading = false;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
async function searchTerm(term: string): Promise<any> {
|
||||
let res = await axios.get(term);
|
||||
// console.log(res.data);
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue