@agenticprimitives/ontology 1.0.0-alpha.17 → 1.0.0-alpha.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/tbox/trust.ttl CHANGED
@@ -88,3 +88,123 @@ aptrust:hasTrustScore a owl:ObjectProperty ;
88
88
  rdfs:domain apdisc:TrustDetermination ;
89
89
  rdfs:range aptrust:TrustScore ;
90
90
  rdfs:label "hasTrustScore" .
91
+
92
+ # ═══════════════════════════════════════════════════════════════════════════
93
+ # T-BOX PROMOTION of the projected trust-fabric terms (facet-registries G1; spec 331)
94
+ # ═══════════════════════════════════════════════════════════════════════════
95
+ #
96
+ # WHAT WAS WRONG. `apps/demo-discovery-indexer/src/ontology.ts` coined a set of `ap:` terms for
97
+ # the relationship and attestation projectors and wrote them into the production graph;
98
+ # `apps/demo-discovery-mcp/src/graphdb.ts` queries them by name (`?e ap:edgeId ?eid ;
99
+ # ap:edgeSubject ?subj ; ap:edgeObject ?obj ; …`). None of them were ever declared in a T-box.
100
+ # `aprel:` is a declared namespace with no module and no terms, and this file typed the EDGE
101
+ # (aptrust:TrustGraphEdge) while declaring nothing about its subject, object, type or status.
102
+ # The result was a live query path over undeclared vocabulary — exactly the read-path-without-a-
103
+ # definition condition ADR-0013 forbids, and the mirror image of gap G5 on the write side.
104
+ #
105
+ # WHY THE `ap:` PREFIX IS RETAINED RATHER THAN RE-MINTED AS `aptrust:` OR `aprel:`.
106
+ # The IRIs are already in the deployed GraphDB and already in the MCP's SPARQL query TEXT.
107
+ # Re-prefixing them is a graph migration plus a coordinated Worker deploy, not an edit — and it
108
+ # would buy nothing semantic, because a T-box term's namespace is not its meaning. This follows
109
+ # the established discipline (facet-registries §7, ADR-0051): IDENTIFIERS KEEP THEIR NAMES, prose
110
+ # and docs use the canonical term. The alternative considered and rejected was declaring `aptrust:`
111
+ # twins as owl:equivalentProperty aliases — that is a SECOND mechanism for one read path, which
112
+ # ADR-0013 forbids more strongly than it forbids an awkward prefix.
113
+ #
114
+ # NOTHING IS MINTED HERE. Every term below is verbatim the IRI the indexer already emits.
115
+ # Promotion is a declaration, not a change; the graph is unaffected.
116
+ #
117
+ # ENDPOINT-RELATIVE vs ABSOLUTE — the invariant that decides which properties sit where.
118
+ # One on-chain AgentRelationship edge is ONE record shared by both endpoints, and the edge node's
119
+ # IRI derives from the deterministic on-chain edgeId, so BOTH agents project the SAME subject.
120
+ # Its properties must therefore be endpoint-INDEPENDENT. `ap:edgeDirection` and `ap:relatedAgent`
121
+ # are meaningful only relative to whoever is looking, so they hang on the AGENT; the shared edge
122
+ # node states subject and object ABSOLUTELY.
123
+
124
+ @prefix apreg: <https://agenticprimitives.dev/ns/registry#> .
125
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
126
+
127
+ # ─── Agent → child-node facet links ─────────────────────────────────────────
128
+
129
+ ap:hasRelationship a owl:ObjectProperty ;
130
+ rdfs:domain ap:Agent ; rdfs:range aptrust:TrustGraphEdge ;
131
+ rdfs:label "hasRelationship" ;
132
+ rdfs:comment "Agent → a projected AgentRelationship edge it is an endpoint of (either side)." .
133
+
134
+ ap:hasAttestation a owl:ObjectProperty ;
135
+ rdfs:domain ap:Agent ; rdfs:range apatt:Attestation ;
136
+ rdfs:label "hasAttestation" ;
137
+ rdfs:comment "Agent → an AttestationRegistry row in which it is the SUBJECT. Issuer-side rows are not projected onto the issuer: an attestation is evidence ABOUT its subject." .
138
+
139
+ # ─── Edge-node properties — ABSOLUTE, endpoint-independent ──────────────────
140
+
141
+ ap:edgeId a owl:DatatypeProperty ;
142
+ rdfs:domain aptrust:TrustGraphEdge ; rdfs:range xsd:string ;
143
+ rdfs:label "edgeId" ;
144
+ rdfs:comment "The deterministic on-chain edgeId = computeEdgeId(subject, object, relationshipType). The edge node's IRI derives from it, which is why both endpoints project one shared node." .
145
+
146
+ ap:edgeSubject a owl:ObjectProperty ;
147
+ rdfs:domain aptrust:TrustGraphEdge ; rdfs:range ap:CanonicalAgentId ;
148
+ rdfs:label "edgeSubject" ;
149
+ rdfs:comment "The SA that PROPOSED the edge. On-chain `proposeEdge` requires msg.sender == subject, so this is structurally the proposing party — never inferred, never symmetric with edgeObject." .
150
+
151
+ ap:edgeObject a owl:ObjectProperty ;
152
+ rdfs:domain aptrust:TrustGraphEdge ; rdfs:range ap:CanonicalAgentId ;
153
+ rdfs:label "edgeObject" ;
154
+ rdfs:comment "The SA that CONFIRMED the edge. An edge reaches ACTIVE only through PROPOSED → CONFIRMED → ACTIVE, so an active edge is bilateral by construction: both parties consented on chain." .
155
+
156
+ ap:relationshipType a owl:DatatypeProperty ;
157
+ rdfs:domain aptrust:TrustGraphEdge ; rdfs:range xsd:string ;
158
+ rdfs:label "relationshipType" ;
159
+ rdfs:comment "The well-known label ('HAS_MEMBER', 'VALIDATION_TRUST', 'RECOMMENDS', …) when the type hash resolves; absent otherwise. Never a substitute for relationshipTypeId." .
160
+
161
+ ap:relationshipTypeId a owl:DatatypeProperty ;
162
+ rdfs:domain aptrust:TrustGraphEdge ; rdfs:range xsd:string ;
163
+ rdfs:label "relationshipTypeId" ;
164
+ rdfs:comment "The raw on-chain bytes32 type id, ALWAYS emitted — an unresolved governor-registered type must still be queryable (ADR-0013: no silent gaps)." .
165
+
166
+ ap:edgeStatus a owl:DatatypeProperty ;
167
+ rdfs:domain aptrust:TrustGraphEdge ; rdfs:range xsd:string ;
168
+ rdfs:label "edgeStatus" ;
169
+ rdfs:comment "'PROPOSED' | 'CONFIRMED' | 'ACTIVE' | 'REVOKED'. Only ACTIVE edges may inform trust scoring — a proposal is one party talking to itself, and revocation is terminal." .
170
+
171
+ # ─── Agent-level, endpoint-RELATIVE denormalizations ────────────────────────
172
+
173
+ ap:relatedAgent a owl:ObjectProperty ;
174
+ rdfs:domain ap:Agent ; rdfs:range ap:CanonicalAgentId ;
175
+ rdfs:label "relatedAgent" ;
176
+ rdfs:comment "The COUNTERPARTY as seen from this agent. Endpoint-relative by construction, hence on the agent and never on the shared edge node." .
177
+
178
+ ap:edgeDirection a owl:DatatypeProperty ;
179
+ rdfs:domain ap:Agent ; rdfs:range xsd:string ;
180
+ rdfs:label "edgeDirection" ;
181
+ rdfs:comment "'subject' | 'object' — which end of the edge THIS agent occupies. Endpoint-relative; see ap:relatedAgent." .
182
+
183
+ ap:edgeCount a owl:DatatypeProperty ;
184
+ rdfs:domain ap:Agent ; rdfs:range xsd:integer ; rdfs:label "edgeCount" .
185
+
186
+ ap:activeEdgeCount a owl:DatatypeProperty ;
187
+ rdfs:domain ap:Agent ; rdfs:range xsd:integer ;
188
+ rdfs:label "activeEdgeCount" ;
189
+ rdfs:comment "Edges in ACTIVE status only. This is the count trustScore reads, and it saturates fast — a public edge is cheap to create, so it is corroboration, never authority." .
190
+
191
+ # ─── Attestation terms with no apatt: home (the T-box does not model the
192
+ # on-chain struct's issuer or its isValid(uid) view) ─────────────────────
193
+
194
+ ap:attestationIssuer a owl:ObjectProperty ;
195
+ rdfs:domain apatt:Attestation ; rdfs:range ap:CanonicalAgentId ;
196
+ rdfs:label "attestationIssuer" ;
197
+ rdfs:comment "The asserting party. AttestationRegistry leaves msg.sender UNCONSTRAINED and derives authority from a recomputed EIP-712 signature, so the issuer here is the SIGNER, never the transaction sender. This is what makes third-party endorsement relayable without the issuer holding gas — the property spec 331's endorsement ceremony depends on." .
198
+
199
+ ap:attestationValid a owl:DatatypeProperty ;
200
+ rdfs:domain apatt:Attestation ; rdfs:range xsd:boolean ;
201
+ rdfs:label "attestationValid" ;
202
+ rdfs:comment "The contract's isValid(uid) verdict at index time. Note AR-06: there is NO issuer-revoke entrypoint — only the holder or a party may revoke on chain; issuer-side revocation is off-chain via offchainCredentialStatusList and is therefore NOT reflected here." .
203
+
204
+ ap:attestationCount a owl:DatatypeProperty ;
205
+ rdfs:domain ap:Agent ; rdfs:range xsd:integer ; rdfs:label "attestationCount" .
206
+
207
+ ap:validAttestationCount a owl:DatatypeProperty ;
208
+ rdfs:domain ap:Agent ; rdfs:range xsd:integer ;
209
+ rdfs:label "validAttestationCount" ;
210
+ rdfs:comment "Non-revoked attestations where this agent is the SUBJECT. The count trustScore reads." .