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

How to annotate flavours in SBF JSON #1

Open
giancarlobi opened this issue Oct 7, 2019 · 5 comments
Open

How to annotate flavours in SBF JSON #1

giancarlobi opened this issue Oct 7, 2019 · 5 comments

Comments

@giancarlobi
Copy link
Contributor

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

  • we need to have fine granularity for each key "as:image" or any other future key to apply flavours to
  • we have to use flavour name into key to make it discoverable
  • we use this code logic:
 * (0) ready, runner executed and STB-JSON updated
 * (1) new, runner to execute
 * (2) update, runner to execute as STB-JSON was updated
 * (3) remove, runner must remove entry related to this flavour

So to mark an image to require "exif" flavour, we write this:

    "as:image": {
        "urn:uuid:35915592-83c8-40b6-b097-29c51c134cc7": {
            "url": "private:\/\/53d\/image-giovane-uomo-del-ballerino-che-indossa-un-salto-russo-piega-del-costume-28730977_3.jpg",
            "name": "giovane-uomo-del-ballerino-che-indossa-un-salto-russo-piega-del-costume-28730977_3.jpg",
            "tags": [],
            "type": "Image",
            "dr:fid": 62,
            "dr:for": "images",
            "dr:uuid": "35915592-83c8-40b6-b097-29c51c134cc7",
            "flv:exif": {
               "status": 1
            },

And after runner update SBF JSON looks like this:

    "as:image": {
        "urn:uuid:35915592-83c8-40b6-b097-29c51c134cc7": {
            "url": "private:\/\/53d\/image-giovane-uomo-del-ballerino-che-indossa-un-salto-russo-piega-del-costume-28730977_3.jpg",
            "name": "giovane-uomo-del-ballerino-che-indossa-un-salto-russo-piega-del-costume-28730977_3.jpg",
            "tags": [],
            "type": "Image",
            "dr:fid": 62,
            "dr:for": "images",
            "dr:uuid": "35915592-83c8-40b6-b097-29c51c134cc7",
            "flv:exif": {
              "status": 0,
              "data": {
                "XP Title": "http:\/\/www.dreamstime.com\/royalty-free-stock-photography-young-dancer-man-wearing-folk-russian-costume-jumping-image28730977",
                "Copyright": "(c) Stepanov | Dreamstime.com (Photographer) - [None] (Editor)",
                "Color Space": "Internal error (unknown value 65535)",
                "Exif Version": "Exif Version 2.1",
                "X-Resolution": "72",
                "Y-Resolution": "72",
                "FlashPixVersion": "FlashPix Version 1.0",
                "Resolution Unit": "Inch",
                "YCbCr Positioning": "Centered"
              }
            },
@DiegoPino
Copy link
Member

@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
Copy link
Contributor Author

@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
Copy link
Member

@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
Copy link
Contributor Author

@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
Copy link
Member

DiegoPino commented Oct 9, 2019 via email

DiegoPino pushed a commit that referenced this issue Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants