Skip to content

JSON import routine - #243

Open
j-i-l wants to merge 39 commits into
mainfrom
json_import
Open

j-i-l wants to merge 39 commits into
mainfrom
json_import

Conversation

@j-i-l

@j-i-l j-i-l commented Mar 29, 2026

Copy link
Copy Markdown
Member

No description provided.

@j-i-l j-i-l self-assigned this Mar 29, 2026
@j-i-l j-i-l added enhancement New feature or request CRAN::check labels Mar 29, 2026
@j-i-l j-i-l mentioned this pull request Apr 19, 2026
@j-i-l

j-i-l commented Apr 21, 2026

Copy link
Copy Markdown
Member Author

ok, now we're talking. finally some errors to fix.

@j-i-l

j-i-l commented Aug 19, 2026

Copy link
Copy Markdown
Member Author

We should focus on generating a genuine JSON format, not one that is tailor-made and uniquely usable for fitAbn objects.
Ideally the format should allow to add extra data, such that a fitAbn object, in fact, can be represented in such a JSON structure.
we might want to use some genuine keys, like 'variables', 'parameters', 'arc', etc. and but abn specific properties inside a metadata' key with a specific namespace, e.g. abn`.

@j-i-l

j-i-l commented Aug 19, 2026

Copy link
Copy Markdown
Member Author

we go for a structure like so:

{
  "metadata": {
    "schema_version": "bayesian-network-v1",
    "issuer": "abn::export_abnFit",
    "issuer_version": "3.1.13",
    "configs": {},
    "extensions": {}
  },
  "variables": [
    {"id": "height", "name": "height", "type": "continuous"},
    {
      "id": "status", "name": "status", "type": "binary",
      "states": [{"id": "no", "label": "no"},
                  {"id": "yes", "label": "yes"}]
    }
  ],
  "arcs": [{"source": "height", "target": "status"}],
  "parameters": [
    {
      "id": "status-intercept",
      "target": "status",
      "kind": "intercept",
      "link": "logit",
      "value": -0.42
    },
    {
      "id": "status-height",
      "target": "status",
      "parents": ["height"],
      "kind": "coefficient",
      "link": "logit",
      "value": 0.87
    }
  ],
  "inference": {
    "type": "bayesian",
    "estimates": {},
    "uncertainty": {},
    "diagnostics": {}
  }

See the vignette for a detailed description of the format: https://github.com/furrer-lab/abn/blob/b761c986354ed0ffff79e8a6b1436f0473cdc619/vignettes/json-format.Rmd

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CRAN::failed enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant