aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Nduli2024-06-19 20:53:53 +0300
committerBonfaceKilz2024-07-03 14:24:01 +0300
commitdee508d46c916caa5080da87a264347479576dd2 (patch)
treee3f21dd8dfba58de4397564b93ce046a489bcefd
parent4f691b58419a141a8015c7a2bf5df490d92bc5df (diff)
downloadgenenetwork3-dee508d46c916caa5080da87a264347479576dd2.tar.gz
fix: use correct prefix and index key; group wiki cache query
-rw-r--r--gn3/api/search.py2
-rwxr-xr-xscripts/index-genenetwork8
2 files changed, 5 insertions, 5 deletions
diff --git a/gn3/api/search.py b/gn3/api/search.py
index b3e67cd..588e11d 100644
--- a/gn3/api/search.py
+++ b/gn3/api/search.py
@@ -212,7 +212,7 @@ def parse_query(synteny_files_directory: Path, query: str):
queryparser.add_boolean_prefix("peakchr", "XPC")
queryparser.add_prefix("description", "XD")
queryparser.add_prefix("rif", "XRF")
- queryparser.add_prefix("wikidata", "XRWD")
+ queryparser.add_prefix("wiki", "XWK")
range_prefixes = ["mean", "peak", "position", "peakmb", "additive", "year"]
for i, prefix in enumerate(range_prefixes):
# Treat position specially since it needs its own field processor.
diff --git a/scripts/index-genenetwork b/scripts/index-genenetwork
index 8efe955..5c22b3b 100755
--- a/scripts/index-genenetwork
+++ b/scripts/index-genenetwork
@@ -147,14 +147,14 @@ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX gnt: <http://genenetwork.org/term/>
PREFIX gnc: <http://genenetwork.org/category/>
-SELECT * WHERE {
+SELECT ?symbolName ?speciesName GROUP_CONCAT(DISTINCT ?comment ; separator=\"\\n\") AS ?comment WHERE {
?symbol rdfs:comment _:node ;
rdfs:label ?symbolName .
_:node rdf:type gnc:NCBIWikiEntry ;
gnt:belongsToSpecies ?species ;
rdfs:comment ?comment .
?species gnt:shortName ?speciesName .
-}
+} GROUP BY ?speciesName ?symbolName
"""
@@ -346,7 +346,7 @@ def index_genes(xapian_build_directory: pathlib.Path, chunk_index: int, namespac
Maybe.apply(index_from_dictionary).to_arguments(
Just((trait["species"].value, trait["symbol"].value)),
- Just("XRWD"),
+ Just("XWK"),
Just(share.wiki_cache)
)
@@ -488,7 +488,7 @@ def is_data_modified(xapian_directory: str,
sparql_uri: str) -> None:
dir_ = pathlib.Path(xapian_directory)
with locked_xapian_writable_database(dir_) as db, database_connection(sql_uri) as conn:
- checksums = ""
+ checksums = "-1"
if db.get_metadata('tables'):
checksums = " ".join([
str(result["Checksum"].value)