Skip to content
Snippets Groups Projects
Commit 3c08c3a2 authored by Mathieu Massaviol's avatar Mathieu Massaviol
Browse files

Various corrections #29

parent 12067371
No related branches found
No related tags found
1 merge request!75Resolve "Permettre la recherche d'un jeu de données"
<template>
WIP
<Panel :header="t('search.resourceType')" toggleable>
<template #toggleicon="toggleIconProps">
<i v-if="toggleIconProps.collapsed" class="fa-solid fa-chevron-down text-gray-700" />
......
<template>
<div class="bg-gray-100 w-full h-44 rounded-md ">
<div class="p-4 h-36">
<div id="title" class="font-semibold text-2xl flex flex-row gap-2 mb-2">
<div class="bg-gray-100 w-full h-58 rounded-md ">
<div class="p-4 h-50">
<div id="title" class="font-semibold text-2xl flex flex-row gap-2 mb-3">
<p class="w-6 h-6 bg-slate-200 rounded animate-pulse"></p>
<p class="rounded bg-slate-200 w-4/5 h-6 text-white font-semibold text-2xl animate-pulse"></p>
</div>
<div id="subtitle" class="text-sm w-1/5 h-2 bg-slate-200 mb-2"></div>
<div id="creators" class="rounded bg-slate-200 w-4/5 h-4 text-white font-semibold text-2xl animate-pulse"></div>
<div id="subtitle" class="text-sm w-1/5 h-2 bg-slate-200 mb-4 animate-pulse"></div>
<div id="creators" class="rounded bg-slate-200 w-4/5 h-4 mb-4 text-white font-semibold text-2xl animate-pulse"></div>
<div id="description">
<p class="font-medium text-gray-500 animate-pulse">{{ t('search.searchResult.description') }}</p>
<p class="rounded text-sm bg-slate-200 h-8 w-full"></p>
<p class="font-medium text-gray-500 mb-1 animate-pulse">{{ t('search.searchResult.description') }}</p>
<p class="rounded text-sm bg-slate-200 h-12 w-full animate-pulse"></p>
</div>
</div>
<div id="footer" class="bg-gray-200 rounded-b-md h-8">
......
......@@ -13,5 +13,7 @@ export const iconsDict:Record<string, string> = {
dataset: 'fa-solid fa-table',
distribution: 'fa-solid fa-file',
service: 'fa-solid fa-cube',
search: 'fa-solid fa-magnifying-glass'
search: 'fa-solid fa-magnifying-glass',
concept: 'fa-solid fa-quote-right',
unknown: 'fa-solid fa-question'
}
......@@ -3,6 +3,7 @@ export enum ResourceType {
DATASET ='dataset',
DISTRIBUTION ='distribution',
SERVICE ='service',
CONCEPT = 'concept',
UNKNOWN = 'unknown',
}
......@@ -10,7 +11,8 @@ export const type2ResourceType: Record<string, ResourceType> = {
'http://www.w3.org/ns/dcat#Catalog': ResourceType.CATALOG,
'http://www.w3.org/ns/dcat#Dataset': ResourceType.DATASET,
'http://www.w3.org/ns/dcat#Distribution': ResourceType.DISTRIBUTION,
'http://www.w3.org/ns/dcat#Service': ResourceType.SERVICE,
'http://www.w3.org/ns/dcat#DataService': ResourceType.SERVICE,
'http://www.w3.org/2004/02/skos/core#Concept': ResourceType.CONCEPT
}
export const getResourceTypeFromAtType = (atType: string | string[]): ResourceType => {
......
......@@ -365,6 +365,7 @@ Greetings,
'dataset': 'dataset',
'distribution': 'distribution',
'service': 'service',
'concept': 'concept',
'unknown': 'unknown',
},
and: 'and'
......
......@@ -381,6 +381,7 @@ Cordialement,
'dataset': 'jeu de données',
'distribution': 'distribution',
'service': 'service',
'concept': 'concept',
'unknown': 'inconnu',
},
and: 'et'
......
......@@ -172,7 +172,7 @@ const loadRouteParams = () => {
start.value = route.query.start ? parseInt(route.query.start as string) : 0
}
watch(() => route.query.page, () => { getResultsForStart(start.value)})
watch(() => route.query.start, () => { getResultsForStart(start.value) })
watch(() => route.query, search)
onBeforeMount(() => {
......
......@@ -44,7 +44,12 @@ export const searchResources = async (query: OcSearchQuery, auth?: Credentials)
`
})
}
/**
* On retire les ressources ayant un espace dans leur IRI car SPARQL ne les autorise pas
*
* FILTER (!contains(str(?resource), ' '))
*/
const res = await executeSparqlSelect(
`
SELECT DISTINCT ?resource
......@@ -52,6 +57,8 @@ export const searchResources = async (query: OcSearchQuery, auth?: Credentials)
?resource rdf:type ?type.
?resource dct:identifier ?identifier.
FILTER (!contains(str(?resource), ' '))
${queryFilter}
} ORDER BY ASC(?resource)
......@@ -112,7 +119,13 @@ export const getSearchResults = async (resourceUriList: string[], auth?: Credent
const frame = {
'@context': {...searchResultContext, ...creatorContext},
'@type': ['http://www.w3.org/ns/dcat#Catalog','http://www.w3.org/ns/dcat#Dataset','http://www.w3.org/ns/dcat#Distribution'],
'@type': [
'http://www.w3.org/ns/dcat#Catalog',
'http://www.w3.org/ns/dcat#Dataset',
'http://www.w3.org/ns/dcat#Distribution',
'http://www.w3.org/ns/dcat#DataService',
'http://www.w3.org/2004/02/skos/core#Concept'
],
contains: {
creator: {
'@id': 'http://purl.org/dc/terms/creator',
......@@ -125,7 +138,7 @@ export const getSearchResults = async (resourceUriList: string[], auth?: Credent
}
}
const formattedUris = '<' + resourceUriList.map((uri) => uri.trim()).join('> <') + '>'
const formattedUris = '<' + resourceUriList.join('> <') + '>'
const res = await executeSparqlConstruct<OcSearchResult>(
`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment