Skip to content

Instantly share code, notes, and snippets.

@sbarnum
sbarnum / spdx3.0-id-prefixes-externalmap-metadata-example.json
Last active September 21, 2021 15:05
SPDX3.0 example showing ids, id prefixes, external map, context metadata serialization in json-ld
This example demonstrates:
- Element identifiers with appropriate structure of namespace+localid (does not presume any particular reserved separating character)
- A mix of new elements defined within a document-centric namespace, elements within other producer-controlled namespace, elements defined external to the document by other producer, etc
- Expression of prefixMap property of Document
- How a given serialization (json-ld in this case) can leverage the prefixMap to define id namespace prefixes
- How those prefixes are applied to Element ids throughout the example
- An external map characterizing all Elements within the Document that were not defined locally within the document
- Context metadata (createdBy, created, specVersion, etc) defined on the document with the serialization-dependent specific implication that this context metadata also applies to the Elements within the Document unless directly overridden with properties on the individual Elements
{
"type": "bundle",
"id": "bundle--5d0092c5-5f74-4287-9642-33f4c354e56d",
"spec_version": "2.1",
"objects": [
{
"type": "observed-data",
"id": "observed-data--b67d30ff-02ac-498a-92f9-32f845f448cf",
"spec_version": "2.1",
"created_by_ref": "identity--f431f809-377b-45e0-aa1c-6a4751cae5ff",
{
"type": "bundle",
"id": "bundle--2849158e-0b4e-4d2b-95c7-b18a20e6707a",
"objects": [
{
"type": "file",
"id": "file--c65cea3e-c75f-45b5-a14b-76777fae78d6",
"spec_version": "2.1",
"created": "2017-07-01T00:00:00.000Z",
"modified": "2017-07-01T00:00:00.000Z",
{
"type": "bundle",
"id": "bundle--2849158e-0b4e-4d2b-95c7-b18a20e6707a",
"objects": [
{
"type": "file",
"id": "file--c65cea3e-c75f-45b5-a14b-76777fae78d6",
"spec_version": "2.1",
"created": "2017-07-01T00:00:00.000Z",
"modified": "2017-07-01T00:00:00.000Z",
{
"type": "bundle",
"id": "bundle--3bac8691-327f-44cf-a3c4-85fd5ef6e1c4",
"objects": [
{
"type": "threat-actor",
"id": "threat-actor--426bd456-efe0-41a2-b557-b95f539b5810",
"spec_version": "2.1",
"created": "2012-01-06T20:03:48.000Z",
"modified": "2012-01-06T20:03:48.000Z",
{
"type": "bundle",
"id": "bundle--c0d239ef-db5e-49e7-9489-1b56dc7e9dbd",
"objects": [
{
"type": "domain-name",
"id": "domain-name--4ece0d5d-307f-4968-8699-3be23f5432a6",
"spec_version": "2.1",
"created": "2012-07-01T00:00:00.000Z",
"modified": "2012-07-01T00:00:00.000Z",
{
"type": "bundle",
"id": "bundle--58b9b4f3-2029-4a2f-86cd-6ce0c0af958a",
"objects": [
{
"type": "ipv4-addr",
"id": "ipv4-addr--51ca21d9-a1b6-4c7e-aa1d-5fbcfba4b6d7",
"spec_version": "2.1",
"created": "2014-01-06T20:30:48.000Z",
"modified": "2014-01-06T20:30:48.000Z",
{
"type": "bundle",
"id": "bundle--25b262b7-20ae-4b91-8c09-34f35482f93b",
"objects": [
{
"type": "threat-actor",
"id": "threat-actor--426bd456-efe0-41a2-b557-b95f539b5810",
"spec_version": "2.1",
"created": "2016-01-06T20:03:48.000Z",
"modified": "2016-01-06T20:03:48.000Z",
{
"type": "bundle",
"id": "bundle--daff0b2b-e428-4689-8cc2-72980dbacda3",
"objects": [
{
"type": "infrastructure",
"id": "infrastructure--02239463-a51f-400d-b25c-0499d729cf92",
"spec_version": "2.1",
"created": "2014-04-06T20:03:50.000Z",
"modified": "2014-04-06T20:03:50.000Z",
{
"type": "bundle",
"id": "bundle--b3c38f0c-c6f9-4ce9-8594-dfbd5c2f9a1b",
"objects": [
{
"type": "threat-actor",
"id": "threat-actor--426bd456-efe0-41a2-b557-b95f539b5810",
"spec_version": "2.1",
"created": "2016-01-06T20:03:48.000Z",
"modified": "2016-01-06T20:03:48.000Z",