aboutsummaryrefslogtreecommitdiff
path: root/gn3/db
diff options
context:
space:
mode:
authorMunyoki Kilyungi2023-04-14 15:37:31 +0300
committerBonfaceKilz2023-04-17 15:24:36 +0300
commitd04779286b49346946120a5801509ba80ee987ba (patch)
treee3ff261fbb2b3b906a489a6d571c4d56fc19c724 /gn3/db
parent8af8105444522c2c71b5ddd36a550e964cddffbf (diff)
downloadgenenetwork3-d04779286b49346946120a5801509ba80ee987ba.tar.gz
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 <me@bonfacemunyoki.com>
Diffstat (limited to 'gn3/db')
-rw-r--r--gn3/db/rdf.py15
1 files changed, 15 insertions, 0 deletions
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: <http://purl.org/dc/terms/>
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+PREFIX generif: <http://www.ncbi.nlm.nih.gov/gene?cmd=Retrieve&dopt=Graphics&list_uids=>
+PREFIX gn: <http://genenetwork.org/>
+PREFIX owl: <http://www.w3.org/2002/07/owl#>
+PREFIX pubmed: <http://rdf.ncbi.nlm.nih.gov/pubmed/>
+PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
+PREFIX up: <http://purl.uniprot.org/core/>
+PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
+
+"""
+
+
def sparql_query(
sparql_conn: SPARQLWrapper, query: str
) -> Tuple[MonadicDict, ...]: