Support mailto and acct scheme identity names in x-jsonld-self - #802
Conversation
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
🤖 Augment PR SummarySummary: This PR extends the JSON-LD/RDF emission support for the Changes:
Technical Notes: Scheme identity names bypass URI-template expansion and instead canonicalize the instance string into a single blessed IRI spelling (percent-encoding + case normalization per scheme), ensuring consistent RDF IRI string comparison. 🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
2 issues found across 30 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="docs/rdf.markdown">
<violation number="1" location="docs/rdf.markdown:111">
P2: The claim "reserved characters percent encoded" is imprecise: the engine deliberately leaves many RFC 3986 reserved sub-delimiters unencoded (mailto passes through `! $ ' ( ) * + :`; acct passes through every sub-delimiter in the user part), matching RFC 6068/7565 allowed-literal sets. A reader relying on the documented "single blessed spelling" could percent-encode those characters and mint a different IRI than the engine, defeating the equality guarantee this section describes.</violation>
</file>
<file name="test/rdf/fail_resolution_self_scheme_domain.sh">
<violation number="1" location="test/rdf/fail_resolution_self_scheme_domain.sh:12">
P3: The new negative test only covers the `mailto` scheme's resolution failure; `acct` — the other scheme added in this change — has no corresponding failure case. Since `acct` has its own source grammar and minting logic (RFC 7565), consider adding a symmetric negative test (e.g., an `acct` value whose host is missing/invalid) so both newly supported schemes have an exercised error path, matching the pass test that covers both.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
|
||
| | Name | Source Grammar | Minted Identity | | ||
| |------|----------------|-----------------| | ||
| | `mailto` | An [RFC 5321](https://www.rfc-editor.org/rfc/rfc5321) `Mailbox`, such as `gorby%kremvax@example.com` | Its [RFC 6068](https://www.rfc-editor.org/rfc/rfc6068) `mailto` IRI, such as `mailto:gorby%25kremvax@example.com`, with reserved characters percent encoded and the domain name lowercased | |
There was a problem hiding this comment.
P2: The claim "reserved characters percent encoded" is imprecise: the engine deliberately leaves many RFC 3986 reserved sub-delimiters unencoded (mailto passes through ! $ ' ( ) * + :; acct passes through every sub-delimiter in the user part), matching RFC 6068/7565 allowed-literal sets. A reader relying on the documented "single blessed spelling" could percent-encode those characters and mint a different IRI than the engine, defeating the equality guarantee this section describes.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/rdf.markdown, line 111:
<comment>The claim "reserved characters percent encoded" is imprecise: the engine deliberately leaves many RFC 3986 reserved sub-delimiters unencoded (mailto passes through `! $ ' ( ) * + :`; acct passes through every sub-delimiter in the user part), matching RFC 6068/7565 allowed-literal sets. A reader relying on the documented "single blessed spelling" could percent-encode those characters and mint a different IRI than the engine, defeating the equality guarantee this section describes.</comment>
<file context>
@@ -98,6 +98,19 @@ instance property names, so a variable like `{+meta.slug}` binds a property
+
+| Name | Source Grammar | Minted Identity |
+|------|----------------|-----------------|
+| `mailto` | An [RFC 5321](https://www.rfc-editor.org/rfc/rfc5321) `Mailbox`, such as `gorby%kremvax@example.com` | Its [RFC 6068](https://www.rfc-editor.org/rfc/rfc6068) `mailto` IRI, such as `mailto:gorby%25kremvax@example.com`, with reserved characters percent encoded and the domain name lowercased |
+| `acct` | An [RFC 7565](https://www.rfc-editor.org/rfc/rfc7565) `user@host` account, such as `juliet@capulet.example@shoppingsite.example` | Its `acct` IRI, such as `acct:juliet%40capulet.example@shoppingsite.example`, with reserved characters in the user part percent encoded and the host lowercased |
+
</file context>
| | `mailto` | An [RFC 5321](https://www.rfc-editor.org/rfc/rfc5321) `Mailbox`, such as `gorby%kremvax@example.com` | Its [RFC 6068](https://www.rfc-editor.org/rfc/rfc6068) `mailto` IRI, such as `mailto:gorby%25kremvax@example.com`, with reserved characters percent encoded and the domain name lowercased | | |
| | `mailto` | An [RFC 5321](https://www.rfc-editor.org/rfc/rfc5321) `Mailbox`, such as `gorby%kremvax@example.com` | Its [RFC 6068](https://www.rfc-editor.org/rfc/rfc6068) `mailto` IRI, such as `mailto:gorby%25kremvax@example.com`, with non-permitted characters percent encoded and the domain name lowercased | |
|
|
||
| cat << 'EOF' > "$TMP/schema.json" | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", |
There was a problem hiding this comment.
P3: The new negative test only covers the mailto scheme's resolution failure; acct — the other scheme added in this change — has no corresponding failure case. Since acct has its own source grammar and minting logic (RFC 7565), consider adding a symmetric negative test (e.g., an acct value whose host is missing/invalid) so both newly supported schemes have an exercised error path, matching the pass test that covers both.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/rdf/fail_resolution_self_scheme_domain.sh, line 12:
<comment>The new negative test only covers the `mailto` scheme's resolution failure; `acct` — the other scheme added in this change — has no corresponding failure case. Since `acct` has its own source grammar and minting logic (RFC 7565), consider adding a symmetric negative test (e.g., an `acct` value whose host is missing/invalid) so both newly supported schemes have an exercised error path, matching the pass test that covers both.</comment>
<file context>
@@ -0,0 +1,63 @@
+
+cat << 'EOF' > "$TMP/schema.json"
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "type": "object",
+ "properties": {
</file context>
Signed-off-by: Juan Cruz Viotti jv@jviotti.com