Code Monkey home page Code Monkey logo

spdx-3-serialization-prototype-playground's People

Contributors

armintaenzertng avatar davaya avatar goneall avatar jpewdev avatar mrybczyn-test avatar nishakm avatar noriokobota avatar zvr avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spdx-3-serialization-prototype-playground's Issues

Thoughts on Implementation 1

The purpose of the playground is to brainstorm and explore serialization approaches, so any serialization data formats and code are fine - the only requirement is that they must conform to the spdx-3-model, including adapting to the model as PRs are accepted into it.

That is the reason for using camelCase property names, the model (e.g., Element) requires them.

@nishakm: with that in mind, here are some random thoughts on simple_acme.json:

  • CreationInfo is a datatype, not an Element, so it doesn't have an spdxId property. That isn't immediately obvious from the model file; the only way to tell is that datatypes don't have SubclassOf metadata that chains back to Element.
    The playground representation makes it obvious exactly what properties each element and datatype can have.
  "creationInfo": {
    "spdxId": "urn:sbom-acme-timestamp-5cfc33f3-9a0b-436c-8d81-bc8d9ed8ae25",
    "specVersion": "3.0.0",
    "created": "2023-07-28T15:58:20Z",
    "createdBy": [
      "urn:[email protected]",
      "urn:acme.com-4fe40e24-20e3-11ee-be56-0242ac120002"
    ],
    "profile": [
      "CORE",
      "SOFTWARE"
    ],
    "dataLicense": "CC0-1.0",
    "createdUsing": []
  },
  • profile has type ProfileIdentifierType which also uses camelCase names, not CAPITALS. I hadn't noticed that until just now, and need to change my examples from PascalCase to camelCase profiles.
  • Each Element has a type which has to be captured in all serializations somehow. This example has "elements" and "relationships", but the specific types (e.g., Relationship or LifecycleScopedRelationship) have to be expressed in the JSON somewhere. Since this is a playground any way of doing it is an acceptable idea to be considered, but I use a property name (e.g., annotation) to designate each element type (Annotation), and all elements, including relationships, go in a single element property in the payload. Note that the logical model does not define serialization format, so having elements and releationships properties is not wrong, you just need to be able to reconstruct every element type when parsing the payload.

Troubles in implementation 4

Hello, I have troubles using the combination because ProfileIdentifierType class uses capital words such as CORE and SOFTWARE while json uses "core" and "software". Did you change that in spdx-tools ?

Manual translation to jsonld of implementations/4/alpine_compact.json

This is a manual conversion of the json file to its potential jsonld representation. The source was https://github.com/spdx/spdx-3-serialization-prototype-playground/blob/c7e5a3e7f4a09bbf9629aa0786f150e5f8a40aa8/implementations/4/app_compact.py and this was requested by @nishakm .

{
  "@context": [
    "https://spdx.github.io/spdx-3-model/rdf/context.json"
  ],
  "@graph": [
    {
      "@id": "urn:[email protected]",
      "@type": "Person",
      "creationInfo": "_:creationInfo"
    },
    {
      "@id": "urn:relationship-acme-app-8f833b36-20e3-11ee-be56-0242ac120002",
      "@type": "Relationship",
      "creationInfo": "_:creationInfo",
      "relationshipType": "availablefrom",
      "fromElement": "urn:product-acme-application-1.3-8f833b36-20e3-11ee-be56-0242ac120002",
      "to": [
        "urn:[email protected]",
        "urn:acme.com-4fe40e24-20e3-11ee-be56-0242ac120002"
      ]
    },
    {
      "@id": "urn:acme.com-4fe40e24-20e3-11ee-be56-0242ac120002",
      "@type": "Organization",
      "creationInfo": "_:creationInfo"
    },
    {
      "@id": "urn:sbom-acme-application-8f833b36-20e3-11ee-be56-0242ac120002",
      "@type": "SpdxDocument",
      "name": "acme-application",
      "creationInfo": {
        "@id": "_:creationInfo",
        "specVersion": "3.0.0",
        "created": "2023-08-17T15:19:31Z",
        "createdBy": [
          "urn:[email protected]",
          "urn:acme.com-4fe40e24-20e3-11ee-be56-0242ac120002"
        ],
        "profile": [
          "core",
          "software"
        ],
        "dataLicense": "CC0-1.0",
        "createdUsing": [
          "app_compact.py"
        ]
      },
      "element": [
        "urn:product-acme-application-1.3-8f833b36-20e3-11ee-be56-0242ac120002",
        "urn:acme.com-4fe40e24-20e3-11ee-be56-0242ac120002",
        "urn:[email protected]",
        "urn:relationship-acme-app-8f833b36-20e3-11ee-be56-0242ac120002"
      ],
      "rootElement": [
        "urn:product-acme-application-1.3-8f833b36-20e3-11ee-be56-0242ac120002"
      ]
    },
    {
      "@id": "urn:product-acme-application-1.3-8f833b36-20e3-11ee-be56-0242ac120002",
      "@type": "Package",
      "creationInfo": "_:creationInfo",
      "name": "acme-application",
      "packageVersion": "1.3"
    }
  ]
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.