aboutsummaryrefslogtreecommitdiff
path: root/gn3
diff options
context:
space:
mode:
Diffstat (limited to 'gn3')
-rw-r--r--gn3/db/rdf/__init__.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/gn3/db/rdf/__init__.py b/gn3/db/rdf/__init__.py
index c763810..ffb75e5 100644
--- a/gn3/db/rdf/__init__.py
+++ b/gn3/db/rdf/__init__.py
@@ -173,13 +173,16 @@ def sparql_construct_query(query: str, endpoint: str) -> dict:
def query_frame_and_compact(query: str, context: dict, endpoint: str) -> dict:
"""Frame and then compact the results given a context"""
results = sparql_construct_query(query, endpoint)
- return jsonld.compact(jsonld.frame(results, context), context)
+ return jsonld.compact(
+ jsonld.frame(results, context),
+ context,
+ options={"graph": True})
def query_and_compact(query: str, context: dict, endpoint: str) -> dict:
"""Compact the results given a context"""
results = sparql_construct_query(query, endpoint)
- return jsonld.compact(results, context)
+ return jsonld.compact(results, context, options={"graph": True})
def query_and_frame(query: str, context: dict, endpoint: str) -> dict: