schema-sidecar
Theme
Text size
GitHub Menu

Class in Linked Open Knowledge Format (LOKF)

Checksum

A digest of a distribution's bytes, which a consumer recomputes before trusting them. Maps to spdx:Checksum, as DCAT 3 attaches it.

URI: spdx:Checksum

 classDiagram
    class Checksum
    click Checksum href "../../classes/Checksum/"
      Checksum : algorithm
        
          
    
        
        
        Checksum --> "1" ChecksumAlgorithm : algorithm
        click ChecksumAlgorithm href "../../enums/ChecksumAlgorithm/"
    

        
      Checksum : checksum_value
        
      

Class Properties#

PropertyValue
Class URIspdx:Checksum

Slots#

NameCardinality and RangeDescriptionInheritance
algorithm1
ChecksumAlgorithm
The algorithm that computed a checksumdirect
checksum_value1
HexBinary
The checksum as lowercase hexadecimal digits, as many as the algorithm’s dige…direct

Usages#

used byused intypeused
DistributionchecksumrangeChecksum

Rules#

#

Rule AppliedPreconditionsPostconditionsElseconditions
slot_conditions{'algorithm': {'equals_string_in': ['md5']}}{'checksum_value': {'pattern': '^[0-9a-f]{32}$'}}

#

Rule AppliedPreconditionsPostconditionsElseconditions
slot_conditions{'algorithm': {'equals_string_in': ['sha1']}}{'checksum_value': {'pattern': '^[0-9a-f]{40}$'}}

#

Rule AppliedPreconditionsPostconditionsElseconditions
slot_conditions{'algorithm': {'equals_string_in': ['sha224']}}{'checksum_value': {'pattern': '^[0-9a-f]{56}$'}}

#

Rule AppliedPreconditionsPostconditionsElseconditions
slot_conditions{'algorithm': {'equals_string_in': ['sha256', 'sha3_256', 'blake2b256']}}{'checksum_value': {'pattern': '^[0-9a-f]{64}$'}}

#

Rule AppliedPreconditionsPostconditionsElseconditions
slot_conditions{'algorithm': {'equals_string_in': ['sha384', 'sha3_384', 'blake2b384']}}{'checksum_value': {'pattern': '^[0-9a-f]{96}$'}}

#

Rule AppliedPreconditionsPostconditionsElseconditions
slot_conditions{'algorithm': {'equals_string_in': ['sha512', 'sha3_512', 'blake2b512']}}{'checksum_value': {'pattern': '^[0-9a-f]{128}$'}}

Identifier and Mapping Information#

Schema Source#

Mappings#

Mapping TypeMapped Value
selfspdx:Checksum
nativelokf:Checksum

LinkML Source#

Direct#

YAML
name: Checksum
description: A digest of a distribution's bytes, which a consumer recomputes before
  trusting them. Maps to spdx:Checksum, as DCAT 3 attaches it.
from_schema: https://w3id.org/lokf/schema
slots:
- algorithm
- checksum_value
slot_usage:
  algorithm:
    name: algorithm
    required: true
  checksum_value:
    name: checksum_value
    required: true
class_uri: spdx:Checksum
rules:
- preconditions:
    slot_conditions:
      algorithm:
        name: algorithm
        equals_string_in:
        - md5
  postconditions:
    slot_conditions:
      checksum_value:
        name: checksum_value
        pattern: ^[0-9a-f]{32}$
  description: A md5 digest has 32 hex digits.
- preconditions:
    slot_conditions:
      algorithm:
        name: algorithm
        equals_string_in:
        - sha1
  postconditions:
    slot_conditions:
      checksum_value:
        name: checksum_value
        pattern: ^[0-9a-f]{40}$
  description: A sha1 digest has 40 hex digits.
- preconditions:
    slot_conditions:
      algorithm:
        name: algorithm
        equals_string_in:
        - sha224
  postconditions:
    slot_conditions:
      checksum_value:
        name: checksum_value
        pattern: ^[0-9a-f]{56}$
  description: A sha224 digest has 56 hex digits.
- preconditions:
    slot_conditions:
      algorithm:
        name: algorithm
        equals_string_in:
        - sha256
        - sha3_256
        - blake2b256
  postconditions:
    slot_conditions:
      checksum_value:
        name: checksum_value
        pattern: ^[0-9a-f]{64}$
  description: A sha256, sha3_256, blake2b256 digest has 64 hex digits.
- preconditions:
    slot_conditions:
      algorithm:
        name: algorithm
        equals_string_in:
        - sha384
        - sha3_384
        - blake2b384
  postconditions:
    slot_conditions:
      checksum_value:
        name: checksum_value
        pattern: ^[0-9a-f]{96}$
  description: A sha384, sha3_384, blake2b384 digest has 96 hex digits.
- preconditions:
    slot_conditions:
      algorithm:
        name: algorithm
        equals_string_in:
        - sha512
        - sha3_512
        - blake2b512
  postconditions:
    slot_conditions:
      checksum_value:
        name: checksum_value
        pattern: ^[0-9a-f]{128}$
  description: A sha512, sha3_512, blake2b512 digest has 128 hex digits.

Induced#

YAML
name: Checksum
description: A digest of a distribution's bytes, which a consumer recomputes before
  trusting them. Maps to spdx:Checksum, as DCAT 3 attaches it.
from_schema: https://w3id.org/lokf/schema
slot_usage:
  algorithm:
    name: algorithm
    required: true
  checksum_value:
    name: checksum_value
    required: true
attributes:
  algorithm:
    name: algorithm
    description: The algorithm that computed a checksum.
    in_subset:
    - lokf_semantic
    from_schema: https://w3id.org/lokf/schema
    rank: 1000
    slot_uri: spdx:algorithm
    owner: Checksum
    domain_of:
    - Checksum
    range: ChecksumAlgorithm
    required: true
  checksum_value:
    name: checksum_value
    description: 'The checksum as lowercase hexadecimal digits, as many as the algorithm''s
      digest has: 32 (md5), 40 (sha1), 56 (sha224), 64 (the 256-bit digests), 96 (the
      384-bit ones) or 128 (the 512-bit ones).'
    in_subset:
    - lokf_semantic
    from_schema: https://w3id.org/lokf/schema
    rank: 1000
    slot_uri: spdx:checksumValue
    owner: Checksum
    domain_of:
    - Checksum
    range: HexBinary
    required: true
    pattern: ^([0-9a-f]{32}|[0-9a-f]{40}|[0-9a-f]{56}|[0-9a-f]{64}|[0-9a-f]{96}|[0-9a-f]{128})$
class_uri: spdx:Checksum
rules:
- preconditions:
    slot_conditions:
      algorithm:
        name: algorithm
        equals_string_in:
        - md5
  postconditions:
    slot_conditions:
      checksum_value:
        name: checksum_value
        pattern: ^[0-9a-f]{32}$
  description: A md5 digest has 32 hex digits.
- preconditions:
    slot_conditions:
      algorithm:
        name: algorithm
        equals_string_in:
        - sha1
  postconditions:
    slot_conditions:
      checksum_value:
        name: checksum_value
        pattern: ^[0-9a-f]{40}$
  description: A sha1 digest has 40 hex digits.
- preconditions:
    slot_conditions:
      algorithm:
        name: algorithm
        equals_string_in:
        - sha224
  postconditions:
    slot_conditions:
      checksum_value:
        name: checksum_value
        pattern: ^[0-9a-f]{56}$
  description: A sha224 digest has 56 hex digits.
- preconditions:
    slot_conditions:
      algorithm:
        name: algorithm
        equals_string_in:
        - sha256
        - sha3_256
        - blake2b256
  postconditions:
    slot_conditions:
      checksum_value:
        name: checksum_value
        pattern: ^[0-9a-f]{64}$
  description: A sha256, sha3_256, blake2b256 digest has 64 hex digits.
- preconditions:
    slot_conditions:
      algorithm:
        name: algorithm
        equals_string_in:
        - sha384
        - sha3_384
        - blake2b384
  postconditions:
    slot_conditions:
      checksum_value:
        name: checksum_value
        pattern: ^[0-9a-f]{96}$
  description: A sha384, sha3_384, blake2b384 digest has 96 hex digits.
- preconditions:
    slot_conditions:
      algorithm:
        name: algorithm
        equals_string_in:
        - sha512
        - sha3_512
        - blake2b512
  postconditions:
    slot_conditions:
      checksum_value:
        name: checksum_value
        pattern: ^[0-9a-f]{128}$
  description: A sha512, sha3_512, blake2b512 digest has 128 hex digits.