Validate Custom JSON-LD Context
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
- 45/100
Hướng nghiên cứu
Chạy lệnh Verify từ issue đối với sbom-output.spdx.json, sau đó so sánh tệp này với expanded-sbom-output.spdx.json được tạo bởi expand-custom-context.sh. Bắt đầu từ bước xác thực ngữ cảnh JSON-LD của lệnh Verify và xác định cách xử lý các ánh xạ ngữ cảnh tùy chỉnh; được xem là hoàn tất khi tài liệu gốc được xác thực mà không cần đến tập lệnh mở rộng bên ngoài.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
According to the Serialization Information section in the SPDX 3.0.1 spec serializing NamespaceMaps within the @context field for JSON-LD serializations is valid.
When serializing a physical SpdxDocument, any property of the logical element that can be natively represented within the chosen serialization format (e.g.,
@contextprefixes in JSON-LD instead of the namespaceMap) may utilize these native mechanisms. All remaining properties shall be serialized within the SpdxDocument element itself.
[...]
Additional namespace mappings may be defined within a separate object within the context.
The java spdx tools however do not currently support this.
Take for example the following document: sbom-output.spdx.json
export SPDX_TOOLS_VERSION=2.0.2
curl -sLO "https://github.com/spdx/tools-java/releases/download/v${SPDX_TOOLS_VERSION}/tools-java-${SPDX_TOOLS_VERSION}.zip"
unzip -j "tools-java-${SPDX_TOOLS_VERSION}.zip" "tools-java-${SPDX_TOOLS_VERSION}-jar-with-dependencies.jar"
java -jar "tools-java-${SPDX_TOOLS_VERSION}-jar-with-dependencies.jar" Verify "sbom-output.spdx.json"
The java tools fail with
This SPDX Document is not valid due to:
$.@context: must be the constant value 'https://spdx.org/rdf/3.0.1/spdx-context.jsonld'
even though the document should be valid.
An easy way to fix this would be to expand the custom context before processing the SPDX document.
See for example expand-custom-context.sh
./expand-custom-context.sh sbom-output.spdx.json
This small script expands the custom context and outputs expanded-sbom-output.spdx.json which successfully gets validated by the java tools.
java -jar "tools-java-${SPDX_TOOLS_VERSION}-jar-with-dependencies.jar" Verify "expanded-sbom-output.spdx.json"
This SPDX Document is valid.
It would be helpful if this behavior could be supported directly by the java-tools.
- Ngôn ngữ chính
- Java
- Star
- 101
- Fork
- 47
- Merge trung bình
- 3 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
- Có Dockerfile hoặc 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 spdx/tools-java
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 85/100
spdx/tools-java#341 · 1 bình luận ·
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
spdx/tools-java#331 · 1 reaction ·
-
Verify accepts SPDX 2.3 documents that violate normative MUST rules (document SPDXID, unique SPDXIDs, documentNamespace URI)Có thể làm lại được @tommyquak đã nhận 28 ngày trước và không có pull request nào đang mở. Đang mởbug spdx-2.3 validation
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
spdx/tools-java#316 · 5 bình luận · 1 reaction · 1 người được giao ·
-
Release 2.0.8Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 20/100
spdx/tools-java#313 · 1 reaction ·
-
spdx-2.x spdx-3.x
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
spdx/tools-java#290 · 2 bình luận ·
Tất cả issue của spdx/tools-java
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Card-Forge/forge#13128 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
client documentation
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 86/100
ClickHouse/clickhouse-java#3469 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/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 76/100
apache/flink-agents#1480 ·
Maintainer thường phản hồi trong vòng 2 ngày