From 2a95565d9d156ea4404a0aaeb15ae5c7a85f59c2 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Tue, 17 Sep 2024 14:59:48 +0300 Subject: 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 --- gn3/db/rdf/wiki.py | 10 ++++------ 1 file 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 ; -- cgit v1.2.3