Skip to content

Commit

Permalink
Merge pull request #406 from armintaenzertng/more_json-ld_examples
Browse files Browse the repository at this point in the history
Consolidate the JSON-LD format
  • Loading branch information
zvr authored Jul 5, 2023
2 parents 37ca9f5 + 39360b2 commit 5003212
Show file tree
Hide file tree
Showing 22 changed files with 932 additions and 185 deletions.
30 changes: 30 additions & 0 deletions serialization/json_ld/EXAMPLES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
### Agents
- [Agent1](examples/agent1.json)
- [Person1 with minimal CreationInfo](examples/person1.json)
- [Person2 with full CreationInfo](examples/person2.json))
- [Person3 with no CreationInfo](examples/person3.json) - does this even mean anything?
- [Organization1](examples/org1.json)
- [Tool1](examples/tool1.json) - not an Agent

### Annotations
- [Annotation1](examples/annotation1.json)

### Artifacts
- [Package1](examples/package1.json)
- [File1](examples/file1.json)

### Relationships
- [Relationship1 with Package contains two Files](examples/spdx_document3.json)

### Collections
- [Sbom1 with two Files](examples/sbom1.json)

### Documents
- [SpdxDocument1 with two Files](examples/spdx_document1.json)
- [SpdxDocument2 with two Files](examples/spdx_document2.json) - all in the same payload
- [SpdxDocument3 with a Package that contains two Files](examples/spdx_document3.json) - all in the same payload
- [SpdxDocument4](examples/spdx_document4.json) - same as SpdxDocument3 but using the context to shorten URIs

### Full examples
- [converted SPDX document from SPDX-2.3](examples/converted_from_spdx_2.json) - converted from [this file](https://github.com/spdx/spdx-spec/blob/development/v2.3.1/examples/SPDXJSONExample-v2.3.spdx.json)

21 changes: 21 additions & 0 deletions serialization/json_ld/examples/agent1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"@context": "https://spdx.github.io/spdx-3-model/rdf/context.json",
"type": "Agent",
"spdxId": "https://some.namespace#agent1",
"creationInfo": {
"type": "CreationInfo",
"specVersion": "3.0.0",
"created": "2022-12-01T00:00:00",
"createdBy": ["https://spdx.dev/elements/3F26391C#spdx-dev"],
"profile": ["core"],
"dataLicense": "https://spdx.org/licenses/CC0-1.0"
},
"name": "John Smith",
"externalIdentifier": [
{
"type": "ExternalIdentifier",
"externalIdentifierType": "email",
"identifier": "[email protected]"
}
]
}
18 changes: 18 additions & 0 deletions serialization/json_ld/examples/annotation1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"@context": "https://spdx.github.io/spdx-3-model/rdf/context.json",
"type": "Annotation",
"spdxId": "http://spdx.acme.org/3FA9CB25#annotation34",
"creationInfo": {
"type": "CreationInfo",
"specVersion": "3.0.0",
"created": "2022-12-01T00:00:00",
"createdBy": ["https://spdx.dev/elements/3F26391C#spdx-dev"],
"profile": ["core"],
"dataLicense": "https://spdx.org/licenses/CC0-1.0"
},
"name": "Acme Corp. Super SBOM-o-lator",
"annotationType": "review",
"subject": "http://spdx.acme.org/3FA9CB25#person9",
"contentType": "text/plain",
"statement": "Keanu Reeves is back as cyberpunk icon Neo but fans of the original will find this cynical reboot a bitter pill to swallow."
}
Loading

0 comments on commit 5003212

Please sign in to comment.