From 1db5eb7f415bbeaea4c5d161fa885791c4a71eba Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Tue, 24 Oct 2023 16:27:35 +0300 Subject: Remove un-necessary prefixes when searching publications. Signed-off-by: Munyoki Kilyungi --- gn3/api/metadata.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gn3/api') 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/", 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", -- cgit v1.2.3