aboutsummaryrefslogtreecommitdiff
path: root/gn3/api
diff options
context:
space:
mode:
authorMunyoki Kilyungi2023-10-24 16:27:35 +0300
committerBonfaceKilz2023-10-27 13:45:32 +0300
commit1db5eb7f415bbeaea4c5d161fa885791c4a71eba (patch)
tree7484259f133b80c6cd3cd2140fdc5b2b92b31a0e /gn3/api
parent5e6cd1933a97eb8a5903c3617d03885e91b2124a (diff)
downloadgenenetwork3-1db5eb7f415bbeaea4c5d161fa885791c4a71eba.tar.gz
Remove un-necessary prefixes when searching publications.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'gn3/api')
-rw-r--r--gn3/api/metadata.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/gn3/api/metadata.py b/gn3/api/metadata.py
index 91e0b24..00dea0a 100644
--- a/gn3/api/metadata.py
+++ b/gn3/api/metadata.py
@@ -298,7 +298,7 @@ CONSTRUCT {
@metadata.route("/publications/<name>", methods=["GET"])
def publications(name):
- """Fetch a publication's metadata given it's ACCESSION_ID"""
+ """Fetch a publication's metadata given it's NAME"""
try:
if "unpublished" in name:
name = f"gn:unpublished{name}"
@@ -319,9 +319,13 @@ CONSTRUCT {
return jsonld.compact(
json.loads(sparql.queryAndConvert().serialize(format="json-ld")),
{
- "@context": PREFIXES | {
+ "@context": {
"type": "@type",
"id": "@id",
+ "dct": "http://purl.org/dc/terms/",
+ "fabio": "http://purl.org/spar/fabio/",
+ "prism": "http://prismstandard.org/namespaces/basic/2.0/",
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
"title": "dct:title",
"journal": "fabio:Journal",
"volume": "prism:volume",