From d04779286b49346946120a5801509ba80ee987ba Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Fri, 14 Apr 2023 15:37:31 +0300 Subject: Create new endpoint for fetching GeneRIF entries * gn3/api/metadata.py: Import Template, sparql_query and RDF_PREFIXES. (get_genewiki_entries): New endpoint. * gn3/db/rdf.py: Add new constant for storing rdf prefixes. Signed-off-by: Munyoki Kilyungi --- gn3/db/rdf.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'gn3/db') diff --git a/gn3/db/rdf.py b/gn3/db/rdf.py index deecefa..3e8d513 100644 --- a/gn3/db/rdf.py +++ b/gn3/db/rdf.py @@ -10,6 +10,21 @@ from pymonad.maybe import Just from gn3.monads import MonadicDict +RDF_PREFIXES = """PREFIX dct: +PREFIX foaf: +PREFIX generif: +PREFIX gn: +PREFIX owl: +PREFIX pubmed: +PREFIX rdf: +PREFIX rdfs: +PREFIX taxon: +PREFIX up: +PREFIX xsd: + +""" + + def sparql_query( sparql_conn: SPARQLWrapper, query: str ) -> Tuple[MonadicDict, ...]: -- cgit v1.2.3