Skip to content

Commit

Permalink
fix airlock
Browse files Browse the repository at this point in the history
  • Loading branch information
vemonet committed Apr 11, 2024
1 parent 4d6972b commit 232723e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
5 changes: 1 addition & 4 deletions backend/src/decentriq.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 2 additions & 1 deletion backend/src/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
2 changes: 1 addition & 1 deletion backend/src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 232723e

Please sign in to comment.