hbz / lobid-resources

Transformation, web frontend, and API for the hbz catalog as LOD
http://lobid.org/resources
Eclipse Public License 2.0
7 stars 7 forks source link

Sort elements in JSON #2000

Closed TobiasNx closed 2 weeks ago

TobiasNx commented 1 month ago

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: https://github.com/metafacture/metafacture-fix/issues/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 commented 1 month ago

With fix this is not possible yet

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

acka47 commented 1 month ago

Here is what I think should be the top fields:

TobiasNx commented 1 month ago

@dr0i could you help with: https://github.com/hbz/lobid-resources/pull/2003#issuecomment-2122492604

dr0i commented 1 month ago

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

TobiasNx commented 4 weeks ago

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 commented 4 weeks ago

@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: https://github.com/hbz/lobid-resources/pull/2003

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

dr0i commented 4 weeks ago

Good that you have checked this. Automatic deployment didn't work (anymore?). Added https://github.com/hbz/lobid-resources/commit/0bbc01ba1d02bd0be11c644888ea7bf64398d203 . Should be deployed next Monday.

TobiasNx commented 3 weeks ago

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.

acka47 commented 2 weeks ago

Yeah, this is a big improvement. Thanks!

TobiasNx commented 2 weeks ago

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