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

Sort elements in JSON #2000

Closed
TobiasNx opened this issue May 17, 2024 · 10 comments
Closed

Sort elements in JSON #2000

TobiasNx opened this issue May 17, 2024 · 10 comments
Assignees

Comments

@TobiasNx
Copy link
Contributor

TobiasNx commented May 17, 2024

The id, type, title elements are not at the top.

For better presentation of the JSON Data
it would be nice to have the metadata in a specific order.

With fix this is not possible yet: metafacture/metafacture-fix#61

e.g.:

http://lobid.org/resources/990208680360206441.json

"@context": "http://lobid.org/resources/context.jsonld",
  "almaMmsId": "990208680360206441",
  "hbzId": "HT018708677",
  "deprecatedUri": "http://lobid.org/resources/HT018708677#!",
  "isbn": [
    "9783898999199",
    "389899919X"
  ],
  "oclcNumber": [
    "912956557"
  ],
  "title": "Ich lerne Ringen",
  "edition": [
    "2., überarb. Aufl"
  ],
  "publication": [
    {
      "startDate": "2015",
      "type": [
        "PublicationEvent"
      ],
      "location": [
        "Aachen"
      ],
      "publishedBy": [
        "Meyer & Meyer"
      ]
    }
  ],

should be something like:

"@context": "http://lobid.org/resources/context.jsonld",
  "id": "http://lobid.org/resources/990208680360206441#!",
  "title": "Ich lerne Ringen",
   "type": [
    "BibliographicResource",
    "Book"
  ],
  "almaMmsId": "990208680360206441",
  "hbzId": "HT018708677",
  "deprecatedUri": "http://lobid.org/resources/HT018708677#!",
  "isbn": [
    "9783898999199",
    "389899919X"
  ],
  "oclcNumber": [
    "912956557"
  ],

  "edition": [
    "2., überarb. Aufl"
  ],
  "publication": [
    {
      "startDate": "2015",
      "type": [
        "PublicationEvent"
      ],
      "location": [
        "Aachen"
      ],
      "publishedBy": [
        "Meyer & Meyer"
      ]
    }
  ],
``
@blackwinter
Copy link
Member

With fix this is not possible yet

It is possible if you emit those fields first. Other than that, no, not yet.

@dr0i dr0i moved this from Backlog to Ready in lobid-resources May 17, 2024
@acka47
Copy link
Contributor

acka47 commented May 17, 2024

Here is what I think should be the top fields:

  • @context
  • id
  • type
  • medium
  • title

@TobiasNx
Copy link
Contributor Author

@dr0i could you help with: #2003 (comment)

dr0i added a commit that referenced this issue May 27, 2024
@dr0i
Copy link
Member

dr0i commented May 27, 2024

@TobiasNx I have done so, please have a look again.

@dr0i dr0i assigned TobiasNx and unassigned dr0i May 27, 2024
@TobiasNx
Copy link
Contributor Author

TobiasNx commented Jun 3, 2024

Here is what I think should be the top fields:

* `@context`

* `id`

* `type`

* `medium`

* `title`

@acka47 could you check out lobid-resources if that meets your demands?
http://lobid.org/resources/990208680360206441.json

@TobiasNx TobiasNx assigned acka47 and dr0i and unassigned TobiasNx and acka47 Jun 3, 2024
@TobiasNx
Copy link
Contributor Author

TobiasNx commented Jun 3, 2024

@acka47 dont review yet. Just saw, that the id is still at the end.
@dr0i could you have a look why id is still at the end: http://lobid.org/resources/990208680360206441.json

your changes in the pr should have fixed this: #2003

Could it be that the productive transformation differs from the tests here?

@TobiasNx TobiasNx moved this from Ready to Review in lobid-resources Jun 3, 2024
dr0i added a commit that referenced this issue Jun 3, 2024
When calling this script it should also build.
This is good for automatic deployment.

Resolves e.g. #2000 (comment).
@dr0i
Copy link
Member

dr0i commented Jun 3, 2024

Good that you have checked this. Automatic deployment didn't work (anymore?). Added 0bbc01b .
Should be deployed next Monday.

@TobiasNx
Copy link
Contributor Author

Here is what I think should be the top fields:

* `@context`

* `id`

* `type`

* `medium`

* `title`

@acka47 could you check out lobid-resources if that meets your demands? http://lobid.org/resources/990208680360206441.json

so now you can review this.

@TobiasNx TobiasNx assigned acka47 and unassigned dr0i Jun 10, 2024
@acka47
Copy link
Contributor

acka47 commented Jun 11, 2024

Yeah, this is a big improvement. Thanks!

@TobiasNx
Copy link
Contributor Author

I you want any additional sorting, just reopen the ticket. For now closing.

@github-project-automation github-project-automation bot moved this from Review to Done in lobid-resources Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

4 participants