Repository: PennLINC/xcp_d

Issue:
Replace `bids:xcp_d:` BIDS URIs with `bids::`
## Summary
<!--What would you like changed/added and why?-->
`bids::` is a protected case for the dataset in which the URI is defined (i.e., the XCP-D derivatives dataset).


Discussion:
codecov[bot]: ## [Codecov](https://app.codecov.io/gh/PennLINC/xcp_d/pull/1088?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PennLINC) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 82.42%. Comparing base [(`9fe6603`)](https://app.codecov.io/gh/PennLINC/xcp_d/commit/9fe66035990564ef9b3fa5d95aa979b3c2273a16?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PennLINC) to head [(`f396096`)](https://app.codecov.io/gh/PennLINC/xcp_d/pull/1088?dropdown=coverage&src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PennLINC).


<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##             main    #1088      +/-   ##
==========================================
- Coverage   82.43%   82.42%   -0.01%     
==========================================
  Files          48       48              
  Lines        5916     5913       -3     
  Branches      798      797       -1     
==========================================
- Hits         4877     4874       -3     
  Misses        837      837              
  Partials      202      202              
```



</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/PennLINC/xcp_d/pull/1088?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PennLINC).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PennLINC).


Patch:
diff --git a/xcp_d/utils/bids.py b/xcp_d/utils/bids.py
index 0938f70..0e2b6c0 100644
--- a/xcp_d/utils/bids.py
+++ b/xcp_d/utils/bids.py
@@ -733,11 +733,6 @@ def write_dataset_description(fmri_dir, xcpd_dir, custom_confounds_folder=None):
 
     dset_desc["DatasetLinks"]["preprocessed"] = str(fmri_dir)
 
-    if "xcp_d" in dset_desc["DatasetLinks"].keys():
-        LOGGER.warning("'xcp_d' is already a dataset link. Overwriting.")
-
-    dset_desc["DatasetLinks"]["xcp_d"] = str(xcpd_dir)
-
     if custom_confounds_folder:
         if "custom_confounds" in dset_desc["DatasetLinks"].keys():
             LOGGER.warning("'custom_confounds' is already a dataset link. Overwriting.")
@@ -1005,9 +1000,9 @@ def _make_xcpd_uri(out_file, output_dir):
     dataset_path = os.path.join(output_dir, "xcp_d")
 
     if isinstance(out_file, list):
-        return [_make_uri(of, "xcp_d", dataset_path) for of in out_file]
+        return [_make_uri(of, "", dataset_path) for of in out_file]
     else:
-        return [_make_uri(out_file, "xcp_d", dataset_path)]
+        return [_make_uri(out_file, "", dataset_path)]
 
 
 def _make_xcpd_uri_lol(in_list, output_dir):


Test patch:
diff --git a/xcp_d/tests/test_utils_bids.py b/xcp_d/tests/test_utils_bids.py
index 21089ca..263d1d7 100644
--- a/xcp_d/tests/test_utils_bids.py
+++ b/xcp_d/tests/test_utils_bids.py
@@ -156,11 +156,9 @@ def test_write_dataset_description(datasets, tmp_path_factory, caplog):
         desc = json.load(fo)
 
     assert "'preprocessed' is already a dataset link" not in caplog.text
-    assert "'xcp_d' is already a dataset link" not in caplog.text
     assert "'custom_confounds' is already a dataset link" not in caplog.text
     xbids.write_dataset_description(tmpdir, tmpdir, custom_confounds_folder="/fake/path4")
     assert "'preprocessed' is already a dataset link" in caplog.text
-    assert "'xcp_d' is already a dataset link" in caplog.text
     assert "'custom_confounds' is already a dataset link" in caplog.text
 
     # Now change the version and re-run the function.
@@ -313,10 +311,10 @@ def test_make_xcpd_uri():
     """Test _make_xcpd_uri."""
     out_file = "/path/to/dset/xcp_d/sub-01/func/sub-01_task-rest_bold.nii.gz"
     uri = xbids._make_xcpd_uri(out_file, output_dir="/path/to/dset")
-    assert uri == ["bids:xcp_d:sub-01/func/sub-01_task-rest_bold.nii.gz"]
+    assert uri == ["bids::sub-01/func/sub-01_task-rest_bold.nii.gz"]
 
     xbids._make_xcpd_uri([out_file], output_dir="/path/to/dset")
-    assert uri == ["bids:xcp_d:sub-01/func/sub-01_task-rest_bold.nii.gz"]
+    assert uri == ["bids::sub-01/func/sub-01_task-rest_bold.nii.gz"]
 
 
 def test_make_xcpd_uri_lol():
@@ -336,16 +334,16 @@ def test_make_xcpd_uri_lol():
     uris = xbids._make_xcpd_uri_lol(in_list, output_dir="/path/to/dset/")
     assert uris == [
         [
-            "bids:xcp_d:sub-01/func/sub-01_task-rest_run-1_bold.nii.gz",
-            "bids:xcp_d:sub-01/func/sub-01_task-rest_run-2_bold.nii.gz",
+            "bids::sub-01/func/sub-01_task-rest_run-1_bold.nii.gz",
+            "bids::sub-01/func/sub-01_task-rest_run-2_bold.nii.gz",
         ],
         [
-            "bids:xcp_d:sub-02/func/sub-01_task-rest_run-1_bold.nii.gz",
-            "bids:xcp_d:sub-02/func/sub-01_task-rest_run-2_bold.nii.gz",
+            "bids::sub-02/func/sub-01_task-rest_run-1_bold.nii.gz",
+            "bids::sub-02/func/sub-01_task-rest_run-2_bold.nii.gz",
         ],
         [
-            "bids:xcp_d:sub-03/func/sub-01_task-rest_run-1_bold.nii.gz",
-            "bids:xcp_d:sub-03/func/sub-01_task-rest_run-2_bold.nii.gz",
+            "bids::sub-03/func/sub-01_task-rest_run-1_bold.nii.gz",
+            "bids::sub-03/func/sub-01_task-rest_run-2_bold.nii.gz",
         ],
     ]