@embed: @never is ignored inside an @reverse frame
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 90/100
Hướng nghiên cứu
Bắt đầu tại lib/pyld/jsonld.py#L4663 trong nhánh reverse-framing, nơi khóa trạng thái được viết là embeded; so sánh nó với kiểm tra @never quanh L4484-L4485 và các điểm gọi forward tại L4597 và L4611. Chạy reproducer của issue để xác nhận nút employee được nhúng, sau đó áp dụng bản sửa một ký tự. Hoàn tất nghĩa là reverse frame trả về "employees": {"@id": "ex:p1"} trong khi các kiểm thử frame hiện có vẫn không đổi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Framing a reverse property with {"@embed": "@never"} embeds the matched node in full. The same flag on a forward property is honoured.
from pyld import jsonld
ctx = {"schema": "http://schema.org/", "name": "schema:name",
"works_for": {"@id": "schema:worksFor", "@type": "@id"},
"employees": {"@reverse": "schema:worksFor"}}
doc = {"@context": ctx, "@graph": [
{"@id": "ex:org1", "@type": "schema:Organization", "name": "Acme"},
{"@id": "ex:p1", "@type": "schema:Person", "name": "Ada", "works_for": "ex:org1"}]}
back = jsonld.from_rdf(jsonld.to_rdf(doc, {"format": "application/n-quads"}),
{"format": "application/n-quads"})
print(jsonld.frame(back, {"@context": ctx, "@embed": "@once", "@type": "schema:Organization",
"@reverse": {"schema:worksFor": {"@embed": "@never"}}}))
3.3.0 returns the employee embedded:
"employees": {"@id": "ex:p1", "@type": "schema:Person", "name": "Ada", "works_for": "ex:org1"}
The reverse branch recurses with a misspelled state key, jsonld.py#L4663:
{**state, 'embeded': True},
while the @never test reads state['embedded'] (L4484-L4485). The key written is never read, so a reverse-framed node is treated as if it were at the top level, where @never does not apply. The two forward call sites, L4597 and L4611, spell it 'embedded'.
Changing that one character in an installed 3.3.0 gives "employees": {"@id": "ex:p1"}, with the other frames unchanged.
jsonld.js is correct at frame.js#L309, so this is specific to the Python port.
- Ngôn ngữ chính
- Python
- Star
- 689
- Fork
- 140
- Merge trung bình
- 2 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 11
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
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 digitalbazaar/pyld
-
No work limit on normalize() in any released version (RDFC-1.0 §4.4.3), and data for choosing the 4.0.0 maxPermutations defaultCó thể đã có người làm @mielvds đã nhận 6 ngày trước. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
digitalbazaar/pyld#368 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Rename master to mainĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 55/100
digitalbazaar/pyld#334 · 2 bình luận · 2 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Deprecate jsonld.parse_nquadsĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
digitalbazaar/pyld#315 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feature
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
digitalbazaar/pyld#307 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
jsonld:framing strict mode
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 50/100
digitalbazaar/pyld#231 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của digitalbazaar/pyld
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
ida-arbeitszeit/workers-control#1578 ·
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 78/100
aws-samples/sample-per-model-bedrock#898 ·
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 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
intake mcp-intake needs-human-review priority:high
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Ikalus1988/MisakaNet#5041 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100