Expansion drops Annotations that carry multiple bodies
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- javascript
Hướng nghiên cứu
Bắt đầu với controllers/crud.js và assertionsFrom(), sau đó kiểm tra expand() và findLeafAnnotationsFor() trong controllers/gog.js, cùng với việc xử lý response Annotations-Merged. Xác định cách xử lý body của array và body của object có nhiều key, đồng thời đảm bảo expansion và số lượng merge khớp nhau; payload không nêu test path nào, vì vậy việc hoàn tất cần bao gồm coverage cho hành vi được mô tả.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Split out of the static review of #286 so it does not block that PR.
What happens now
assertionsFrom() in controllers/crud.js returns early on an Array body:
if (!body || typeof body !== "object" || Array.isArray(body)) return assertions
An Annotation carrying multiple bodies is still gathered by findLeafAnnotationsFor() and still counted in the Annotations-Merged response header, but contributes nothing to the expanded entity. From the client's side that reads as a nonzero merge count with no merged data.
expand() in controllers/gog.js now skips them explicitly too (added in #286 — previously a one element Array body merged onto the entity under the key "0").
Why it matters
The W3C model explicitly allows multiple bodies, and each element is usually an ordinary single-key assertion rather than a structural construct. Real examples already in annotationStore.alpha:
[{"contributor":{"label":"Dunbar, Paul Laurence","id":"http://viaf.org/viaf/76335432"}},
{"issued":"1895-04-17"},
{"identifier":"Box 1, F1"},
{"uri":"https://udspace.udel.edu/handle/..."}]
Current impact: none
Measured against production at the time of the #286 review:
- 911 leaf Annotations have an Array
body - 0 of them target a
rerum.io/v1/id/URI under any of the six keys inTARGET_KEYS
Since /v1/id/:_id/expanded only expands RERUM-stored entities, nothing reachable through the endpoint is affected today. This is a gap that surfaces the first time an app writes a multi-body Annotation onto a RERUM entity.
Possible approach
Each element is typically itself a single assertion, so the existing logic handles them if it recurses:
if (Array.isArray(body)) {
for (const one of body) assertions.push(...assertionsFrom({ body: one }))
return assertions
}
Worth deciding at the same time:
- whether
Annotations-Mergedshould count Annotations gathered or Annotations that actually contributed an assertion - whether
controllers/gog.jsexpand()should follow, or stay on single-body-only for its DEER-shapedvalueObjectwrapping
Related
Multi-key object bodies (not Arrays) are also dropped whole rather than partially, by the keys.length !== 1 check. Only 1 such document exists in production, so it was not worth acting on separately, but it is the same design question.
Reference
- W3C Web Annotation Data Model, multiple bodies: https://www.w3.org/TR/annotation-model/#multiple-bodies
- Ngôn ngữ chính
- JavaScript
- Star
- 3
- Fork
- 6
- Merge trung bình
- 4 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CenterForDigitalHumanities/rerum_server_nodejs
-
bug documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
backend dependencies easy
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
CenterForDigitalHumanities/rerum_server_nodejs#290 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 50/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 74/100
Tất cả issue của CenterForDigitalHumanities/rerum_server_nodejs
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
curriculum documentation quality
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
githubnext/gh-aw-workshop#3897 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
agent/quality hive/hosted-available-lke648397-260827-5n31 quality testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 91/100
Maintainer thường phản hồi trong vòng 1 ngày