diff --git a/src/components/Search/OcResourceSearchFacetList/OcResourceSearchFacetList.vue b/src/components/Search/OcResourceSearchFacetList/OcResourceSearchFacetList.vue index e58907f3b840e376f16ab810084ee23fc9562290..0e40f9527aae421ce7ef6a8f71db0f411c3662a3 100644 --- a/src/components/Search/OcResourceSearchFacetList/OcResourceSearchFacetList.vue +++ b/src/components/Search/OcResourceSearchFacetList/OcResourceSearchFacetList.vue @@ -1,4 +1,5 @@ <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" /> diff --git a/src/components/Search/OcSearchResultCardSkeleton/OcSearchResultCardSkeleton.vue b/src/components/Search/OcSearchResultCardSkeleton/OcSearchResultCardSkeleton.vue index 7303e2663e7b6b1683aa2f06bc963adac5cbdd4e..5f6eec4024cd7b05114cffd5cb7e4d33734885b6 100644 --- a/src/components/Search/OcSearchResultCardSkeleton/OcSearchResultCardSkeleton.vue +++ b/src/components/Search/OcSearchResultCardSkeleton/OcSearchResultCardSkeleton.vue @@ -1,15 +1,15 @@ <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"> diff --git a/src/helpers/icons.ts b/src/helpers/icons.ts index 5bfb9e427b2cf87144930537c2de834b7d15e5aa..fe44f757b5defd09a88ad2fcbb92161dd2ff4afb 100644 --- a/src/helpers/icons.ts +++ b/src/helpers/icons.ts @@ -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' } diff --git a/src/helpers/resourceType.ts b/src/helpers/resourceType.ts index e35076ed3b0f56ad063eeca7b8bf8a64f75472e2..e2a7cb2c70b8c1d5c84a6ed061e837305750869f 100644 --- a/src/helpers/resourceType.ts +++ b/src/helpers/resourceType.ts @@ -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 => { diff --git a/src/locales/en.ts b/src/locales/en.ts index fbc0c51e4fbe8d295d541885d604a57e20184fd1..f985907f7ba4e3f7df498a796f312965989dab14 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -365,6 +365,7 @@ Greetings, 'dataset': 'dataset', 'distribution': 'distribution', 'service': 'service', + 'concept': 'concept', 'unknown': 'unknown', }, and: 'and' diff --git a/src/locales/fr.ts b/src/locales/fr.ts index 808ba9f1e817fae0b585fe92b1daaf2fbbe8b609..22e8be9e22b4f93e3a2b395567cd1a43f0139f30 100644 --- a/src/locales/fr.ts +++ b/src/locales/fr.ts @@ -381,6 +381,7 @@ Cordialement, 'dataset': 'jeu de données', 'distribution': 'distribution', 'service': 'service', + 'concept': 'concept', 'unknown': 'inconnu', }, and: 'et' diff --git a/src/pages/community/[community].search.vue b/src/pages/community/[community].search.vue index 960b7c765145433cd56c660cd8a673561859f239..e076162917e0738812641c00663837eade5664d8 100644 --- a/src/pages/community/[community].search.vue +++ b/src/pages/community/[community].search.vue @@ -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(() => { diff --git a/src/sparql/search.ts b/src/sparql/search.ts index ce520a40f73bbcd5ad42b55afe2a18d5bf05007b..c0807945a651c0c22d7bdc034e03acf77d71f2ca 100644 --- a/src/sparql/search.ts +++ b/src/sparql/search.ts @@ -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>( `