esmero / strawberry_runners

A post processing Drupal 8/9 module for Strawberryfield dispatched events
GNU Lesser General Public License v3.0
3 stars 2 forks source link

How to annotate flavours in SBF JSON #1

Open giancarlobi opened 5 years ago

giancarlobi commented 5 years ago

@DiegoPino after our talk, I figure out something like this to annotate flavours into SBF JSON:

DiegoPino commented 5 years ago

@giancarlobi as a discussion point: (means i have no strong opinion yet). maybe we want to have all control/flv elements somewhere more shallow. Like grouped inside some ap: container and simply pointing with an urn: to the actual image. That would allow us to process a list of 1000, e.g, much faster and also get every possible flavor with a single JSON key request. I have to of course think about this more, but would love to read your thoughts about that

giancarlobi commented 5 years ago

@DiegoPino I fully agree, this was a first draft to allow continue with the code. It cuold be a key at the same level than as:image (i.e. ap:flavour) which can include all flavours as single subarray. We have to also think about where we flag the image(or other source) to be processed, the current status key present in each as:image. Something like:

"ap:flavours" : {
  "flv:exif": {
    "urn:uuid:35915592-83c8-40b6-b097-29c51c134cc7": {
      "status": 0,
      "data": {
    "urn:uuid:12345678-83c8-40b6-b097-29c51c134cc7": {
      "status": 0,
      "data": {
  "flv:hocr": {
    "urn:uuid:35915592-83c8-40b6-b097-29c51c134cc7": {
      "status": 0,
      "data": {
    "urn:uuid:12345678-83c8-40b6-b097-29c51c134cc7": {
      "status": 0,
      "data": {

Yes, we have to male a good plan for this.

DiegoPino commented 5 years ago

@giancarlobi i'm ok with your approach for now. I will think a bit about this when doing my first attempts at generalising. One of the problems i foresee with having too deep nested structures for this is when trying to use Twig templates for extracting/displaying data and also possible issues with overlapping write/read processes. But for now we are good. Lets keep track of this, i will open an issue later tonight to talk about this

giancarlobi commented 5 years ago

@DiegoPino as an alternative we can reduce by one level removing ap_flavours and changing flv:hocr and flv_exif to ap:hocr and ap:exif and putting them to same root level than as:image :

"ap:exif": {
    "urn:uuid:35915592-83c8-40b6-b097-29c51c134cc7": {
      "status": 0,
      "data": {
    "urn:uuid:12345678-83c8-40b6-b097-29c51c134cc7": {
      "status": 0,
      "data": {
"ap:hocr": {
    "urn:uuid:35915592-83c8-40b6-b097-29c51c134cc7": {
      "status": 0,
      "data": {
    "urn:uuid:12345678-83c8-40b6-b097-29c51c134cc7": {
      "status": 0,
      "data": {
"as:image": {
      "urn:uuid:35915592-83c8-40b6-b097-29c51c134cc7": {
DiegoPino commented 5 years ago

Hi, for now lets keep it as it is. I have to test how expensive/cheap it is to fetch it from there first, and see also what the best metadata v/s operational data separation is. No worries for now!!