From 5e6cd1933a97eb8a5903c3617d03885e91b2124a Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Tue, 24 Oct 2023 16:24:04 +0300 Subject: Use virtuoso's full text search when searching datasets. Signed-off-by: Munyoki Kilyungi --- gn3/api/metadata.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'gn3/api') diff --git a/gn3/api/metadata.py b/gn3/api/metadata.py index ce0b9c4..91e0b24 100644 --- a/gn3/api/metadata.py +++ b/gn3/api/metadata.py @@ -232,17 +232,18 @@ CONSTRUCT { rdfs:label ?label ; dct:title ?title ; ex:belongsToInbredSet ?inbredSetName ; - xkos:classifiedUnder ?datasetType + xkos:classifiedUnder ?datasetType ; ] } WHERE { { SELECT ?dataset ?label ?inbredSetName ?datasetType ?title WHERE { ?dataset rdf:type dcat:Dataset ; rdfs:label ?label ; + ?datasetPredicate ?datasetObject ; xkos:classifiedUnder ?inbredSet . ?inbredSet ^skos:member gnc:Set ; rdfs:label ?inbredSetName . - ?label bif:contains "'$term'" . + ?datasetObject bif:contains "'$term'" . OPTIONAL { ?dataset dct:title ?title . } . @@ -258,8 +259,8 @@ CONSTRUCT { { SELECT (COUNT(*)/$limit+1 AS ?totalCount) WHERE { ?dataset rdf:type dcat:Dataset ; - rdfs:label ?label . - ?label bif:contains "'$term'" . + ?p ?o . + ?o bif:contains "'$term'" . } } -- cgit v1.2.3