diff --git a/backend/src/decentriq.py b/backend/src/decentriq.py index 5262d05..3ef39f1 100644 --- a/backend/src/decentriq.py +++ b/backend/src/decentriq.py @@ -167,10 +167,7 @@ async def create_compute_dcr( builder.add_node_definition(TableDataNodeDefinition(name=data_node_id, columns=get_cohort_schema(cohort), is_required=True)) data_nodes.append(data_node_id) - # TODO: made airlock always True for testing - # if cohort.airlock: - print(f"AIRLOCK {cohort.airlock}") - if True: + if cohort.airlock: # Add airlock node to make it easy to access small part of the dataset preview_node_id = f"preview-{data_node_id}" builder.add_node_definition(PreviewComputeNodeDefinition( diff --git a/backend/src/upload.py b/backend/src/upload.py index 2bbb3cf..37020a1 100644 --- a/backend/src/upload.py +++ b/backend/src/upload.py @@ -219,7 +219,8 @@ def load_cohort_dict_file(dict_path: str, cohort_id: str, airlock: bool) -> Data g = init_graph() g.add((cohort_uri, RDF.type, ICARE.Cohort, cohort_uri)) g.add((cohort_uri, DC.identifier, Literal(cohort_id), cohort_uri)) - g.add((cohort_uri, ICARE.previewEnabled, Literal(str(airlock).lower(), datatype=XSD.boolean), cohort_uri)) + # Preview goes to mapping graph because it is defined in the explorer UI + g.add((cohort_uri, ICARE.previewEnabled, Literal(str(airlock).lower(), datatype=XSD.boolean), get_cohort_mapping_uri(cohort_id))) # Record all errors and raise them at the end errors = [] diff --git a/backend/src/utils.py b/backend/src/utils.py index 717717b..cf1addc 100644 --- a/backend/src/utils.py +++ b/backend/src/utils.py @@ -55,7 +55,6 @@ def run_query(query: str) -> dict[str, Any]: OPTIONAL { ?cohort icare:studyOngoing ?study_ongoing . } OPTIONAL { ?cohort icare:studyPopulation ?study_population . } OPTIONAL { ?cohort icare:studyObjective ?study_objective . } - OPTIONAL { ?cohort icare:previewEnabled ?airlock . } } OPTIONAL { @@ -94,6 +93,7 @@ def run_query(query: str) -> dict[str, Any]: ?category icare:mappedId ?categoryMappedId . OPTIONAL { ?categoryMappedId rdfs:label ?categoryMappedLabel } } + OPTIONAL { ?cohort icare:previewEnabled ?airlock . } } } } ORDER BY ?cohort ?index