@agenticprimitives/ontology 0.1.0-alpha.2

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Agentic Trust Labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # @agenticprimitives/ontology
2
+
3
+ The **monorepo-wide formal vocabulary** for agentic primitives — the off-chain
4
+ source of truth that the on-chain ontology ([ADR-0009](../../docs/architecture/decisions/0009-on-chain-ontology-shacl-naming.md))
5
+ instantiates and that [`identity-directory`](../identity-directory) (spec 223)
6
+ conforms to.
7
+
8
+ See [spec 225](../../specs/225-ontology.md) for the full contract and
9
+ [ADR-0018](../../docs/architecture/decisions/0018-agenticprimitives-wide-formal-ontology.md)
10
+ for the decision.
11
+
12
+ ## Layout (T-box / C-box / A-box)
13
+
14
+ ```
15
+ context.jsonld @context — namespace prefix → IRI bindings
16
+ tbox/ RDFS/OWL schema (classes + properties), per domain
17
+ cbox/ SHACL shapes + SKOS controlled vocabularies (codelists)
18
+ abox/ example / fixture instances (tests + golden vectors only)
19
+ src/index.ts typed IRI constants + artifact paths
20
+ ```
21
+
22
+ This mirrors the reference ontology work
23
+ (`agentictrustlabs/smart-agent/docs/ontology`): T-box = terminology, C-box =
24
+ constraints + controlled vocabularies, A-box = instances.
25
+
26
+ ## Usage
27
+
28
+ ```ts
29
+ import { NS, CLASS, SHAPE, ARTIFACTS, artifactPath } from '@agenticprimitives/ontology';
30
+
31
+ CLASS.CanonicalAgentId; // "https://agenticprimitives.dev/ns/core#CanonicalAgentId"
32
+ artifactPath(ARTIFACTS.tbox[0]); // absolute path to tbox/core.ttl — load into a SPARQL store
33
+ ```
34
+
35
+ The package is **declarative**: it ships the vocabulary artifacts and exposes
36
+ their IRIs/paths. It contains no runtime auth/policy logic. SHACL-engine
37
+ validation over instances, and the live A-box knowledge graph (a SPARQL store —
38
+ Ontotext GraphDB reference), are wired by consumers in Phase 2 (spec 225 §11).
39
+
40
+ ## Scope (Phase 1)
41
+
42
+ Bounded to the agent-trust core: identity, credential, custody, delegation,
43
+ audit, naming, org. Marketplace / intents / geo are out of scope (spec 225 §11).
44
+
45
+ ## What this is NOT
46
+
47
+ - Not the TS types — `@agenticprimitives/types` owns `CanonicalAgentId`,
48
+ `Assurance`, etc.; this package names the IRIs. One brand.
49
+ - Not the runtime CAIP-10 builder — that is `@agenticprimitives/agent-profile`.
50
+ - Not an authority — it names + validates; it never grants custody or mints
51
+ identity.
@@ -0,0 +1,41 @@
1
+ # C-box — SHACL shapes (constraints). Spec 225 §6.
2
+ # Phase 1 ships the load-bearing shape (CanonicalAgentId) + a CredentialFacet
3
+ # shape. SHACL-engine validation over instances is wired in Phase 2 (spec 225 §11);
4
+ # the on-chain ShapeRegistry (ADR-0009) is the per-chain enforcement peer.
5
+
6
+ @prefix ap: <https://agenticprimitives.dev/ns/core#> .
7
+ @prefix apcr: <https://agenticprimitives.dev/ns/credential#> .
8
+ @prefix apid: <https://agenticprimitives.dev/ns/identity#> .
9
+ @prefix sh: <http://www.w3.org/ns/shacl#> .
10
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
11
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
12
+
13
+ # A CanonicalAgentId value MUST be a CAIP-10 string whose namespace is in the
14
+ # Phase-1 allowlist {eip155, hedera, solana} (ADR-0008). The pattern bakes the
15
+ # allowlist into the grammar so a single sh:pattern enforces both.
16
+ ap:CanonicalAgentIdShape a sh:NodeShape ;
17
+ rdfs:label "CanonicalAgentId shape" ;
18
+ rdfs:comment "Bind via sh:targetObjectsOf on any CanonicalAgentId-valued predicate (e.g. a subject's identifier). Phase 2 wires targets + the engine." ;
19
+ sh:nodeKind sh:Literal ;
20
+ sh:datatype xsd:string ;
21
+ sh:pattern "^(eip155|hedera|solana):[-_a-zA-Z0-9]{1,32}:[-.%a-zA-Z0-9]{1,128}$" ;
22
+ sh:message "CanonicalAgentId must be a CAIP-10 string with namespace in {eip155, hedera, solana}." .
23
+
24
+ # A CredentialFacet references exactly one Agent and carries exactly one Evidence
25
+ # (spec 223 §4). Modeled as property constraints; targets bound in Phase 2.
26
+ ap:CredentialFacetShape a sh:NodeShape ;
27
+ rdfs:label "CredentialFacet shape" ;
28
+ sh:targetClass apcr:CredentialFacet ;
29
+ sh:property [
30
+ sh:path apid:isFacetOf ;
31
+ sh:minCount 1 ;
32
+ sh:maxCount 1 ;
33
+ sh:class ap:Agent ;
34
+ sh:message "A CredentialFacet must reference exactly one Agent."
35
+ ] ;
36
+ sh:property [
37
+ sh:path ap:hasEvidence ;
38
+ sh:minCount 1 ;
39
+ sh:maxCount 1 ;
40
+ sh:message "A CredentialFacet must carry exactly one Evidence."
41
+ ] .
@@ -0,0 +1,57 @@
1
+ # C-box — controlled vocabularies (SKOS concept schemes / closed codelists).
2
+ # Spec 225 §6. These closed sets are the off-chain source of truth that the
3
+ # on-chain OntologyTermRegistry enum-sets (ADR-0009) bind in lockstep, and that
4
+ # the @agenticprimitives/types unions (AgentType, CredentialKind, Assurance,
5
+ # CredentialRole) mirror. NOTE (audit P1-4): agentKind (4) and profileType (6)
6
+ # are DISTINCT vocabularies.
7
+
8
+ @prefix ap: <https://agenticprimitives.dev/ns/core#> .
9
+ @prefix apcr: <https://agenticprimitives.dev/ns/credential#> .
10
+ @prefix apcus: <https://agenticprimitives.dev/ns/custody#> .
11
+ @prefix apid: <https://agenticprimitives.dev/ns/identity#> .
12
+ @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
13
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
14
+
15
+ # ─── agentKind — 4 values, on-chain-bound (ADR-0009 enum / types.AgentType) ──
16
+ ap:agentKind a skos:ConceptScheme ;
17
+ rdfs:label "agentKind" ;
18
+ rdfs:comment "The 3-value on-chain-bound kind (person/org/service). Distinct from profileType (6 values; agent-profile/HCS-11). treasury is NOT an agentKind — it is a profileType ⊂ service (ap:Treasury rdfs:subClassOf ap:ServiceAgent; tbox/identity)." ;
19
+ skos:hasTopConcept ap:Person, ap:OrgKind, ap:Service .
20
+ ap:Person a skos:Concept ; skos:inScheme ap:agentKind ; skos:prefLabel "person" .
21
+ ap:OrgKind a skos:Concept ; skos:inScheme ap:agentKind ; skos:prefLabel "org" .
22
+ ap:Service a skos:Concept ; skos:inScheme ap:agentKind ; skos:prefLabel "service" .
23
+
24
+ # ─── credentialKind (types.CredentialKind) ───────────────────────────
25
+ apcr:credentialKindScheme a skos:ConceptScheme ;
26
+ rdfs:label "credentialKind" ;
27
+ skos:hasTopConcept apcr:Passkey, apcr:SiweEoa, apcr:Hardware, apcr:Oidc .
28
+ apcr:Passkey a skos:Concept ; skos:inScheme apcr:credentialKindScheme ; skos:prefLabel "passkey" .
29
+ apcr:SiweEoa a skos:Concept ; skos:inScheme apcr:credentialKindScheme ; skos:prefLabel "siwe-eoa" .
30
+ apcr:Hardware a skos:Concept ; skos:inScheme apcr:credentialKindScheme ; skos:prefLabel "hardware" .
31
+ apcr:Oidc a skos:Concept ; skos:inScheme apcr:credentialKindScheme ; skos:prefLabel "oidc" .
32
+
33
+ # ─── credentialRole — login-grade vs custody-grade (ADR-0017) ─────────
34
+ apcr:credentialRoleScheme a skos:ConceptScheme ;
35
+ rdfs:label "credentialRole" ;
36
+ skos:hasTopConcept apcr:LoginGrade, apcr:CustodyGrade .
37
+ apcr:LoginGrade a skos:Concept ; skos:inScheme apcr:credentialRoleScheme ; skos:prefLabel "login-grade" .
38
+ apcr:CustodyGrade a skos:Concept ; skos:inScheme apcr:credentialRoleScheme ; skos:prefLabel "custody-grade" .
39
+
40
+ # ─── assurance — ordered ladder (types.Assurance) ─────────────────────
41
+ apcus:assuranceScheme a skos:ConceptScheme ;
42
+ rdfs:label "assurance" ;
43
+ rdfs:comment "Ordered low→high: unverified < asserted < onchain-read < onchain-confirmed." ;
44
+ skos:hasTopConcept apcus:Unverified, apcus:Asserted, apcus:OnchainRead, apcus:OnchainConfirmed .
45
+ apcus:Unverified a skos:Concept ; skos:inScheme apcus:assuranceScheme ; skos:prefLabel "unverified" ; skos:notation "0" .
46
+ apcus:Asserted a skos:Concept ; skos:inScheme apcus:assuranceScheme ; skos:prefLabel "asserted" ; skos:notation "1" ; skos:broader apcus:Unverified .
47
+ apcus:OnchainRead a skos:Concept ; skos:inScheme apcus:assuranceScheme ; skos:prefLabel "onchain-read" ; skos:notation "2" ; skos:broader apcus:Asserted .
48
+ apcus:OnchainConfirmed a skos:Concept ; skos:inScheme apcus:assuranceScheme ; skos:prefLabel "onchain-confirmed" ; skos:notation "3" ; skos:broader apcus:OnchainRead .
49
+
50
+ # ─── controlStatus — custodied vs identifier-only (spec 226 §4) ───────
51
+ ap:controlStatusScheme a skos:ConceptScheme ;
52
+ rdfs:label "controlStatus" ;
53
+ skos:hasTopConcept ap:Custodied, ap:IdentifierOnly .
54
+ ap:Custodied a skos:Concept ; skos:inScheme ap:controlStatusScheme ; skos:prefLabel "custodied" ;
55
+ rdfs:comment "EVM (eip155) — custodied via ERC-4337/ERC-1271." .
56
+ ap:IdentifierOnly a skos:Concept ; skos:inScheme ap:controlStatusScheme ; skos:prefLabel "identifier-only" ;
57
+ rdfs:comment "hedera:* / solana:* — addressable, not custodied by this stack." .
package/context.jsonld ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "@context": {
3
+ "ap": "https://agenticprimitives.dev/ns/core#",
4
+ "apid": "https://agenticprimitives.dev/ns/identity#",
5
+ "apcr": "https://agenticprimitives.dev/ns/credential#",
6
+ "apdel": "https://agenticprimitives.dev/ns/delegation#",
7
+ "apcus": "https://agenticprimitives.dev/ns/custody#",
8
+ "apaud": "https://agenticprimitives.dev/ns/audit#",
9
+ "apnam": "https://agenticprimitives.dev/ns/naming#",
10
+ "aprel": "https://agenticprimitives.dev/ns/relationships#",
11
+ "aporg": "https://agenticprimitives.dev/ns/org#",
12
+
13
+ "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
14
+ "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
15
+ "owl": "http://www.w3.org/2002/07/owl#",
16
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
17
+ "sh": "http://www.w3.org/ns/shacl#",
18
+ "skos": "http://www.w3.org/2004/02/skos/core#",
19
+ "prov": "http://www.w3.org/ns/prov#"
20
+ }
21
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Relative paths (from the package root) of the shipped vocabulary artifacts.
3
+ * Resolve to an absolute filesystem path with {@link artifactPath} and load into
4
+ * a SPARQL store / SHACL engine.
5
+ */
6
+ export declare const ARTIFACTS: {
7
+ readonly context: "context.jsonld";
8
+ readonly tbox: readonly ["tbox/core.ttl", "tbox/identity.ttl"];
9
+ readonly cbox: readonly ["cbox/canonical-agent-id-shape.shacl.ttl", "cbox/controlled-vocabularies.ttl"];
10
+ };
11
+ /**
12
+ * Resolve a shipped artifact's relative path (see {@link ARTIFACTS}) to an
13
+ * absolute filesystem path. Works in dev (from `src/`) and after build (from
14
+ * `dist/`) — the artifacts ship at the package root in both cases.
15
+ */
16
+ export declare function artifactPath(relativePath: string): string;
17
+ //# sourceMappingURL=artifacts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../src/artifacts.ts"],"names":[],"mappings":"AASA;;;;GAIG;AACH,eAAO,MAAM,SAAS;;;;CAIZ,CAAC;AAEX;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEzD"}
@@ -0,0 +1,26 @@
1
+ // Node-only artifact loaders for @agenticprimitives/ontology.
2
+ //
3
+ // Subpath: `@agenticprimitives/ontology/artifacts`. Uses `node:url` + the
4
+ // filesystem, so it is NOT browser-bundleable — import it ONLY server-side (a
5
+ // SPARQL loader / SHACL engine). The browser-safe IRI constants are the main
6
+ // entry (`@agenticprimitives/ontology`).
7
+ import { fileURLToPath } from 'node:url';
8
+ /**
9
+ * Relative paths (from the package root) of the shipped vocabulary artifacts.
10
+ * Resolve to an absolute filesystem path with {@link artifactPath} and load into
11
+ * a SPARQL store / SHACL engine.
12
+ */
13
+ export const ARTIFACTS = {
14
+ context: 'context.jsonld',
15
+ tbox: ['tbox/core.ttl', 'tbox/identity.ttl'],
16
+ cbox: ['cbox/canonical-agent-id-shape.shacl.ttl', 'cbox/controlled-vocabularies.ttl'],
17
+ };
18
+ /**
19
+ * Resolve a shipped artifact's relative path (see {@link ARTIFACTS}) to an
20
+ * absolute filesystem path. Works in dev (from `src/`) and after build (from
21
+ * `dist/`) — the artifacts ship at the package root in both cases.
22
+ */
23
+ export function artifactPath(relativePath) {
24
+ return fileURLToPath(new URL(`../${relativePath}`, import.meta.url));
25
+ }
26
+ //# sourceMappingURL=artifacts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../src/artifacts.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,EAAE;AACF,0EAA0E;AAC1E,8EAA8E;AAC9E,6EAA6E;AAC7E,yCAAyC;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,OAAO,EAAE,gBAAgB;IACzB,IAAI,EAAE,CAAC,eAAe,EAAE,mBAAmB,CAAC;IAC5C,IAAI,EAAE,CAAC,yCAAyC,EAAE,kCAAkC,CAAC;CAC7E,CAAC;AAEX;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,YAAoB;IAC/C,OAAO,aAAa,CAAC,IAAI,GAAG,CAAC,MAAM,YAAY,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACvE,CAAC"}
@@ -0,0 +1,46 @@
1
+ /** Bumped on any breaking change to the shipped vocabulary. */
2
+ export declare const ONTOLOGY_VERSION: "0.1.0";
3
+ /**
4
+ * Namespace IRIs, split per domain (mirrors the reference
5
+ * `smartagent.io/ontology/<domain>#` scheme; spec 225 §4). Pinned base:
6
+ * `https://agenticprimitives.dev/ns/`.
7
+ */
8
+ export declare const NS: {
9
+ readonly ap: "https://agenticprimitives.dev/ns/core#";
10
+ readonly apid: "https://agenticprimitives.dev/ns/identity#";
11
+ readonly apcr: "https://agenticprimitives.dev/ns/credential#";
12
+ readonly apdel: "https://agenticprimitives.dev/ns/delegation#";
13
+ readonly apcus: "https://agenticprimitives.dev/ns/custody#";
14
+ readonly apaud: "https://agenticprimitives.dev/ns/audit#";
15
+ readonly apnam: "https://agenticprimitives.dev/ns/naming#";
16
+ readonly aprel: "https://agenticprimitives.dev/ns/relationships#";
17
+ readonly aporg: "https://agenticprimitives.dev/ns/org#";
18
+ };
19
+ /** Class IRIs (T-box). Each is `<namespace><LocalName>`. */
20
+ export declare const CLASS: {
21
+ readonly Agent: "https://agenticprimitives.dev/ns/core#Agent";
22
+ readonly CanonicalAgentId: "https://agenticprimitives.dev/ns/core#CanonicalAgentId";
23
+ readonly Facet: "https://agenticprimitives.dev/ns/core#Facet";
24
+ readonly Evidence: "https://agenticprimitives.dev/ns/core#Evidence";
25
+ readonly CredentialFacet: "https://agenticprimitives.dev/ns/credential#CredentialFacet";
26
+ readonly NameFacet: "https://agenticprimitives.dev/ns/naming#NameFacet";
27
+ readonly OidcSubject: "https://agenticprimitives.dev/ns/identity#OidcSubject";
28
+ readonly Org: "https://agenticprimitives.dev/ns/org#Org";
29
+ };
30
+ /** Predicate / property IRIs (T-box). */
31
+ export declare const PREDICATE: {
32
+ readonly isFacetOf: "https://agenticprimitives.dev/ns/identity#isFacetOf";
33
+ readonly controls: "https://agenticprimitives.dev/ns/credential#controls";
34
+ readonly hasEvidence: "https://agenticprimitives.dev/ns/core#hasEvidence";
35
+ readonly assurance: "https://agenticprimitives.dev/ns/core#assurance";
36
+ readonly controlStatus: "https://agenticprimitives.dev/ns/core#controlStatus";
37
+ readonly resolvesTo: "https://agenticprimitives.dev/ns/naming#resolvesTo";
38
+ readonly memberOf: "https://agenticprimitives.dev/ns/org#memberOf";
39
+ readonly delegatesTo: "https://agenticprimitives.dev/ns/delegation#delegatesTo";
40
+ };
41
+ /** SHACL shape IRIs (C-box). */
42
+ export declare const SHAPE: {
43
+ readonly CanonicalAgentId: "https://agenticprimitives.dev/ns/core#CanonicalAgentIdShape";
44
+ readonly CredentialFacet: "https://agenticprimitives.dev/ns/credential#CredentialFacetShape";
45
+ };
46
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAmBA,+DAA+D;AAC/D,eAAO,MAAM,gBAAgB,EAAG,OAAgB,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,EAAE;;;;;;;;;;CAUL,CAAC;AAEX,4DAA4D;AAC5D,eAAO,MAAM,KAAK;;;;;;;;;CASR,CAAC;AAEX,yCAAyC;AACzC,eAAO,MAAM,SAAS;;;;;;;;;CASZ,CAAC;AAEX,gCAAgC;AAChC,eAAO,MAAM,KAAK;;;CAGR,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,66 @@
1
+ // @agenticprimitives/ontology — the monorepo-wide formal vocabulary.
2
+ //
3
+ // This package is DECLARATIVE: it ships the RDFS/OWL T-box + SHACL/SKOS C-box
4
+ // artifacts (the source of truth) and exposes their stable IRIs + paths as
5
+ // typed constants. It has NO runtime auth/policy logic and depends on nothing
6
+ // (the vocabulary root — ADR-0018; spec 225). SHACL-engine validation over
7
+ // arbitrary instances is Phase 2 (spec 225 §11).
8
+ //
9
+ // See:
10
+ // - ../../specs/225-ontology.md — the contract
11
+ // - ../../docs/architecture/decisions/0018-agenticprimitives-wide-formal-ontology.md
12
+ // - ../../docs/architecture/decisions/0009-on-chain-ontology-shacl-naming.md (the on-chain peer)
13
+ //
14
+ // This entry is BROWSER-SAFE (pure IRI constants — no Node builtins), so
15
+ // browser consumers (identity-directory → connect → demo-sso) can bundle it.
16
+ // The Node-only artifact loaders (`ARTIFACTS` paths + `artifactPath`, which use
17
+ // `node:url`/the filesystem) live in the `@agenticprimitives/ontology/artifacts`
18
+ // subpath — import those only server-side.
19
+ /** Bumped on any breaking change to the shipped vocabulary. */
20
+ export const ONTOLOGY_VERSION = '0.1.0';
21
+ /**
22
+ * Namespace IRIs, split per domain (mirrors the reference
23
+ * `smartagent.io/ontology/<domain>#` scheme; spec 225 §4). Pinned base:
24
+ * `https://agenticprimitives.dev/ns/`.
25
+ */
26
+ export const NS = {
27
+ ap: 'https://agenticprimitives.dev/ns/core#',
28
+ apid: 'https://agenticprimitives.dev/ns/identity#',
29
+ apcr: 'https://agenticprimitives.dev/ns/credential#',
30
+ apdel: 'https://agenticprimitives.dev/ns/delegation#',
31
+ apcus: 'https://agenticprimitives.dev/ns/custody#',
32
+ apaud: 'https://agenticprimitives.dev/ns/audit#',
33
+ apnam: 'https://agenticprimitives.dev/ns/naming#',
34
+ aprel: 'https://agenticprimitives.dev/ns/relationships#',
35
+ aporg: 'https://agenticprimitives.dev/ns/org#',
36
+ };
37
+ /** Class IRIs (T-box). Each is `<namespace><LocalName>`. */
38
+ export const CLASS = {
39
+ Agent: `${NS.ap}Agent`,
40
+ CanonicalAgentId: `${NS.ap}CanonicalAgentId`,
41
+ Facet: `${NS.ap}Facet`,
42
+ Evidence: `${NS.ap}Evidence`,
43
+ CredentialFacet: `${NS.apcr}CredentialFacet`,
44
+ NameFacet: `${NS.apnam}NameFacet`,
45
+ OidcSubject: `${NS.apid}OidcSubject`,
46
+ Org: `${NS.aporg}Org`,
47
+ };
48
+ /** Predicate / property IRIs (T-box). */
49
+ export const PREDICATE = {
50
+ isFacetOf: `${NS.apid}isFacetOf`,
51
+ controls: `${NS.apcr}controls`,
52
+ hasEvidence: `${NS.ap}hasEvidence`,
53
+ assurance: `${NS.ap}assurance`,
54
+ controlStatus: `${NS.ap}controlStatus`,
55
+ resolvesTo: `${NS.apnam}resolvesTo`,
56
+ memberOf: `${NS.aporg}memberOf`,
57
+ delegatesTo: `${NS.apdel}delegatesTo`,
58
+ };
59
+ /** SHACL shape IRIs (C-box). */
60
+ export const SHAPE = {
61
+ CanonicalAgentId: `${NS.ap}CanonicalAgentIdShape`,
62
+ CredentialFacet: `${NS.apcr}CredentialFacetShape`,
63
+ };
64
+ // `ARTIFACTS` + `artifactPath` (Node-only, `node:url`) live in the
65
+ // `@agenticprimitives/ontology/artifacts` subpath — keep this entry browser-safe.
66
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,EAAE;AACF,8EAA8E;AAC9E,2EAA2E;AAC3E,8EAA8E;AAC9E,2EAA2E;AAC3E,iDAAiD;AACjD,EAAE;AACF,OAAO;AACP,iDAAiD;AACjD,uFAAuF;AACvF,mGAAmG;AACnG,EAAE;AACF,yEAAyE;AACzE,6EAA6E;AAC7E,gFAAgF;AAChF,iFAAiF;AACjF,2CAA2C;AAE3C,+DAA+D;AAC/D,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAgB,CAAC;AAEjD;;;;GAIG;AACH,MAAM,CAAC,MAAM,EAAE,GAAG;IAChB,EAAE,EAAE,wCAAwC;IAC5C,IAAI,EAAE,4CAA4C;IAClD,IAAI,EAAE,8CAA8C;IACpD,KAAK,EAAE,8CAA8C;IACrD,KAAK,EAAE,2CAA2C;IAClD,KAAK,EAAE,yCAAyC;IAChD,KAAK,EAAE,0CAA0C;IACjD,KAAK,EAAE,iDAAiD;IACxD,KAAK,EAAE,uCAAuC;CACtC,CAAC;AAEX,4DAA4D;AAC5D,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,OAAO;IACtB,gBAAgB,EAAE,GAAG,EAAE,CAAC,EAAE,kBAAkB;IAC5C,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,OAAO;IACtB,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,UAAU;IAC5B,eAAe,EAAE,GAAG,EAAE,CAAC,IAAI,iBAAiB;IAC5C,SAAS,EAAE,GAAG,EAAE,CAAC,KAAK,WAAW;IACjC,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,aAAa;IACpC,GAAG,EAAE,GAAG,EAAE,CAAC,KAAK,KAAK;CACb,CAAC;AAEX,yCAAyC;AACzC,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,WAAW;IAChC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,UAAU;IAC9B,WAAW,EAAE,GAAG,EAAE,CAAC,EAAE,aAAa;IAClC,SAAS,EAAE,GAAG,EAAE,CAAC,EAAE,WAAW;IAC9B,aAAa,EAAE,GAAG,EAAE,CAAC,EAAE,eAAe;IACtC,UAAU,EAAE,GAAG,EAAE,CAAC,KAAK,YAAY;IACnC,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK,UAAU;IAC/B,WAAW,EAAE,GAAG,EAAE,CAAC,KAAK,aAAa;CAC7B,CAAC;AAEX,gCAAgC;AAChC,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,gBAAgB,EAAE,GAAG,EAAE,CAAC,EAAE,uBAAuB;IACjD,eAAe,EAAE,GAAG,EAAE,CAAC,IAAI,sBAAsB;CACzC,CAAC;AAEX,mEAAmE;AACnE,kFAAkF"}
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@agenticprimitives/ontology",
3
+ "version": "0.1.0-alpha.2",
4
+ "description": "Monorepo-wide formal vocabulary (RDFS/OWL T-box + SHACL/SKOS C-box + A-box fixtures) for agentic primitives. Off-chain source of truth the on-chain ontology (ADR-0009) instantiates. Ships TTL/JSON-LD artifacts + typed IRI constants.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/agentictrustlabs/agenticprimitives.git",
9
+ "directory": "packages/ontology"
10
+ },
11
+ "homepage": "https://github.com/agentictrustlabs/agenticprimitives/tree/master/packages/ontology",
12
+ "bugs": {
13
+ "url": "https://github.com/agentictrustlabs/agenticprimitives/issues"
14
+ },
15
+ "type": "module",
16
+ "main": "./dist/index.js",
17
+ "types": "./dist/index.d.ts",
18
+ "exports": {
19
+ ".": {
20
+ "types": "./dist/index.d.ts",
21
+ "import": "./dist/index.js"
22
+ },
23
+ "./artifacts": {
24
+ "types": "./dist/artifacts.d.ts",
25
+ "import": "./dist/artifacts.js"
26
+ }
27
+ },
28
+ "files": [
29
+ "LICENSE",
30
+ "dist",
31
+ "context.jsonld",
32
+ "tbox",
33
+ "cbox",
34
+ "abox",
35
+ "README.md"
36
+ ],
37
+ "scripts": {
38
+ "build": "tsc -p tsconfig.build.json",
39
+ "typecheck": "tsc -p tsconfig.json --noEmit",
40
+ "test": "vitest run",
41
+ "test:unit": "vitest run test/unit",
42
+ "test:integration": "vitest run test/integration --passWithNoTests",
43
+ "test:watch": "vitest",
44
+ "clean": "rm -rf dist"
45
+ },
46
+ "publishConfig": {
47
+ "access": "public"
48
+ },
49
+ "devDependencies": {
50
+ "vitest": "^2.1.0"
51
+ },
52
+ "keywords": [
53
+ "ontology",
54
+ "rdfs",
55
+ "owl",
56
+ "shacl",
57
+ "knowledge-graph",
58
+ "agentic"
59
+ ]
60
+ }
package/tbox/core.ttl ADDED
@@ -0,0 +1,71 @@
1
+ # T-box — core vocabulary for agentic primitives.
2
+ # RDFS/OWL terminology only (no instances, no constraints). Spec 225 §5.
3
+ # The on-chain OntologyTermRegistry / ShapeRegistry (ADR-0009) instantiate
4
+ # this vocabulary; off-chain TTL is the source of truth for the IRIs.
5
+
6
+ @prefix ap: <https://agenticprimitives.dev/ns/core#> .
7
+ @prefix apid: <https://agenticprimitives.dev/ns/identity#> .
8
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
9
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
10
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
11
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
12
+ @prefix prov: <http://www.w3.org/ns/prov#> .
13
+
14
+ ap: a owl:Ontology ;
15
+ rdfs:label "Agentic Primitives — core ontology" ;
16
+ owl:versionInfo "0.1.0" .
17
+
18
+ # ─── Classes ──────────────────────────────────────────────────────────
19
+
20
+ ap:Agent a owl:Class ;
21
+ rdfs:label "Agent" ;
22
+ rdfs:comment "The canonical ERC-4337 Smart Agent (ADR-0010). Every other node is a facet of, or edge to, an Agent. Identified by an ap:CanonicalAgentId." .
23
+
24
+ ap:CanonicalAgentId a owl:Class ;
25
+ rdfs:label "CanonicalAgentId" ;
26
+ rdfs:comment "A branded CAIP-10 account identifier (eip155:* / hedera:* / solana:*). The SSO subject + directory key (ADR-0016). Validated by ap:CanonicalAgentIdShape." .
27
+
28
+ # Agent-kind subclasses. agentKind is 3-valued (person/org/service; cbox); the
29
+ # kind hierarchy is OWL. treasury is NOT an agentKind — it is a KIND OF SERVICE.
30
+ ap:ServiceAgent a owl:Class ;
31
+ rdfs:subClassOf ap:Agent ;
32
+ rdfs:label "ServiceAgent" ;
33
+ rdfs:comment "An agent of kind 'service' (agentKind=service). Service profiles and treasuries are ServiceAgents." .
34
+
35
+ ap:Treasury a owl:Class ;
36
+ rdfs:subClassOf ap:ServiceAgent ;
37
+ rdfs:label "Treasury" ;
38
+ rdfs:comment "A custody-policy-governed asset account — a KIND OF SERVICE (agentKind=service), distinguished by ProfileType/serviceType='treasury' (specs 210/217/225 §6). NOT a top-level agent kind." .
39
+
40
+ ap:Facet a owl:Class ;
41
+ rdfs:label "Facet" ;
42
+ rdfs:comment "An abstract control/identity facet that points AT an Agent and rotates without changing it (ADR-0011). Subclasses: apcr:CredentialFacet, apnam:NameFacet, apid:OidcSubject." .
43
+
44
+ ap:Evidence a owl:Class ;
45
+ rdfs:subClassOf prov:Entity ;
46
+ rdfs:label "Evidence" ;
47
+ rdfs:comment "Provenance for an asserted edge: which source asserted it, when, at what block, and at what assurance (spec 223)." .
48
+
49
+ # ─── Properties ───────────────────────────────────────────────────────
50
+
51
+ apid:isFacetOf a owl:ObjectProperty ;
52
+ rdfs:label "isFacetOf" ;
53
+ rdfs:domain ap:Facet ;
54
+ rdfs:range ap:Agent ;
55
+ rdfs:comment "A facet points at exactly one Agent." .
56
+
57
+ ap:hasEvidence a owl:ObjectProperty ;
58
+ rdfs:label "hasEvidence" ;
59
+ rdfs:range ap:Evidence ;
60
+ rdfs:comment "Attaches provenance to an asserted association." .
61
+
62
+ ap:assurance a owl:DatatypeProperty ;
63
+ rdfs:label "assurance" ;
64
+ rdfs:range xsd:string ;
65
+ rdfs:comment "Ordered assurance level: unverified < asserted < onchain-read < onchain-confirmed (apcus:assurance vocabulary)." .
66
+
67
+ ap:controlStatus a owl:DatatypeProperty ;
68
+ rdfs:label "controlStatus" ;
69
+ rdfs:domain ap:CanonicalAgentId ;
70
+ rdfs:range xsd:string ;
71
+ rdfs:comment "Whether the subject is custodied here (custodied) or addressable-only (identifier-only). Non-EVM namespaces are identifier-only (spec 226 §4)." .
@@ -0,0 +1,54 @@
1
+ # T-box — identity/credential/naming/org facets. Spec 225 §5.
2
+
3
+ @prefix ap: <https://agenticprimitives.dev/ns/core#> .
4
+ @prefix apid: <https://agenticprimitives.dev/ns/identity#> .
5
+ @prefix apcr: <https://agenticprimitives.dev/ns/credential#> .
6
+ @prefix apnam: <https://agenticprimitives.dev/ns/naming#> .
7
+ @prefix aporg: <https://agenticprimitives.dev/ns/org#> .
8
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
9
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
10
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
11
+
12
+ apcr:CredentialFacet a owl:Class ;
13
+ rdfs:subClassOf ap:Facet ;
14
+ rdfs:label "CredentialFacet" ;
15
+ rdfs:comment "A control credential (passkey / SIWE-EOA / hardware / OIDC) that CONTROLS an Agent under its custody policy. Rotates without changing the Agent (ADR-0011). NEVER an owner." .
16
+
17
+ apnam:NameFacet a owl:Class ;
18
+ rdfs:subClassOf ap:Facet ;
19
+ rdfs:label "NameFacet" ;
20
+ rdfs:comment "A resolvable name (e.g. alice.agent) that resolves to an Agent. Decorative/display — never the sole authority (ADR-0006)." .
21
+
22
+ apid:OidcSubject a owl:Class ;
23
+ rdfs:subClassOf ap:Facet ;
24
+ rdfs:label "OidcSubject" ;
25
+ rdfs:comment "An OIDC issuer+subject claim recorded as a login facet, not custody (ADR-0017). Keyed on (iss, sub), never email." .
26
+
27
+ aporg:Org a owl:Class ;
28
+ rdfs:subClassOf ap:Agent ;
29
+ rdfs:label "Org" ;
30
+ rdfs:comment "An organization Agent with members (membership is informational; authority lives in custody/relationships)." .
31
+
32
+ # ─── Properties ───────────────────────────────────────────────────────
33
+
34
+ apcr:controls a owl:ObjectProperty ;
35
+ rdfs:label "controls" ;
36
+ rdfs:domain apcr:CredentialFacet ;
37
+ rdfs:range ap:Agent ;
38
+ rdfs:comment "A credential controls an Agent under custody policy — authorization, never ownership (ADR-0016)." .
39
+
40
+ apcr:credentialKind a owl:DatatypeProperty ;
41
+ rdfs:label "credentialKind" ;
42
+ rdfs:domain apcr:CredentialFacet ;
43
+ rdfs:range xsd:string ;
44
+ rdfs:comment "One of the apcr:credentialKind controlled vocabulary: passkey / siwe-eoa / hardware / oidc." .
45
+
46
+ apnam:resolvesTo a owl:ObjectProperty ;
47
+ rdfs:label "resolvesTo" ;
48
+ rdfs:domain apnam:NameFacet ;
49
+ rdfs:range ap:Agent .
50
+
51
+ aporg:memberOf a owl:ObjectProperty ;
52
+ rdfs:label "memberOf" ;
53
+ rdfs:domain ap:Agent ;
54
+ rdfs:range aporg:Org .