Skip to content

Extend the test command with RDF matching capabilities - #801

Merged
jviotti merged 5 commits into
mainfrom
rdf-test
Aug 3, 2026
Merged

Extend the test command with RDF matching capabilities#801
jviotti merged 5 commits into
mainfrom
rdf-test

Conversation

@jviotti

@jviotti jviotti commented Aug 3, 2026

Copy link
Copy Markdown
Member

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

Review in cubic

jviotti added 4 commits August 3, 2026 16:38
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti
jviotti marked this pull request as ready for review August 3, 2026 20:34
@augmentcode

augmentcode Bot commented Aug 3, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR extends the jsonschema test command to optionally assert JSON-LD/RDF promotion results when schemas are annotated with x-jsonld-* keywords.

Changes:

  • Documents new test-suite fields rdf / rdfPath for asserting expanded JSON-LD output (only when valid: true).
  • Adds RDF-aware failure reporting in the CLI (text + CTRF JSON), including resolution-error diagnostics.
  • Updates Blaze’s test model to carry an optional RDF expectation and introduces a TestOutcome struct.
  • Enhances Blaze test parsing to validate rdf/rdfPath usage and to load expected RDF from JSON/YAML.
  • Ensures schemas are compiled with JSON-LD keyword annotation collection when any test case uses RDF assertions.
  • Adds a set of new shell tests covering RDF parsing rules, mismatches, resolution errors, and invalid-instance behavior.
  • Moves shared JSON-LD facet-name formatting into CLI utilities and updates the Blaze vendor dependency/linking accordingly.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 25 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="test/CMakeLists.txt">

<violation number="1" location="test/CMakeLists.txt:433">
P2: fail_rdf_invalid_instance is a runtime error-case test (exit 2) but, unlike its siblings this PR added (fail_rdf_mismatch_json, fail_rdf_resolution_json), it has no `--json` variant asserting the structured CTRF output. Consider adding a `fail_rdf_invalid_instance_json` script and registering it here to keep error reporting covered in both output formats.</violation>
</file>

<file name="test/test/fail_rdf_resolution.sh">

<violation number="1" location="test/test/fail_rdf_resolution.sh:37">
P3: The new text variant adds a second scenario ("No conflicting member") that its JSON counterpart fail_rdf_resolution_json.sh does not cover, so the paired text/JSON tests now diverge. Per the convention that error-case tests ship both text and --json variants covering the same scenarios, extend fail_rdf_resolution_json.sh with an equivalent pass case (or drop the extra case here) so coverage stays in sync and the structured JSON output is asserted for both paths.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread test/CMakeLists.txt
add_jsonschema_test_unix(test/fail_rdf_mismatch_json)
add_jsonschema_test_unix(test/fail_rdf_resolution)
add_jsonschema_test_unix(test/fail_rdf_resolution_json)
add_jsonschema_test_unix(test/fail_rdf_invalid_instance)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: fail_rdf_invalid_instance is a runtime error-case test (exit 2) but, unlike its siblings this PR added (fail_rdf_mismatch_json, fail_rdf_resolution_json), it has no --json variant asserting the structured CTRF output. Consider adding a fail_rdf_invalid_instance_json script and registering it here to keep error reporting covered in both output formats.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/CMakeLists.txt, line 433:

<comment>fail_rdf_invalid_instance is a runtime error-case test (exit 2) but, unlike its siblings this PR added (fail_rdf_mismatch_json, fail_rdf_resolution_json), it has no `--json` variant asserting the structured CTRF output. Consider adding a `fail_rdf_invalid_instance_json` script and registering it here to keep error reporting covered in both output formats.</comment>

<file context>
@@ -421,6 +421,16 @@ add_jsonschema_test_unix(test/fail_test_case_non_string_description)
+add_jsonschema_test_unix(test/fail_rdf_mismatch_json)
+add_jsonschema_test_unix(test/fail_rdf_resolution)
+add_jsonschema_test_unix(test/fail_rdf_resolution_json)
+add_jsonschema_test_unix(test/fail_rdf_invalid_instance)
 add_jsonschema_test_unix(test/fail_true_resolve_fragment)
 add_jsonschema_test_unix(test/fail_tests_empty)
</file context>

Comment thread test/test/fail_test_case_rdf_and_rdf_path.sh
Comment thread test/test/fail_test_case_rdf_non_array.sh
Comment thread test/test/fail_test_case_rdf_path_non_string.sh
Comment thread test/test/fail_test_case_rdf_valid_false.sh
"rdf": []
},
{
"description": "No conflicting member",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: The new text variant adds a second scenario ("No conflicting member") that its JSON counterpart fail_rdf_resolution_json.sh does not cover, so the paired text/JSON tests now diverge. Per the convention that error-case tests ship both text and --json variants covering the same scenarios, extend fail_rdf_resolution_json.sh with an equivalent pass case (or drop the extra case here) so coverage stays in sync and the structured JSON output is asserted for both paths.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/test/fail_rdf_resolution.sh, line 37:

<comment>The new text variant adds a second scenario ("No conflicting member") that its JSON counterpart fail_rdf_resolution_json.sh does not cover, so the paired text/JSON tests now diverge. Per the convention that error-case tests ship both text and --json variants covering the same scenarios, extend fail_rdf_resolution_json.sh with an equivalent pass case (or drop the extra case here) so coverage stays in sync and the structured JSON output is asserted for both paths.</comment>

<file context>
@@ -0,0 +1,65 @@
+      "rdf": []
+    },
+    {
+      "description": "No conflicting member",
+      "valid": true,
+      "data": {},
</file context>

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti
jviotti merged commit ccd9519 into main Aug 3, 2026
15 checks passed
@jviotti
jviotti deleted the rdf-test branch August 3, 2026 22:57
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

Successfully merging this pull request may close these issues.

1 participant