Skip to content

Class: ExampleCode

A structured code snippet within a demonstrative example (StructuredCodeType in XSD).

URI: cwe:ExampleCode

 classDiagram
    class ExampleCode
    click ExampleCode href "../ExampleCode/"
      ExampleCode : content

      ExampleCode : language





        ExampleCode --> "0..1" ProgrammingLanguage : language
        click ProgrammingLanguage href "../ProgrammingLanguage/"



      ExampleCode : nature





        ExampleCode --> "1" CodeNature : nature
        click CodeNature href "../CodeNature/"



Slots

Name Cardinality and Range Description Inheritance
nature 1
CodeNature
Nature of the code (Bad, Good, Attack, Mitigation, etc direct
language 0..1
ProgrammingLanguage
Programming language used in this code example direct
content 0..1
String
Text content of the code snippet direct

Usages

used by used in type used
DemonstrativeExample example_codes range ExampleCode

Identifier and Mapping Information

Schema Source

Mappings

Mapping Type Mapped Value
self cwe:ExampleCode
native cwe:ExampleCode

LinkML Source

Direct

name: ExampleCode
description: A structured code snippet within a demonstrative example (StructuredCodeType
  in XSD).
from_schema: https://w3id.org/lmodel/cwe
slots:
- nature
- language
- content
slot_usage:
  nature:
    name: nature
    description: Nature of the code (Bad, Good, Attack, Mitigation, etc.).
    range: CodeNature
    required: true
  language:
    name: language
    description: Programming language used in this code example.
  content:
    name: content
    description: Text content of the code snippet.

Induced

name: ExampleCode
description: A structured code snippet within a demonstrative example (StructuredCodeType
  in XSD).
from_schema: https://w3id.org/lmodel/cwe
slot_usage:
  nature:
    name: nature
    description: Nature of the code (Bad, Good, Attack, Mitigation, etc.).
    range: CodeNature
    required: true
  language:
    name: language
    description: Programming language used in this code example.
  content:
    name: content
    description: Text content of the code snippet.
attributes:
  nature:
    name: nature
    description: Nature of the code (Bad, Good, Attack, Mitigation, etc.).
    from_schema: https://w3id.org/lmodel/cwe
    rank: 1000
    slot_uri: skos:related
    alias: nature
    owner: ExampleCode
    domain_of:
    - RelatedWeakness
    - ExampleCode
    range: CodeNature
    required: true
  language:
    name: language
    description: Programming language used in this code example.
    from_schema: https://w3id.org/lmodel/cwe
    rank: 1000
    alias: language
    owner: ExampleCode
    domain_of:
    - ExampleCode
    range: ProgrammingLanguage
  content:
    name: content
    description: Text content of the code snippet.
    from_schema: https://w3id.org/lmodel/cwe
    rank: 1000
    alias: content
    owner: ExampleCode
    domain_of:
    - ExampleCode
    - Note
    range: string