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

Repeated instances from vocab with metatypes don't serialize properly #27

Open
azaroth42 opened this issue Sep 1, 2021 · 0 comments
Open
Labels
bug Something isn't working

Comments

@azaroth42
Copy link

Thanks to @kasei for finding.

from cromulent import model, vocab
what = model.HumanMadeObject()
what.referred_to_by = vocab.MaterialStatement(content="a")
what.referred_to_by = vocab.MaterialStatement(content="b")
print(model.factory.toString(what, compact=False))

Results in the below, where brief text metatype is not repeated on the second instance.

{
  "@context": "https://linked.art/ns/v1/linked-art.json",
  "id": "http://lod.example.org/museum/HumanMadeObject/0",
  "type": "HumanMadeObject",
  "referred_to_by": [
    {
      "id": "http://lod.example.org/museum/LinguisticObject/0",
      "type": "LinguisticObject",
      "classified_as": [
        {
          "id": "http://vocab.getty.edu/aat/300435429",
          "type": "Type",
          "_label": "Material Statement",
          "classified_as": [
            {
              "id": "http://vocab.getty.edu/aat/300418049",
              "type": "Type",
              "_label": "Brief Text"
            }
          ]
        }
      ],
      "content": "a"
    },
    {
      "id": "http://lod.example.org/museum/LinguisticObject/1",
      "type": "LinguisticObject",
      "classified_as": [
        {
          "id": "http://vocab.getty.edu/aat/300435429",
          "type": "Type",
          "_label": "Material Statement"
        }
      ],
      "content": "b"
    }
  ]
}
@azaroth42 azaroth42 added the bug Something isn't working label Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant