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

Annotations creator filter seems to work fine, but imported annotations are ALL assigned the current creator!! #2770

Open
danielweck opened this issue Feb 3, 2025 · 2 comments
Assignees

Comments

@danielweck
Copy link
Member

@panaC this is a follow-up to merged PR #2758

Test file (annotations set) for "Accessible EPUB3":

{
  "@context": "http://www.w3.org/ns/anno.jsonld",
  "id": "urn:uuid:f783b60f-0b19-49d7-9fc7-f4b57b44349d",
  "type": "AnnotationSet",
  "generator": {
    "id": "https://github.com/edrlab/thorium-reader/releases/tag/v3.1.0-alpha.1",
    "type": "Software",
    "name": "Thorium 3.1.0-alpha.1",
    "homepage": "https://thorium.edrlab.org"
  },
  "generated": "2025-01-31T12:44:36.954Z",
  "title": "creator tests",
  "about": {
    "dc:identifier": [
      "urn:thorium:99dab91b-1977-4301-a5f4-5c3283a0a9f7",
      "urn:isbn:9781449328030"
    ],
    "dc:format": "application/epub+zip",
    "dc:title": "Accessible EPUB 3",
    "dc:publisher": [
      "O’Reilly Media, Inc."
    ],
    "dc:creator": [
      "Matt Garrish"
    ],
    "dc:date": "2012-02-20T00:00:00.000Z"
  },
  "items": [
    {
      "@context": "http://www.w3.org/ns/anno.jsonld",
      "id": "urn:uuid:438e7b75-3c65-47cf-9f6c-3e0c625a47a7",
      "created": "2025-01-31T12:42:32.687Z",
      "type": "Annotation",
      "body": {
        "type": "TextualBody",
        "value": "",
        "format": "text/plain",
        "color": "#FEF3BD",
        "tag": "",
        "highlight": "underline"
      },
      "creator": {
        "id": "urn:uuid:395b3760-e3c6-4ea5-b9c5-35dae31e0d19",
        "type": "Person",
        "name": "daniel weck"
      },
      "target": {
        "source": "EPUB/index.xhtml",
        "meta": {
          "headings": [
            {
              "txt": "Accessible EPUB 3",
              "level": 1
            }
          ],
          "page": ""
        },
        "selector": [
          {
            "type": "CssSelector",
            "value": "#id2602563 > p:nth-child(1)",
            "refinedBy": {
              "type": "TextPositionSelector",
              "start": 115,
              "end": 120
            }
          },
          {
            "type": "TextPositionSelector",
            "start": 635,
            "end": 640
          },
          {
            "type": "TextQuoteSelector",
            "exact": "Media",
            "prefix": "registered trademarks of O’Reilly ",
            "suffix": ", Inc.\n\t\t\t\t\t\t\t\t\tAccessible"
          },
          {
            "type": "ProgressionSelector",
            "value": 0.4482806543837357
          }
        ]
      }
    },
    {
      "@context": "http://www.w3.org/ns/anno.jsonld",
      "id": "urn:uuid:5d67dcc9-6cd6-487e-bb32-c96e40f252a0",
      "created": "2025-01-29T20:23:23.274Z",
      "type": "Annotation",
      "body": {
        "type": "TextualBody",
        "value": "test4",
        "format": "text/plain",
        "color": "#FEF3BD",
        "tag": "creator",
        "highlight": "strikethrough"
      },
      "creator": {
        "id": "urn:uuid:395b3760-e3c6-4ea5-b9c5-35dae31e0d19",
        "type": "Organization",
        "name": ""
      },
      "target": {
        "source": "EPUB/index.xhtml",
        "meta": {
          "headings": [],
          "page": ""
        },
        "selector": [
          {
            "type": "CssSelector",
            "value": "#id2602563 > p:nth-child(2)",
            "refinedBy": {
              "type": "TextPositionSelector",
              "start": 227,
              "end": 234
            }
          },
          {
            "type": "TextPositionSelector",
            "start": 986,
            "end": 993
          },
          {
            "type": "TextQuoteSelector",
            "exact": "rademar",
            "prefix": "a t",
            "suffix": "k claim,"
          },
          {
            "type": "ProgressionSelector",
            "value": 0.5571244266055045
          }
        ]
      }
    },
    {
      "@context": "http://www.w3.org/ns/anno.jsonld",
      "id": "urn:uuid:c780ae65-c96f-47ad-b108-e21e86bc6079",
      "created": "2025-01-31T12:06:46.997Z",
      "type": "Annotation",
      "body": {
        "type": "TextualBody",
        "value": "",
        "format": "text/plain",
        "color": "#D4C4FB",
        "tag": "creator",
        "highlight": "strikethrough"
      },
      "creator": {
        "id": "urn:uuid:395b3760-e3c6-4ea5-b9c5-35dae31e0d19",
        "type": "Person",
        "name": "daniel weck"
      },
      "target": {
        "source": "EPUB/index.xhtml",
        "meta": {
          "headings": [],
          "page": ""
        },
        "selector": [
          {
            "type": "CssSelector",
            "value": "#id2602563 > p:nth-child(2)",
            "refinedBy": {
              "type": "TextPositionSelector",
              "start": 101,
              "end": 108
            }
          },
          {
            "type": "TextPositionSelector",
            "start": 860,
            "end": 867
          },
          {
            "type": "TextQuoteSelector",
            "exact": "claimed",
            "prefix": "",
            "suffix": ""
          },
          {
            "type": "ProgressionSelector",
            "value": 0.5401346092757306
          }
        ]
      }
    },
    {
      "@context": "http://www.w3.org/ns/anno.jsonld",
      "id": "urn:uuid:f6d61ee6-dab0-466d-b346-f4785c9e9ef2",
      "created": "2025-01-29T20:22:56.067Z",
      "type": "Annotation",
      "body": {
        "type": "TextualBody",
        "value": "test3",
        "format": "text/plain",
        "color": "#D4C4FB",
        "tag": "thorium_annotations_set",
        "highlight": "outline"
      },
      "creator": {
        "id": "urn:uuid:395b3760-e3c6-4ea5-b9c5-35dae31e0d19",
        "type": "Organization",
        "name": ""
      },
      "target": {
        "source": "EPUB/index.xhtml",
        "meta": {
          "headings": [],
          "page": ""
        },
        "selector": [
          {
            "type": "CssSelector",
            "value": "#I_book_d1e1",
            "refinedBy": {
              "type": "TextPositionSelector",
              "start": 1356,
              "end": 1431
            }
          },
          {
            "type": "TextPositionSelector",
            "start": 1359,
            "end": 1434
          },
          {
            "type": "TextQuoteSelector",
            "exact": "O’Reilly Media, Inc. 1005 Gravenstein Highway North Sebastopol CA 95472\n\t\t\t",
            "prefix": "",
            "suffix": ""
          },
          {
            "type": "ProgressionSelector",
            "value": 0.7799393840104849
          }
        ]
      }
    },
    {
      "@context": "http://www.w3.org/ns/anno.jsonld",
      "id": "urn:uuid:437b65f3-e5c6-4b09-a776-cd6625ebdf53",
      "created": "2025-01-29T20:22:35.483Z",
      "type": "Annotation",
      "body": {
        "type": "TextualBody",
        "value": "test2",
        "format": "text/plain",
        "color": "#C1EAC5",
        "tag": "myannotationsset",
        "highlight": "underline"
      },
      "creator": {
        "id": "urn:uuid:395b3760-e3c6-4ea5-b9c5-35dae31e0d19",
        "type": "Organization",
        "name": ""
      },
      "target": {
        "source": "EPUB/index.xhtml",
        "meta": {
          "headings": [],
          "page": ""
        },
        "selector": [
          {
            "type": "CssSelector",
            "value": "#I_book_d1e1",
            "refinedBy": {
              "type": "TextPositionSelector",
              "start": 492,
              "end": 518
            }
          },
          {
            "type": "TextPositionSelector",
            "start": 495,
            "end": 521
          },
          {
            "type": "TextQuoteSelector",
            "exact": ".\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tN",
            "prefix": "corporate@oreilly.com",
            "suffix": "utshell"
          },
          {
            "type": "ProgressionSelector",
            "value": 0.46238122542595017
          }
        ]
      }
    },
    {
      "@context": "http://www.w3.org/ns/anno.jsonld",
      "id": "urn:uuid:6d09e2df-0e09-4891-b6fe-1a93a19ca542",
      "created": "2025-01-31T12:20:04.938Z",
      "type": "Annotation",
      "body": {
        "type": "TextualBody",
        "value": "",
        "format": "text/plain",
        "color": "#FEF3BD",
        "tag": "date",
        "highlight": "solid"
      },
      "creator": {
        "id": "urn:uuid:395b3760-e3c6-4ea5-b9c5-35dae31e0d19",
        "type": "Person",
        "name": "daniel weck"
      },
      "target": {
        "source": "EPUB/index.xhtml",
        "meta": {
          "headings": [],
          "page": ""
        },
        "selector": [
          {
            "type": "CssSelector",
            "value": "#id2600629 > p",
            "refinedBy": {
              "type": "TextPositionSelector",
              "start": 12,
              "end": 22
            }
          },
          {
            "type": "TextPositionSelector",
            "start": 1105,
            "end": 1115
          },
          {
            "type": "TextQuoteSelector",
            "exact": "precaution",
            "prefix": "",
            "suffix": ""
          },
          {
            "type": "ProgressionSelector",
            "value": 0.6604888024142312
          }
        ]
      }
    },
    {
      "@context": "http://www.w3.org/ns/anno.jsonld",
      "id": "urn:uuid:77f8a6d3-f236-4368-83a6-d0d89ed488ab",
      "created": "2025-01-29T20:37:28.997Z",
      "type": "Annotation",
      "body": {
        "type": "TextualBody",
        "value": "",
        "format": "text/plain",
        "color": "#C1EAC5",
        "tag": "new",
        "highlight": "underline"
      },
      "creator": {
        "id": "urn:uuid:395b3760-e3c6-4ea5-b9c5-35dae31e0d19",
        "type": "Organization",
        "name": ""
      },
      "target": {
        "source": "EPUB/index.xhtml",
        "meta": {
          "headings": [],
          "page": ""
        },
        "selector": [
          {
            "type": "CssSelector",
            "value": "#I_book_d1e1",
            "refinedBy": {
              "type": "TextPositionSelector",
              "start": 20,
              "end": 328
            }
          },
          {
            "type": "TextPositionSelector",
            "start": 23,
            "end": 331
          },
          {
            "type": "TextQuoteSelector",
            "exact": "3\n\t\t\tMatt Garrish\n\t\t\t\n\t\t\t\tEditor\n\t\t\t\tBrian Sawyer\n\t\t\t\n\t\t\t\n\t\t\t\tEditor\n\t\t\t\tDan Fauxsmith\n\t\t\t\n\t\t\t\n\t\t\t\tCopyright © 2012 O’Reilly Media, Inc\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tO’Reilly books may be purchased for\n\t\t\t\t\t\t\t\teducational, business, or sales promotional use. Online editions are\n\t\t\t\t\t\t\t\talso available for most titles (h",
            "prefix": "",
            "suffix": "ttp://my.safaribooksonline.com)."
          },
          {
            "type": "ProgressionSelector",
            "value": 0.3689486402359109
          }
        ]
      }
    },
    {
      "@context": "http://www.w3.org/ns/anno.jsonld",
      "id": "urn:uuid:d81e21a5-8128-4e6c-8f2f-6d9c2b8167f1",
      "created": "2025-01-29T20:22:13.499Z",
      "type": "Annotation",
      "body": {
        "type": "TextualBody",
        "value": "test1",
        "format": "text/plain",
        "color": "#EB9694",
        "tag": "daniel",
        "highlight": "solid"
      },
      "creator": {
        "id": "urn:uuid:395b3760-e3c6-4ea5-b9c5-35dae31e0d19",
        "type": "Organization",
        "name": ""
      },
      "target": {
        "source": "EPUB/index.xhtml",
        "meta": {
          "headings": [],
          "page": ""
        },
        "selector": [
          {
            "type": "CssSelector",
            "value": ".copyright",
            "refinedBy": {
              "type": "TextPositionSelector",
              "start": 9,
              "end": 17
            }
          },
          {
            "type": "TextPositionSelector",
            "start": 131,
            "end": 139
          },
          {
            "type": "TextQuoteSelector",
            "exact": " © 2012 ",
            "prefix": "Copyright",
            "suffix": "O’Reilly"
          },
          {
            "type": "ProgressionSelector",
            "value": 0.30229153014416776
          }
        ]
      }
    }
  ]
}
@danielweck
Copy link
Member Author

My guess is that the creator id in my Thorium installation is always "urn:uuid:395b3760-e3c6-4ea5-b9c5-35dae31e0d19", but over time I changed my name and type multiple times:

Current:

      "creator": {
        "id": "urn:uuid:395b3760-e3c6-4ea5-b9c5-35dae31e0d19",
        "type": "Organization",
        "name": "zzzz"
      },

Past (see the annotation set JSON file above):

      "creator": {
        "id": "urn:uuid:395b3760-e3c6-4ea5-b9c5-35dae31e0d19",
        "type": "Organization",
        "name": ""
      },
      "creator": {
        "id": "urn:uuid:395b3760-e3c6-4ea5-b9c5-35dae31e0d19",
        "type": "Person",
        "name": "daniel weck"
      },

@danielweck
Copy link
Member Author

danielweck commented Feb 3, 2025

...so, I think that the id UUID must be invalidated whenever the name or type is edited or deleted, otherwise importing previous annotations created from the same Thorium installation but with a different name (person or organisation) causes all imported annotations to gain the incorrect tuple because of identical URN:UUID

solution: generate new UUID whenever user decides to change/remove creator name (or change Person vs. Organisation)

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