hbz / lobid

Linking Open Bibliographic Data
https://lobid.org/
Eclipse Public License 2.0
16 stars 4 forks source link

Simplify json results: provide always the same data type for fields #136

Closed dr0i closed 7 years ago

dr0i commented 9 years ago

Reported by Werner Greßhoff: Some elements are sometimes delivered as single values, sometimes as arrays. Thus, working on that data, each time such a field is parsed it is necessary to check if it's a single value or an array. Much easier would be to always have one consistent data type ( @dr0i: This would be an array, then). People behind entityfacts are doing it in this customer friendly manner.

fsteeg commented 9 years ago

This could be easily implemented using the compactArrays=false option while compacting our JSON-LD, but this has very broad effects, as all values will then be wrapped in arrays, even for fields that never have multiple values (like issued, or hbzId). This would break API users that process these fields as simple values. I would therefore prefer to switch to that in API 2.0 (https://github.com/hbz/lobid/issues/1).

What do you think, @dr0i @acka47?

acka47 commented 9 years ago

This would break API users that process these fields as simple values. I would therefore prefer to switch to that in API 2.0

+1

dr0i commented 7 years ago

Don't we actually use only arrays?

fsteeg commented 7 years ago

In 1.x we do not, see: http://lobid.org/resource?id=HT000970912&format=full

acka47 commented 7 years ago

As we won't fix this in 1.x, we might as well close the issue.

dr0i commented 7 years ago

Ack. Closing.