aboutsummaryrefslogtreecommitdiff
path: root/gn3/db
diff options
context:
space:
mode:
authorMunyoki Kilyungi2024-09-17 14:59:48 +0300
committerJohn Nduli Kilyungi2024-09-18 08:32:34 +0300
commit2a95565d9d156ea4404a0aaeb15ae5c7a85f59c2 (patch)
treec58b2f85d24580ab4b4cc1a3d223bff992fb213a /gn3/db
parent471de9ace138eba6eeeceff018f729491e650212 (diff)
downloadgenenetwork3-2a95565d9d156ea4404a0aaeb15ae5c7a85f59c2.tar.gz
Fetch symbol by it's name.
The RDF ttl files were updated to have: comment gnt:symbol "name" . instead of: comment gnt:symbol symbolQname . * gn3/db/rdf/wiki.py (get_wiki_entries_by_symbol): Fetch symbol using it's string literal name. (get_comment_history): Ditto. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'gn3/db')
-rw-r--r--gn3/db/rdf/wiki.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/gn3/db/rdf/wiki.py b/gn3/db/rdf/wiki.py
index 2864b2b..c278ed8 100644
--- a/gn3/db/rdf/wiki.py
+++ b/gn3/db/rdf/wiki.py
@@ -62,7 +62,7 @@ def get_wiki_entries_by_symbol(
$prefix
CONSTRUCT {
- ?comment rdfs:label ?symbolName;
+ ?comment rdfs:label ?symbol;
gnt:reason ?reason ;
gnt:species ?species ;
dct:references ?pmid ;
@@ -75,13 +75,12 @@ CONSTRUCT {
dct:created ?created ;
dct:identifier ?id_ .
} FROM $graph WHERE {
- ?symbolId rdfs:label ?symbolName .
?comment rdfs:label ?text_ ;
- gnt:symbol ?symbolId ;
+ gnt:symbol ?symbol ;
rdf:type gnc:GNWikiEntry ;
dct:identifier ?id_ ;
dct:created ?createTime .
- FILTER ( LCASE(?symbolName) = LCASE('$symbol') ) .
+ FILTER ( LCASE(?symbol) = LCASE('$symbol') ) .
{
SELECT (MAX(?vers) AS ?max) ?id_ WHERE {
?comment dct:identifier ?id_ ;
@@ -146,10 +145,9 @@ CONSTRUCT {
gnt:hasVersion ?version ;
dct:created ?created .
} FROM $graph WHERE {
- ?symbolId rdfs:label ?symbolName .
?comment rdf:type gnc:GNWikiEntry ;
rdfs:label ?text_ ;
- gnt:symbol ?symbolId ;
+ gnt:symbol ?symbol ;
dct:created ?createTime ;
dct:hasVersion ?version ;
dct:identifier $comment_id ;