Skip to content

Commit c647306

Browse files
JPEWdevgoneall
authored andcommitted
annexes: getting started: Fix SPDX IDs
The SPDX IDs used in the example are fabricated, but not good examples to follow for users trying understand how to write their own documents. Fix this by using the "https://spdx.org/spdxdocs/" prefix and using a UUID at the end Signed-off-by: Joshua Watt <[email protected]>
1 parent 8f9cf52 commit c647306

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

docs/annexes/getting-started.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ say this is a [Person][Class_Person].
7676
Next, we need to name our object:
7777
```json
7878

79-
"spdxId": "http://spdx.example.com/Person/JoshuaWatt",
79+
"spdxId": "http://spdx.org/spdxdocs/Person/JoshuaWatt-141ec767-40f2-4aad-9658-ac2703f3a7d9",
8080
```
8181

8282
Most objects can have some sort of "ID" property that gives it a name. In the
@@ -96,7 +96,7 @@ are considered to be the same object, and any references to this URI is a
9696
reference to this _specific_ object we are creating.
9797

9898
If you work for a company, own a domain, etc. it is encouraged to use that (or
99-
some subdomain of it) in place of `spdx.example.com`.
99+
some subdomain of it) in place of `spdx.org/spdxdocs`.
100100

101101
In practice, many `spdxId` values will have some sort of hash or random
102102
UUID-like string incorporated to make them unique.
@@ -231,7 +231,7 @@ who (or what) created the elements that are linked to this
231231

232232
```json
233233
"createdBy": [
234-
"http://spdx.example.com/Person/JoshuaWatt"
234+
"http://spdx.org/spdxdocs/Person/JoshuaWatt-141ec767-40f2-4aad-9658-ac2703f3a7d9"
235235
],
236236
```
237237

@@ -271,7 +271,7 @@ do that now:
271271
```json
272272
{
273273
"type": "SpdxDocument",
274-
"spdxId": "http://spdx.example.com/Document1",
274+
"spdxId": "https://spdx.org/spdxdocs/Document1-d078aed9-384d-4a64-87cb-99c79647c8c9",
275275
"creationInfo": "_:creationinfo",
276276
```
277277

@@ -307,7 +307,7 @@ Element) references. Add this now and close our our
307307

308308
```json
309309
"rootElement": [
310-
"http://spdx.example.com/BOM1"
310+
"https://spdx.org/spdxdocs/BOM-e2e955f5-c50e-4a3a-8c69-db152f0f4615"
311311
]
312312
},
313313
```
@@ -365,7 +365,7 @@ Lets define our package:
365365
```json
366366
{
367367
"type": "software_Package",
368-
"spdxId": "http://spdx.example.com/amazing-widget",
368+
"spdxId": "https://spdx.org/spdxdocs/Package-d1db6e61-aebe-4b13-ae73-d0f66018dbe0",
369369
"creationInfo": "_:creationinfo",
370370
```
371371
This should be familiar by now. Note the reuse of our previous
@@ -425,7 +425,7 @@ property:
425425

426426
```json
427427
"originatedBy": [
428-
"http://spdx.example.com/Person/JoshuaWatt"
428+
"http://spdx.org/spdxdocs/Person/JoshuaWatt-141ec767-40f2-4aad-9658-ac2703f3a7d9"
429429
],
430430
```
431431

@@ -472,7 +472,7 @@ Lets get started with our first file, the program executable:
472472
```json
473473
{
474474
"type": "software_File",
475-
"spdxId": "http://spdx.example.com/amazing-widget/main",
475+
"spdxId": "https://spdx.org/spdxdocs/File-8f79956e-4089-4166-9a71-457de77e4846",
476476
"creationInfo": "_:creationinfo",
477477
"name": "/usr/bin/amazing-widget",
478478
"verifiedUsing": [
@@ -484,7 +484,7 @@ Lets get started with our first file, the program executable:
484484
],
485485
"builtTime": "2024-03-05T00:00:00Z",
486486
"originatedBy": [
487-
"http://spdx.example.com/Person/JoshuaWatt"
487+
"http://spdx.org/spdxdocs/Person/JoshuaWatt-141ec767-40f2-4aad-9658-ac2703f3a7d9"
488488
],
489489
```
490490

@@ -527,7 +527,7 @@ program:
527527
```json
528528
{
529529
"type": "software_File",
530-
"spdxId": "http://spdx.example.com/amazing-widget/config",
530+
"spdxId": "https://spdx.org/spdxdocs/File-77808a5c-7a1b-43d1-9fa9-410a309ca9f3",
531531
"creationInfo": "_:creationinfo",
532532
"name": "/etc/amazing-widget.cfg",
533533
"verifiedUsing": [
@@ -539,7 +539,7 @@ program:
539539
],
540540
"builtTime": "2024-03-05T00:00:00Z",
541541
"originatedBy": [
542-
"http://spdx.example.com/Person/JoshuaWatt"
542+
"http://spdx.org/spdxdocs/Person/JoshuaWatt-141ec767-40f2-4aad-9658-ac2703f3a7d9"
543543
],
544544
"software_primaryPurpose": "configuration"
545545
},
@@ -564,7 +564,7 @@ new one:
564564
```json
565565
{
566566
"type": "Relationship",
567-
"spdxId": "http://spdx.example.com/amazing-widet-contains",
567+
"spdxId": "https://spdx.org/spdxdocs/Relationship/contains-6b0b7ce4-a069-406d-9088-9e91f65b79f0",
568568
"creationInfo": "_:creationinfo",
569569
```
570570

@@ -592,10 +592,10 @@ with them: you can think of them as an arrow pointing from their
592592
express this:
593593

594594
```json
595-
"from": "http://spdx.example.com/amazing-widget",
595+
"from": "https://spdx.org/spdxdocs/Package-d1db6e61-aebe-4b13-ae73-d0f66018dbe0",
596596
"to": [
597-
"http://spdx.example.com/amazing-widget/config",
598-
"http://spdx.example.com/amazing-widget/main"
597+
"https://spdx.org/spdxdocs/File-8f79956e-4089-4166-9a71-457de77e4846",
598+
"https://spdx.org/spdxdocs/File-77808a5c-7a1b-43d1-9fa9-410a309ca9f3"
599599
],
600600
```
601601

@@ -631,7 +631,7 @@ This is done by creating a [software_Sbom][Class_software_Sbom] object:
631631
```json
632632
{
633633
"type": "software_Sbom",
634-
"spdxId": "http://spdx.example.com/BOM1",
634+
"spdxId": "https://spdx.org/spdxdocs/BOM-e2e955f5-c50e-4a3a-8c69-db152f0f4615",
635635
"creationInfo": "_:creationinfo",
636636
```
637637

@@ -647,7 +647,7 @@ of the SBOM, which is our [software_Package][Class_software_Package]:
647647

648648
```json
649649
"rootElement": [
650-
"http://spdx.example.com/amazing-widget"
650+
"https://spdx.org/spdxdocs/Package-d1db6e61-aebe-4b13-ae73-d0f66018dbe0"
651651
],
652652
```
653653

@@ -661,8 +661,8 @@ included:
661661

662662
```json
663663
"element": [
664-
"http://spdx.example.com/amazing-widget/main",
665-
"http://spdx.example.com/amazing-widget/config"
664+
"https://spdx.org/spdxdocs/File-8f79956e-4089-4166-9a71-457de77e4846",
665+
"https://spdx.org/spdxdocs/File-77808a5c-7a1b-43d1-9fa9-410a309ca9f3"
666666
],
667667
```
668668

0 commit comments

Comments
 (0)