Skip to content

Add some more JSON-LD related custom linter rules - #109

Merged
jviotti merged 1 commit into
mainfrom
ld-rules
Aug 3, 2026
Merged

Add some more JSON-LD related custom linter rules#109
jviotti merged 1 commit into
mainfrom
ld-rules

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

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti
jviotti merged commit cd51186 into main Aug 3, 2026
3 checks passed
@jviotti
jviotti deleted the ld-rules branch August 3, 2026 12:33
@augmentcode

augmentcode Bot commented Aug 3, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR expands the repository’s JSON Schema linter with additional JSON-LD-focused rules, improving detection of invalid or ambiguous x-jsonld-* annotations.

Changes:

  • Registered several new JSON-LD lint rules in jsonschema.json.
  • Extended jsonld-bare-override to treat x-jsonld-value and x-jsonld-constants as override-relevant keywords.
  • Extended jsonld-unmarked-null to require x-jsonld-override: true when x-jsonld-value or x-jsonld-constants is explicitly set to null.
  • Added jsonld-constants-iri-literal to flag IRI-looking bare strings (and certain value objects) inside x-jsonld-constants.
  • Added jsonld-constants-lexical to validate lexical forms for selected typed literal constants (integer-family, decimal, boolean).
  • Added jsonld-constants-reserved-type and jsonld-datatype-reserved to forbid reserved RDF datatype IRIs in inappropriate places.
  • Added jsonld-value-rdf-type to prevent using rdf:type as an x-jsonld-value predicate.

Technical Notes: The new rules are written as standalone JSON Schemas (Draft 2020-12) and are composed to validate both scalar and array forms within x-jsonld-constants.

🤖 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. 1 suggestion posted.

Fix All in Augment

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

"then": {
"properties": {
"@value": {
"pattern": "^[+-]?[0-9]+$"

@augmentcode augmentcode Bot Aug 3, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

integer-datatypes includes constrained derived types like xsd:nonNegativeInteger/xsd:unsignedByte, but the current lexical check (^[+-]?[0-9]+$ + multipleOf: 1) doesn't enforce those sign/range restrictions. As a result, invalid constants like {"@type":"…#nonNegativeInteger","@value":"-1"} would still satisfy this rule.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

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