about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMunyoki Kilyungi2024-02-15 11:31:34 +0300
committerBonfaceKilz2024-02-15 11:35:00 +0300
commit1a14fe968149908ecedb71500314f666985dfa27 (patch)
tree6aeea3608fe4ea7052ecc5a1f6046f4152ba99c7
parentdba5dbd6b43ea088f62426cc2ce6df4787cd9f78 (diff)
downloadgenenetwork3-1a14fe968149908ecedb71500314f666985dfa27.tar.gz
Use correct names for dataset entries in json result.
Since we are appending to an already flattened json-ld file, we don't
need to add the prefixes.

* gn3/api/metadata.py (DATASET_CONTEXT): Add missing "experimentType"
key.
* gn3/db/datasets.py (retrieve_dataset_metadata): Match the __subject
dict with entries from DATASET_CONTEXT.

Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
-rw-r--r--gn3/api/metadata.py1
-rw-r--r--gn3/db/datasets.py24
2 files changed, 13 insertions, 12 deletions
diff --git a/gn3/api/metadata.py b/gn3/api/metadata.py
index fbdc8f5..7334abb 100644
--- a/gn3/api/metadata.py
+++ b/gn3/api/metadata.py
@@ -38,6 +38,7 @@ DATASET_CONTEXT = {
     "description": "dct:description",
     "ex": "http://example.org/stuff/1.0/",
     "experimentDesignInfo": "gnt:hasExperimentDesignInfo",
+    "experimentType": "gnt:hasExperimentType",
     "foaf": "http://xmlns.com/foaf/0.1/",
     "geoSeriesId": "gnt:hasGeoSeriesId",
     "gnt": "http://genenetwork.org/term/",
diff --git a/gn3/db/datasets.py b/gn3/db/datasets.py
index 6ec2126..043be4c 100644
--- a/gn3/db/datasets.py
+++ b/gn3/db/datasets.py
@@ -337,18 +337,18 @@ def retrieve_dataset_metadata(name: str) -> dict:
     """Return the full data given a path, NAME"""
     result = {}
     __subject = {
-        "summary": "dct:description",
-        "tissue": "gnt:hasTissueInfo",
-        "specifics": "gnt:hasTissueInfo",
-        "cases": "gnt:hasCaseInfo",
-        "platform": "gnt:hasPlatformInfo",
-        "processing": "gnt:hasDataProcessingInfo",
-        "notes": "gnt:hasNotes",
-        "experiment-design": "gnt:hasExperimentDesignInfo",
-        "acknowledgment": "gnt:hasAcknowledgement",
-        "citation": "dct:isReferencedBy",
-        "experiment-type": "gnt:hasExperimentType",
-        "contributors": "dct:creator",
+        "summary": "description",
+        "tissue": "tissueInfo",
+        "specifics": "specifics",
+        "cases": "caseInfo",
+        "platform": "platformInfo",
+        "processing": "processingInfo",
+        "notes": "notes",
+        "experiment-design": "experimentDesignInfo",
+        "acknowledgment": "acknowledgement",
+        "citation": "citation",
+        "experiment-type": "experimentType",
+        "contributors": "contributors",
     }
     for __file in Path(name).glob("*rtf"):
         with __file.open() as _f: