MinBZK / ai-validation

In this repository, we document the processes of the AI Validation Team at the Ministry of the Interior and Kingdom Relations (Min BZK) in The Netherlands.
https://minbzk.github.io/ai-validation/
European Union Public License 1.2
10 stars 2 forks source link

Create "Register van Algoritmen" endpoint #261

Open robbertbos opened 2 weeks ago

robbertbos commented 2 weeks ago

For the Digilab Fieldlab, we need to create a (mock) endpoint for a register of algorithms. It is fine to start with a single datablob that represents a single algorithm.

This algorithm should be a ruleset from regels.overheid.nl

The blob could look like this but should contain an ACTUAL ruleset from regels.overheid.nl: (NOTE: this is an example made up, just to give an impression, dataModel and ruleModel will likely change based on discussions with regels.overheid.nl).

{
  "id": "RVA-001",
  "algorithmName": "High Income Tax Calculation",
  "registerLink": "regels.overheid.nl/RVA-001",
  "dataModel": {
    "objectTypes": [
      {
        "name": "Taxpayer",
        "attributes": [
          {
            "name": "annualIncome",
            "dataType": "Numeric"
          },
          {
            "name": "taxAmount",
            "dataType": "Numeric"
          }
        ],
        "characteristics": [
          "isHighIncome"
        ]
      }
    ],
    "parameters": [
      {
        "name": "standardDeduction",
        "dataType": "Numeric"
      },
      {
        "name": "taxRate",
        "dataType": "Percentage"
      }
    ]
  },
  "ruleModel": {
    "ruleGroups": [
      {
        "name": "IncomeTaxCalculation",
        "rules": [
          {
            "name": "HighIncomeCharacteristic",
            "type": "CharacteristicAssignment",
            "validity": {
              "startDate": "2024-01-01",
              "endDate": "2024-12-31"
            },
            "content": {
              "subject": {
                "objectType": "Taxpayer"
              },
              "characteristic": "isHighIncome",
              "condition": {
                "operator": "greaterThan",
                "leftOperand": {
                  "objectType": "Taxpayer",
                  "attribute": "annualIncome"
                },
                "rightOperand": {
                  "value": 100000
                }
              }
            }
          },
          {
            "name": "TaxAmountCalculation",
            "type": "Equality",
            "validity": {
              "startDate": "2024-01-01",
              "endDate": "2024-12-31"
            },
            "content": {
              "leftOperand": {
                "objectType": "Taxpayer",
                "attribute": "taxAmount"
              },
              "rightOperand": {
                "operation": "multiplication",
                "operands": [
                  {
                    "operation": "subtraction",
                    "operands": [
                      {
                        "objectType": "Taxpayer",
                        "attribute": "annualIncome"
                      },
                      {
                        "parameter": "standardDeduction"
                      }
                    ]
                  },
                  {
                    "parameter": "taxRate"
                  }
                ]
              },
              "condition": {
                "subject": {
                  "objectType": "Taxpayer"
                },
                "characteristic": "isHighIncome"
              }
            }
          }
        ]
      }
    ]
  }
}

The url of the blob should be communicated to Digilab (through Anne).

There should be data to fill the top part of this screen: Image

implementation notes

laurensWe commented 1 day ago

Repo made: https://github.com/MinBZK/digilab_fieldlab_algoritme