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

Fix: Add default serialization attributes for agents #190

Merged

Conversation

muhammedBkf
Copy link

Added default serialization attributes for Agents model to show the creator only if the display parameter is put to all.

  • get /agents
[
  {
    "name": "TEST",
    "agentType": "person",
    "acronym": null,
    "email": null,
    "homepage": null,
    "identifiers": [
      {
        "notation": "0000-0002-3452-553X",
        "schemaAgency": "ORCID"
      }
    ],
    "affiliations": [],
    "@id": "http://0.0.0.0:9393/Agents/e8f7ea40-cae2-013d-4f89-0242ac130007",
    "@type": "http://xmlns.com/foaf/0.1/Agent",
    "@context": {
      "@vocab": "http://data.bioontology.org/metadata/",
      "agentType": "http://data.bioontology.org/metadata/agentType",
      "name": "http://xmlns.com/foaf/0.1/name",
      "homepage": "http://xmlns.com/foaf/0.1/homepage",
      "acronym": "http://www.w3.org/2004/02/skos/core#altLabel",
      "email": "http://xmlns.com/foaf/0.1/mbox",
      "identifiers": "http://www.w3.org/ns/adms#identifier",
      "affiliations": "http://www.w3.org/ns/org#memberOf",
      "@language": "en"
    }
  }
]
  • get /agents?display=all
[
  {
    "id": "http://0.0.0.0:9393/Agents/e8f7ea40-cae2-013d-4f89-0242ac130007",
    "name": "TEST",
    "identifiers": [
      {
        "notation": "0000-0002-3452-553X",
        "schemaAgency": "ORCID"
      }
    ],
    "creator": "http://0.0.0.0:9393/users/admin",
    "agentType": "person",
    "homepage": null,
    "acronym": null,
    "email": null,
    "affiliations": [],
    "usages": {},
    "@id": "http://0.0.0.0:9393/Agents/e8f7ea40-cae2-013d-4f89-0242ac130007",
    "@type": "http://xmlns.com/foaf/0.1/Agent",
    "@context": {
      "@vocab": "http://data.bioontology.org/metadata/",
      "agentType": "http://data.bioontology.org/metadata/agentType",
      "name": "http://xmlns.com/foaf/0.1/name",
      "homepage": "http://xmlns.com/foaf/0.1/homepage",
      "acronym": "http://www.w3.org/2004/02/skos/core#altLabel",
      "email": "http://xmlns.com/foaf/0.1/mbox",
      "identifiers": "http://www.w3.org/ns/adms#identifier",
      "affiliations": "http://www.w3.org/ns/org#memberOf",
      "creator": {
        "@id": "http://data.bioontology.org/metadata/User",
        "@type": "@id"
      },
      "@language": "en"
    }
  }
]

@syphax-bouazzouni syphax-bouazzouni merged commit bc64d90 into ontoportal-lirmm:development Feb 12, 2025
4 checks passed
@syphax-bouazzouni
Copy link

syphax-bouazzouni commented Feb 14, 2025

This change made the API tests fail https://github.com/ontoportal-lirmm/ontologies_api/actions/runs/13321974181/job/37208138514?pr=119
as we expect to have the id and affiliations by default as serialized by default, this change breaks also the UI agents features as they expect to the id and affiliations.
I reverted this change here #193.

@muhammedBkf you can open it again, and the required changes in the API and UI, so that we can merge them all in the same time.

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

Successfully merging this pull request may close these issues.

2 participants