Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reimplement NetJsonEdgeSerializer and NetJsonNodeSerializer #847

Closed
b1rger opened this issue May 15, 2024 · 4 comments
Closed

Reimplement NetJsonEdgeSerializer and NetJsonNodeSerializer #847

b1rger opened this issue May 15, 2024 · 4 comments
Assignees

Comments

@b1rger
Copy link
Contributor

b1rger commented May 15, 2024

talk to frontend what exactly they need for the visualisation

@b1rger
Copy link
Contributor Author

b1rger commented Sep 4, 2024

@sennierer @stefanprobst IIRC you discussed this, maybe you can post your findings here so someone can implement this

@stefanprobst
Copy link

i think we agreed to return a list of edges:

{
  "count": 100
  "limit": 10,
  "offset": 0,
  "edges": [
    { 
      "id": "edge-1",
      "source": { "id": "node-1", "label": "The first node", "type": "person" },
      "target": { "id": "node-2", "label": "The second node", "type": "person" },
      "type": { "id": "relation-type-1", "label": "is related to" },
      "properties": {}
    },
    // ...
  ]
}

@sennierer we have not talked about properties but this could be useful for start/end date or similar which may not exist in all datasets

@b1rger b1rger self-assigned this Sep 5, 2024
@b1rger
Copy link
Contributor Author

b1rger commented Sep 5, 2024

Oke, so the default, once #1124 is merged, would be this:

{
  "count": 11,
  "next": "http://localhost:8000/api/relations.relation/?format=json&limit=5&offset=5",
  "previous": null,
  "results": [
    {
      "url": "http://localhost:8000/api/sample_project.issiblingof/1/?format=json",
      "label": "Mustrum Ridcully is sibling of Hughnon Ridcully",
      "content_type_key": "sample_project.issiblingof",
      "content_type_name": "is sibling of",
      "subj": {
        "url": "http://localhost:8000/api/sample_project.person/2/?format=json",
        "label": "Mustrum Ridcully",
        "content_type_key": "sample_project.person",
        "content_type_name": "person"
      },
      "obj": {
        "url": "http://localhost:8000/api/sample_project.person/3/?format=json",
        "label": "Hughnon Ridcully",
        "content_type_key": "sample_project.person",
        "content_type_name": "person"
      }
    },
    {
      "url": "http://localhost:8000/api/sample_project.iscousinof/2/?format=json",
      "label": "Galder Weatherwax is cousin of Esmerelda Weatherwax",
      "content_type_key": "sample_project.iscousinof",
      "content_type_name": "is cousin of",
      "subj": {
        "url": "http://localhost:8000/api/sample_project.person/6/?format=json",
        "label": "Galder Weatherwax",
        "content_type_key": "sample_project.person",
        "content_type_name": "person"
      },
      "obj": {
        "url": "http://localhost:8000/api/sample_project.person/9/?format=json",
        "label": "Esmerelda Weatherwax",
        "content_type_key": "sample_project.person",
        "content_type_name": "person"
      }
    },
    // ...
  ]
}

which is very similar

@b1rger
Copy link
Contributor Author

b1rger commented Sep 9, 2024

#1124 has no been merged an released in v0.25.0, so I'm closing this

@b1rger b1rger closed this as completed Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants