rag-wright 0.1.0__py3-none-any.whl

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.
Files changed (184) hide show
  1. rag_wright/__init__.py +13 -0
  2. rag_wright/api/__init__.py +33 -0
  3. rag_wright/api/config.py +59 -0
  4. rag_wright/api/discover.py +70 -0
  5. rag_wright/api/documents.py +39 -0
  6. rag_wright/api/ids.py +31 -0
  7. rag_wright/api/invoke.py +99 -0
  8. rag_wright/api/kg.py +61 -0
  9. rag_wright/api/mcp.py +94 -0
  10. rag_wright/api/usage.py +30 -0
  11. rag_wright/api/workspace.py +85 -0
  12. rag_wright/capabilities/__init__.py +8 -0
  13. rag_wright/capabilities/answer_generator.py +427 -0
  14. rag_wright/capabilities/ard.py +286 -0
  15. rag_wright/capabilities/assertion_extraction.py +79 -0
  16. rag_wright/capabilities/chunk_read.py +58 -0
  17. rag_wright/capabilities/chunk_write.py +163 -0
  18. rag_wright/capabilities/claim_extraction.py +153 -0
  19. rag_wright/capabilities/clause_exception_linking.py +117 -0
  20. rag_wright/capabilities/compliance_judgment.py +322 -0
  21. rag_wright/capabilities/compliance_store.py +87 -0
  22. rag_wright/capabilities/contract_kg_serve.py +156 -0
  23. rag_wright/capabilities/contract_kg_store.py +251 -0
  24. rag_wright/capabilities/dg_extraction.py +585 -0
  25. rag_wright/capabilities/disambiguation.py +163 -0
  26. rag_wright/capabilities/document_parse.py +87 -0
  27. rag_wright/capabilities/document_scope.py +49 -0
  28. rag_wright/capabilities/embedding.py +164 -0
  29. rag_wright/capabilities/embedding_profiles.py +43 -0
  30. rag_wright/capabilities/entity_resolution.py +154 -0
  31. rag_wright/capabilities/fusion.py +64 -0
  32. rag_wright/capabilities/graph_extraction.py +243 -0
  33. rag_wright/capabilities/graph_query.py +73 -0
  34. rag_wright/capabilities/graph_storage.py +111 -0
  35. rag_wright/capabilities/highlight_serve.py +142 -0
  36. rag_wright/capabilities/hybrid_search.py +65 -0
  37. rag_wright/capabilities/invoke.py +31 -0
  38. rag_wright/capabilities/jev_decision.py +38 -0
  39. rag_wright/capabilities/manifests.py +872 -0
  40. rag_wright/capabilities/okf_navigate.py +456 -0
  41. rag_wright/capabilities/parsing.py +286 -0
  42. rag_wright/capabilities/property_boosted_retrieval.py +125 -0
  43. rag_wright/capabilities/query_function_classifier.py +94 -0
  44. rag_wright/capabilities/query_understanding.py +109 -0
  45. rag_wright/capabilities/registry.py +262 -0
  46. rag_wright/capabilities/remote_encoders.py +94 -0
  47. rag_wright/capabilities/requirement_extraction.py +247 -0
  48. rag_wright/capabilities/reranking.py +123 -0
  49. rag_wright/capabilities/retrieval_core.py +126 -0
  50. rag_wright/capabilities/rlm_chunking.py +808 -0
  51. rag_wright/capabilities/rlm_synthesis.py +316 -0
  52. rag_wright/capabilities/scan_quality.py +136 -0
  53. rag_wright/capabilities/span_relevance_judgment.py +191 -0
  54. rag_wright/capabilities/vision_to_text.py +85 -0
  55. rag_wright/capabilities/vlm_ocr.py +85 -0
  56. rag_wright/contracts/__init__.py +6 -0
  57. rag_wright/contracts/chunk.py +79 -0
  58. rag_wright/contracts/compliance.py +303 -0
  59. rag_wright/contracts/contract_meta.py +27 -0
  60. rag_wright/contracts/extraction.py +130 -0
  61. rag_wright/contracts/function.py +167 -0
  62. rag_wright/contracts/function_routing.py +91 -0
  63. rag_wright/contracts/highlight.py +74 -0
  64. rag_wright/contracts/identifiers.py +153 -0
  65. rag_wright/contracts/jurisdiction.py +96 -0
  66. rag_wright/contracts/ontology.py +142 -0
  67. rag_wright/contracts/property.py +201 -0
  68. rag_wright/contracts/provenance.py +78 -0
  69. rag_wright/contracts/query_intent.py +53 -0
  70. rag_wright/contracts/span.py +76 -0
  71. rag_wright/contracts/value_match.py +84 -0
  72. rag_wright/corpus/__init__.py +0 -0
  73. rag_wright/corpus/canonicalize.py +116 -0
  74. rag_wright/corpus/cuad.py +153 -0
  75. rag_wright/corpus/cuad_ingestion.py +72 -0
  76. rag_wright/corpus/document_parser.py +299 -0
  77. rag_wright/corpus/edgar.py +231 -0
  78. rag_wright/corpus/gcs_ingestion.py +120 -0
  79. rag_wright/corpus/http.py +110 -0
  80. rag_wright/corpus/selection.py +152 -0
  81. rag_wright/mcp/__init__.py +11 -0
  82. rag_wright/mcp/compliance_server.py +299 -0
  83. rag_wright/mcp/intra_document_qa_server.py +170 -0
  84. rag_wright/mcp/relational_qa_server.py +171 -0
  85. rag_wright/mcp/session_store.py +64 -0
  86. rag_wright/mcp/typed_property_retrieval_server.py +191 -0
  87. rag_wright/models/__init__.py +8 -0
  88. rag_wright/models/profiles.py +331 -0
  89. rag_wright/models/seam.py +497 -0
  90. rag_wright/models/tag_structured.py +285 -0
  91. rag_wright/models/tracing.py +179 -0
  92. rag_wright/models/usage.py +102 -0
  93. rag_wright/okf/__init__.py +11 -0
  94. rag_wright/okf/compile.py +292 -0
  95. rag_wright/okf/document.py +47 -0
  96. rag_wright/okf/enrich.py +176 -0
  97. rag_wright/okf/links.py +190 -0
  98. rag_wright/okf/lint.py +105 -0
  99. rag_wright/ontology/__init__.py +6 -0
  100. rag_wright/ontology/_generated_template_meta.py +60 -0
  101. rag_wright/ontology/_generated_vocab.py +52 -0
  102. rag_wright/ontology/clause_template.py +964 -0
  103. rag_wright/ontology/codegen.py +84 -0
  104. rag_wright/ontology/compliance_bridge.ttl +186 -0
  105. rag_wright/ontology/contract_bridge.ttl +2685 -0
  106. rag_wright/ontology/contract_taxonomy.py +24 -0
  107. rag_wright/ontology/derive.py +58 -0
  108. rag_wright/ontology/loader.py +435 -0
  109. rag_wright/ontology/packs/ftc_16cfr255.ttl +29 -0
  110. rag_wright/ontology/registry.py +87 -0
  111. rag_wright/ontology/template_introspect.py +100 -0
  112. rag_wright/py.typed +0 -0
  113. rag_wright/reference/__init__.py +2 -0
  114. rag_wright/reference/compliance.py +41 -0
  115. rag_wright/reference/contract_seam.py +123 -0
  116. rag_wright/skills/__init__.py +7 -0
  117. rag_wright/skills/claim_extraction/SKILL.md +47 -0
  118. rag_wright/skills/claim_extraction/__init__.py +1 -0
  119. rag_wright/skills/claim_extraction/template.py +50 -0
  120. rag_wright/skills/compliance_judgment/SKILL.md +59 -0
  121. rag_wright/skills/corpus_ingest/SKILL.md +106 -0
  122. rag_wright/skills/extraction_semantic_judge/SKILL.md +51 -0
  123. rag_wright/skills/extraction_semantic_judge/__init__.py +1 -0
  124. rag_wright/skills/generation/SKILL.md +64 -0
  125. rag_wright/skills/generation/__init__.py +1 -0
  126. rag_wright/skills/generic_compliance_judgment/SKILL.md +58 -0
  127. rag_wright/skills/okf_navigate/SKILL.md +137 -0
  128. rag_wright/skills/requirement_extraction/SKILL.md +47 -0
  129. rag_wright/skills/requirement_extraction/__init__.py +1 -0
  130. rag_wright/skills/requirement_extraction/template.py +50 -0
  131. rag_wright/skills/rlm/SKILL.md +186 -0
  132. rag_wright/skills/rlm/__init__.py +31 -0
  133. rag_wright/skills/rlm/agent.py +292 -0
  134. rag_wright/skills/span_relevance_judgment/SKILL.md +67 -0
  135. rag_wright/skills/vision_to_text/SKILL.md +36 -0
  136. rag_wright/skills/vision_to_text/__init__.py +1 -0
  137. rag_wright/spans/__init__.py +1 -0
  138. rag_wright/spans/boundary.py +78 -0
  139. rag_wright/spans/clause_function_classifier.py +490 -0
  140. rag_wright/spans/clause_kg_extractor.py +337 -0
  141. rag_wright/spans/cuad_labels.py +81 -0
  142. rag_wright/spans/dim_classifier.py +158 -0
  143. rag_wright/spans/dim_fleet.json +411 -0
  144. rag_wright/spans/function_classifier.py +77 -0
  145. rag_wright/spans/function_families.py +62 -0
  146. rag_wright/spans/hybrid_classifier.py +103 -0
  147. rag_wright/spans/legalbert_classifier.py +83 -0
  148. rag_wright/spans/model_capabilities.py +107 -0
  149. rag_wright/spans/new_function_labels.py +111 -0
  150. rag_wright/spans/page_map.py +68 -0
  151. rag_wright/spans/property_extractor.py +365 -0
  152. rag_wright/spans/property_grounding.py +182 -0
  153. rag_wright/spans/reclassify.py +77 -0
  154. rag_wright/spans/scarce_function_labels.py +105 -0
  155. rag_wright/spans/segment.py +341 -0
  156. rag_wright/spans/semantic_judge.py +197 -0
  157. rag_wright/spans/symbolic_validation.py +131 -0
  158. rag_wright/spans/tag_clause_extractor.py +182 -0
  159. rag_wright/store/__init__.py +6 -0
  160. rag_wright/store/arcadedb.py +1135 -0
  161. rag_wright/store/chunk_text.py +66 -0
  162. rag_wright/store/seam.py +213 -0
  163. rag_wright/subgraphs/__init__.py +0 -0
  164. rag_wright/subgraphs/async_ingestion.py +204 -0
  165. rag_wright/subgraphs/compliance_check.py +1042 -0
  166. rag_wright/subgraphs/compliance_ingestion.py +306 -0
  167. rag_wright/subgraphs/contract_ingestion_pipeline.py +999 -0
  168. rag_wright/subgraphs/graph_extraction.py +102 -0
  169. rag_wright/subgraphs/intra_document_qa.py +328 -0
  170. rag_wright/subgraphs/observability.py +140 -0
  171. rag_wright/subgraphs/query_constraint_extraction.py +73 -0
  172. rag_wright/subgraphs/relational_qa.py +165 -0
  173. rag_wright/subgraphs/requirement_extraction.py +137 -0
  174. rag_wright/subgraphs/scaffold.py +65 -0
  175. rag_wright/subgraphs/semantic_chunking.py +183 -0
  176. rag_wright/subgraphs/typed_clause_extraction.py +172 -0
  177. rag_wright/subgraphs/typed_property_retrieval.py +278 -0
  178. rag_wright/util/__init__.py +1 -0
  179. rag_wright/util/concurrent.py +153 -0
  180. rag_wright/util/spacy_model.py +45 -0
  181. rag_wright-0.1.0.dist-info/METADATA +168 -0
  182. rag_wright-0.1.0.dist-info/RECORD +184 -0
  183. rag_wright-0.1.0.dist-info/WHEEL +4 -0
  184. rag_wright-0.1.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,84 @@
1
+ """ADR-0066 Phase 1: render the GENERATED Python contract vocabulary FROM the ontology `.ttl`.
2
+
3
+ The single place the ttl -> Python generation lives (imported by scripts/generate_contract_python.py to WRITE the
4
+ file, and by tests/ontology/test_generated_vocab_in_sync.py to ASSERT the committed file equals a fresh render).
5
+ The ttl is the source of truth (ADR-0066); the generated file is regenerable and CI-diff-enforced, never hand-
6
+ edited -- staleness is impossible by construction, not solved by moving truth back into code (Rule 2)."""
7
+
8
+ from __future__ import annotations
9
+
10
+ from pathlib import Path
11
+
12
+ from rag_wright.ontology.loader import load_contract_ontology, load_template_fields
13
+
14
+ VOCAB_MODULE_PATH = Path(__file__).with_name("_generated_vocab.py")
15
+ TEMPLATE_META_MODULE_PATH = Path(__file__).with_name("_generated_template_meta.py")
16
+
17
+ _HEADER = '''"""GENERATED FROM contract_bridge.ttl by scripts/generate_contract_python.py -- DO NOT EDIT BY HAND.
18
+
19
+ ADR-0066: the ontology `.ttl` is the single source of truth. To change the closed vocabulary, edit the ttl and
20
+ re-run the generator; a hand-edit here (or a stale regeneration) is caught by
21
+ tests/ontology/test_generated_vocab_in_sync.py."""
22
+
23
+ from __future__ import annotations
24
+
25
+ '''
26
+
27
+
28
+ def render_vocab_module() -> str:
29
+ """The exact text the generated vocab module must contain (deterministic: sorted dimensions + values)."""
30
+ view = load_contract_ontology()
31
+ lines = [_HEADER, "VOCAB: dict[str, frozenset[str]] = {"]
32
+ for dim in sorted(view.closed_vocab):
33
+ values = ", ".join(repr(v) for v in sorted(view.closed_vocab[dim]))
34
+ lines.append(f" {dim!r}: frozenset({{{values}}}),")
35
+ lines.append("}")
36
+ # issue 0037: ingest value synonyms (skos:broader surface -> canonical member), keyed by dimension then
37
+ # normalized surface term. Used by clause_kg_extractor to canonicalize an out-of-vocab extracted value.
38
+ lines.append("")
39
+ lines.append("VALUE_SYNONYMS: dict[str, dict[str, str]] = {")
40
+ for dim in sorted(view.value_synonyms):
41
+ pairs = ", ".join(f"{k!r}: {v!r}" for k, v in sorted(view.value_synonyms[dim].items()))
42
+ lines.append(f" {dim!r}: {{{pairs}}},")
43
+ lines.append("}")
44
+ # DD-7: the entity-graph taxonomy -- entity node types + entity-to-entity relationship types. Named constants
45
+ # (identifier = UPPER_SNAKE of the label) for ergonomic use, plus the two frozensets; `contract_taxonomy.py`
46
+ # re-exports these so no engine/domain code hardcodes the values (the ttl is the source of truth).
47
+ lines.append("")
48
+ for label in sorted(view.entity_types | view.relationship_types):
49
+ lines.append(f"{label.upper().replace(' ', '_')} = {label!r}")
50
+ ent = ", ".join(repr(v) for v in sorted(view.entity_types))
51
+ rel = ", ".join(repr(v) for v in sorted(view.relationship_types))
52
+ lines.append("")
53
+ lines.append(f"ENTITY_TYPES: frozenset[str] = frozenset({{{ent}}})")
54
+ lines.append(f"RELATIONSHIP_TYPES: frozenset[str] = frozenset({{{rel}}})")
55
+ return "\n".join(lines) + "\n"
56
+
57
+
58
+ _META_HEADER = '''"""GENERATED FROM contract_bridge.ttl by scripts/generate_contract_python.py -- DO NOT EDIT BY HAND.
59
+
60
+ ADR-0066 P1b-2 (Rule 3): the extraction template's KNOWLEDGE -- each field's LOOK-FOR description and examples,
61
+ generated from the ttl. `clause_template.py` CONSUMES this (via `_d()` / `_ex()`); the mechanism (validators,
62
+ normalizers, __str__, config) stays clean hand-code there. To change a description/example, edit the ttl and
63
+ re-run the generator; a hand-edit here is caught by tests/ontology/test_generated_template_meta_in_sync.py."""
64
+
65
+ from __future__ import annotations
66
+
67
+ '''
68
+
69
+
70
+ def render_template_meta_module() -> str:
71
+ """The generated template-knowledge module: `DESCRIPTIONS` + `EXAMPLES` keyed by `<Model>.<field>` (in the
72
+ template's declared field order). Empty descriptions are omitted (the accessor defaults to '')."""
73
+ specs = load_template_fields()
74
+ lines = [_META_HEADER, "DESCRIPTIONS: dict[str, str] = {"]
75
+ for s in specs:
76
+ if s.definition:
77
+ lines.append(f" {f'{s.model}.{s.name}'!r}: {s.definition!r},")
78
+ lines.append("}\n")
79
+ lines.append("EXAMPLES: dict[str, tuple[str, ...]] = {")
80
+ for s in specs:
81
+ if s.examples:
82
+ lines.append(f" {f'{s.model}.{s.name}'!r}: {tuple(s.examples)!r},")
83
+ lines.append("}")
84
+ return "\n".join(lines) + "\n"
@@ -0,0 +1,186 @@
1
+ # compliance_bridge.ttl — the compliance-module ontology (CC-1, roadmap §13.1).
2
+ #
3
+ # A small AUTHORED sibling to contract_bridge.ttl (NOT an edit of it — different domain, kept separate).
4
+ # Reuses the public deontic backbone (ODRL permission/prohibition/duty; LKIF obligation/permission/prohibition
5
+ # family) + PROV-O provenance + the same odrl:Constraint typed-dimension pattern the contract bridge uses for
6
+ # applicability. The thin advertising vocab (ClaimType) is authored here (closed). The rule/claim INSTANCES are
7
+ # extracted from text (CC-2/CC-3); this file is only the schema.
8
+
9
+ @prefix cmp: <https://ragwright.local/ontology/compliance-bridge#> .
10
+ @prefix odrl: <http://www.w3.org/ns/odrl/2/> .
11
+ @prefix lkif: <http://www.estrellaproject.org/lkif-core/norm.owl#> .
12
+ @prefix prov: <http://www.w3.org/ns/prov#> .
13
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
14
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
15
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
16
+ @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
17
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
18
+
19
+ <https://ragwright.local/ontology/compliance-bridge> a owl:Ontology ;
20
+ rdfs:label "RAG_Wright compliance bridge" ;
21
+ rdfs:comment "Two-sided compliance schema: deontic Requirement rules (ODRL/LKIF) + subject Claims, PROV-O provenance. Grounds the requirement_extraction / claim_extraction / compliance_judgment capabilities." .
22
+
23
+ # =============================================================================
24
+ # Deontic backbone — the rule's force. Reuse the public standards (ODRL/LKIF); our closed values map to them.
25
+ # =============================================================================
26
+ cmp:DeonticType a owl:Class ; skos:prefLabel "Deontic force" ;
27
+ owl:oneOf ( cmp:obligation cmp:prohibition cmp:permission ) .
28
+ cmp:obligation a cmp:DeonticType ; rdfs:subClassOf lkif:Obligation, odrl:Duty ; skos:prefLabel "obligation" .
29
+ cmp:prohibition a cmp:DeonticType ; rdfs:subClassOf lkif:Prohibition, odrl:Prohibition ; skos:prefLabel "prohibition" .
30
+ cmp:permission a cmp:DeonticType ; rdfs:subClassOf lkif:Permission, odrl:Permission ; skos:prefLabel "permission" .
31
+
32
+ # ADR-0066 P3c (Gap 1): the deontic CUES -- the lexical markers of operative normative force, per deontic type.
33
+ # The requirement-ingestion validity gate uses them: a section with NONE of these cues is non-operative (a
34
+ # definitions / purpose / scope statement) and is skipped SYMBOLICALLY -- replacing the brittle
35
+ # "definition"-in-heading keyword hack (domain-neutral, heading-agnostic). Linguistic KNOWLEDGE -> the ontology.
36
+ cmp:cue a owl:DatatypeProperty ; rdfs:domain cmp:DeonticType ; rdfs:range xsd:string ;
37
+ rdfs:comment "A lexical marker that this deontic force is present in a rule's text." .
38
+ cmp:obligation cmp:cue "must", "shall", "will", "required", "requires", "obligated", "responsible for", "agrees to" .
39
+ cmp:prohibition cmp:cue "must not", "shall not", "may not", "will not", "prohibited", "forbidden", "not permitted" .
40
+ cmp:permission cmp:cue "may", "permitted", "allowed", "entitled", "at its discretion", "reserves the right" .
41
+
42
+ # =============================================================================
43
+ # ADR-0066 P4a: Actor ROLE synonyms -- a canonical role (skos:prefLabel) + its surface variants (skos:altLabel).
44
+ # The query-side actor gate (canonical_actor) normalizes a rule's bound actor + a subject's role to the canonical
45
+ # form before matching, so 'manufacturer' aligns with 'advertiser'. Generic role KNOWLEDGE -> the ontology (a
46
+ # new customer domain extends this pack, not the code). Not owl:oneOf: an open, extensible SKOS role scheme.
47
+ #
48
+ # ADR-0068 (engine issue 0013): each role also declares a cmp:roleDomain -- the DISJOINTNESS knowledge the actor
49
+ # gate reasons over. The gate is RECALL-FIRST: two specific roles are treated as COMPATIBLE (a pair worth judging)
50
+ # unless the ontology makes them DISJOINT, and two roles are disjoint ONLY when both declare a roleDomain and the
51
+ # domains DIFFER. All the advertising-ecosystem roles share domain "advertising", so an advertiser rule pairs with
52
+ # a seller/endorser/consumer assertion (a seller advertising IS the advertiser) -- the fix for the silent drop
53
+ # where two independent extractions picked different-but-overlapping role words. A role with NO roleDomain (an
54
+ # unmodelled/exotic term) is compatible with everything (recall-first). Cross-DOMAIN narrowing (e.g. a labor
55
+ # 'employer' rule not judged against an advertising assertion) is a customer domain pack declaring its own roles
56
+ # under a different roleDomain -- never an engine edit.
57
+ # =============================================================================
58
+ cmp:ActorRole a owl:Class ; skos:prefLabel "Actor role" ;
59
+ rdfs:comment "A canonical party role a rule can bind or a subject can carry; skos:altLabel lists its synonyms." .
60
+ cmp:roleDomain a owl:DatatypeProperty ; skos:prefLabel "role domain" ;
61
+ rdfs:comment "The domain a canonical actor role belongs to (ADR-0068). Two roles are DISJOINT iff both declare a roleDomain and the domains differ; the actor gate excludes only disjoint role pairs (recall-first)." .
62
+ cmp:advertiser a cmp:ActorRole ; skos:prefLabel "advertiser" ; cmp:roleDomain "advertising" ;
63
+ skos:altLabel "manufacturer", "marketer", "brand", "company", "business", "sponsor" .
64
+ cmp:endorser a cmp:ActorRole ; skos:prefLabel "endorser" ; cmp:roleDomain "advertising" ;
65
+ skos:altLabel "influencer", "spokesperson", "ambassador", "reviewer" .
66
+ cmp:expert a cmp:ActorRole ; skos:prefLabel "expert" ; cmp:roleDomain "advertising" ;
67
+ skos:altLabel "physician", "doctor", "specialist", "professional" .
68
+ cmp:consumer a cmp:ActorRole ; skos:prefLabel "consumer" ; cmp:roleDomain "advertising" ;
69
+ skos:altLabel "buyer", "customer", "user" .
70
+ cmp:seller a cmp:ActorRole ; skos:prefLabel "seller" ; cmp:roleDomain "advertising" ;
71
+ skos:altLabel "merchant", "retailer", "vendor" .
72
+
73
+ # =============================================================================
74
+ # Requirement — a single regulatory rule (the rulebook side). requirement_id = <source_reg>:<section>:<hash>.
75
+ # =============================================================================
76
+ cmp:Requirement a owl:Class ; skos:prefLabel "Requirement" ;
77
+ rdfs:comment "One deontic rule extracted from a regulatory corpus; always carries a citation (PROV)." .
78
+ cmp:deonticType a owl:ObjectProperty, owl:FunctionalProperty ; rdfs:domain cmp:Requirement ; rdfs:range cmp:DeonticType .
79
+ cmp:actor a owl:DatatypeProperty ; rdfs:domain cmp:Requirement ; rdfs:range xsd:string ;
80
+ skos:prefLabel "bound actor" ; rdfs:comment "Who the rule binds: advertiser, endorser, ..." .
81
+ cmp:requirementText a owl:DatatypeProperty, owl:FunctionalProperty ; rdfs:domain cmp:Requirement ; rdfs:range xsd:string .
82
+ cmp:citation a owl:DatatypeProperty, owl:FunctionalProperty ; rdfs:domain cmp:Requirement ; rdfs:range xsd:string ;
83
+ rdfs:subPropertyOf prov:wasDerivedFrom ; rdfs:comment "Section/paragraph provenance; always present (FR-Q.6)." .
84
+ cmp:evidenceStandard a owl:DatatypeProperty ; rdfs:domain cmp:Requirement ; rdfs:range xsd:string .
85
+ cmp:severity a owl:DatatypeProperty ; rdfs:domain cmp:Requirement ; rdfs:range cmp:Severity .
86
+
87
+ # ADR-0066 P3b: Severity is a closed vocab (completes the ontology; was an open xsd:string). low/med/high.
88
+ cmp:Severity a owl:Class ; skos:prefLabel "Severity" ; owl:oneOf ( cmp:low cmp:med cmp:high ) .
89
+ cmp:low a cmp:Severity . cmp:med a cmp:Severity . cmp:high a cmp:Severity .
90
+
91
+ # Applicability — typed (dimension, value) conditions the rule applies under. Same odrl:Constraint pattern as
92
+ # the contract bridge, matched against a Claim's scope by the reused retrieval router (CC-6).
93
+ cmp:ApplicabilityConstraint a owl:Class ; rdfs:subClassOf odrl:Constraint ; skos:prefLabel "Applicability condition" .
94
+ cmp:dimension a owl:DatatypeProperty, owl:FunctionalProperty ; rdfs:domain cmp:ApplicabilityConstraint ; rdfs:range xsd:string .
95
+ cmp:value a owl:DatatypeProperty, owl:FunctionalProperty ; rdfs:domain cmp:ApplicabilityConstraint ; rdfs:range xsd:string .
96
+ cmp:hasApplicabilityScope a owl:ObjectProperty ; rdfs:domain cmp:Requirement ; rdfs:range cmp:ApplicabilityConstraint .
97
+
98
+ # =============================================================================
99
+ # Claim — a checkable element from the SUBJECT document (the ad side). claim_id + span = provenance.
100
+ # =============================================================================
101
+ cmp:Claim a owl:Class ; skos:prefLabel "Claim" ;
102
+ rdfs:comment "One checkable assertion extracted from a subject document (ad), cited to its span (PROV)." .
103
+ cmp:ClaimType a owl:Class ; skos:prefLabel "Claim type" ;
104
+ owl:oneOf ( cmp:efficacy cmp:comparative cmp:pricing cmp:health cmp:environmental cmp:endorsement cmp:performance cmp:guarantee ) .
105
+ cmp:efficacy a cmp:ClaimType . cmp:comparative a cmp:ClaimType . cmp:pricing a cmp:ClaimType .
106
+ cmp:health a cmp:ClaimType . cmp:environmental a cmp:ClaimType . cmp:endorsement a cmp:ClaimType .
107
+ cmp:performance a cmp:ClaimType . cmp:guarantee a cmp:ClaimType .
108
+ cmp:claimType a owl:ObjectProperty, owl:FunctionalProperty ; rdfs:domain cmp:Claim ; rdfs:range cmp:ClaimType .
109
+ cmp:assertionText a owl:DatatypeProperty, owl:FunctionalProperty ; rdfs:domain cmp:Claim ; rdfs:range xsd:string .
110
+ cmp:disclosurePresent a owl:DatatypeProperty ; rdfs:domain cmp:Claim ; rdfs:range xsd:string .
111
+ cmp:evidenceReferenced a owl:DatatypeProperty, owl:FunctionalProperty ; rdfs:domain cmp:Claim ; rdfs:range xsd:boolean .
112
+ cmp:medium a owl:DatatypeProperty ; rdfs:domain cmp:Claim ; rdfs:range xsd:string .
113
+ cmp:hasSpan a owl:ObjectProperty, owl:FunctionalProperty ; rdfs:domain cmp:Claim ; rdfs:range prov:Entity ;
114
+ rdfs:comment "The subject-document span the claim was read from (provenance, cited)." .
115
+
116
+ # =============================================================================
117
+ # RuleScope — how a requirement is narrowed at check time (CC-8a, the ontology routing tag). content = narrow by
118
+ # semantic similarity to the claim; context = apply to any claim in an endorsement (always included, e.g. §255.5).
119
+ # =============================================================================
120
+ cmp:RuleScope a owl:Class ; skos:prefLabel "Rule scope" ; owl:oneOf ( cmp:content cmp:context ) .
121
+ cmp:content a cmp:RuleScope ; skos:prefLabel "content rule (substantiation / claim-specific)" .
122
+ cmp:context a cmp:RuleScope ; skos:prefLabel "context rule (disclosure; applies regardless of claim content)" .
123
+ cmp:ruleScope a owl:ObjectProperty, owl:FunctionalProperty ; rdfs:domain cmp:Requirement ; rdfs:range cmp:RuleScope .
124
+
125
+ # =============================================================================
126
+ # ADR-0066 P4b: SectionOverride -- a DOMAIN PACK's curated per-section override (DEON-1 rule scope + DEON-8
127
+ # applicable claim types). The engine ontology declares the SHAPE here; the INSTANCES live in a domain-pack ttl
128
+ # (e.g. packs/ftc_16cfr255.ttl). A customer domain ships its own pack; nothing is FTC-hardcoded in code.
129
+ # =============================================================================
130
+ cmp:SectionOverride a owl:Class ; skos:prefLabel "Section override" ;
131
+ rdfs:comment "Pins a cited section's rule scope and/or its applicable claim types; a domain pack provides instances." .
132
+ cmp:section a owl:DatatypeProperty, owl:FunctionalProperty ; rdfs:domain cmp:SectionOverride ; rdfs:range xsd:string ;
133
+ rdfs:comment "The section citation this override applies to, e.g. '255.5'." .
134
+ cmp:overrideRuleScope a owl:ObjectProperty, owl:FunctionalProperty ; rdfs:domain cmp:SectionOverride ; rdfs:range cmp:RuleScope .
135
+ cmp:appliesToAllClaimTypes a owl:DatatypeProperty, owl:FunctionalProperty ; rdfs:domain cmp:SectionOverride ; rdfs:range xsd:boolean ;
136
+ rdfs:comment "true -> the section applies to ALL claim types; false with no cmp:appliesToClaimType -> none (e.g. a definitions section)." .
137
+ cmp:appliesToClaimType a owl:ObjectProperty ; rdfs:domain cmp:SectionOverride ; rdfs:range cmp:ClaimType ;
138
+ rdfs:comment "A specific claim type the section applies to (used only when cmp:appliesToAllClaimTypes is false)." .
139
+
140
+ # =============================================================================
141
+ # Verdict — the judgment output (CC-4). Closed vocab; every 'violation' is human-gated before it leaves.
142
+ # =============================================================================
143
+ cmp:Verdict a owl:Class ; skos:prefLabel "Compliance verdict" ;
144
+ owl:oneOf ( cmp:compliant cmp:violation cmp:needs_review ) .
145
+ cmp:compliant a cmp:Verdict . cmp:violation a cmp:Verdict . cmp:needs_review a cmp:Verdict .
146
+
147
+ # =============================================================================
148
+ # Decision criteria (ADR-0119) — the typed-decision (Jev) question knowledge, authored here (NOT in capability
149
+ # code) per ADR-0066. `cmp:decisionCriterion` is a vocab member's one-line criterion for a yes/no (noul) or a
150
+ # choice option; `cmp:DecisionQuestion` holds a binary gate's instructions + true/false criteria. The engine's
151
+ # `jev_decision` question-builder reads these from the ttl; the few-shot/prompt framing stays a code overlay.
152
+ # =============================================================================
153
+ cmp:decisionCriterion a owl:DatatypeProperty ; rdfs:range xsd:string ;
154
+ skos:prefLabel "decision criterion" ;
155
+ rdfs:comment "A one-line criterion for a vocab member as a typed-decision answer option (ADR-0119)." .
156
+
157
+ # ClaimType criteria (the 8 noul questions: 'does this rule apply to <type> claims?')
158
+ cmp:efficacy cmp:decisionCriterion "the product WORKS / is effective at its purpose (cures, treats, achieves the promised result); NOT mere speed/durability" .
159
+ cmp:comparative cmp:decisionCriterion "COMPARES the product to competitors or alternatives (better than, #1, versus)" .
160
+ cmp:pricing cmp:decisionCriterion "PRICE, discount, 'reduced', 'free', 2-for-1, or savings" .
161
+ cmp:health cmp:decisionCriterion "HEALTH, medical, disease, nutrition, or bodily-safety" .
162
+ cmp:environmental cmp:decisionCriterion "ENVIRONMENTAL / green / eco / sustainable / biodegradable" .
163
+ cmp:endorsement cmp:decisionCriterion "ENDORSEMENTS, testimonials, reviews, or who may endorse" .
164
+ cmp:performance cmp:decisionCriterion "measurable HOW-WELL -- speed, durability, strength, capacity, output level (not merely that it works)" .
165
+ cmp:guarantee cmp:decisionCriterion "a GUARANTEE, warranty, or money-back promise" .
166
+
167
+ # ActorRole criteria (the actor `choice` options) + the workplace-domain `employer` role (OSHA).
168
+ cmp:advertiser cmp:decisionCriterion "the advertiser / marketer / manufacturer / brand making the claim" .
169
+ cmp:endorser cmp:decisionCriterion "the endorser / testimonial-giver / reviewer / influencer" .
170
+ cmp:expert cmp:decisionCriterion "an expert whose evaluation is relied upon" .
171
+ cmp:seller cmp:decisionCriterion "the seller / vendor / retailer, when named distinctly" .
172
+ cmp:consumer cmp:decisionCriterion "the consumer / customer / audience" .
173
+ cmp:employer a cmp:ActorRole ; skos:prefLabel "employer" ; cmp:roleDomain "workplace" ;
174
+ skos:altLabel "establishment", "worksite", "employing entity" ;
175
+ cmp:decisionCriterion "the employer responsible (workplace safety / injury recordkeeping)" .
176
+
177
+ # The operative-rule binary gate (ADR-0119): is a span itself a binding rule?
178
+ cmp:DecisionQuestion a owl:Class ; skos:prefLabel "Decision question" ;
179
+ rdfs:comment "A typed yes/no decision: instructions + the true/false criteria a decision model is asked." .
180
+ cmp:questionInstructions a owl:DatatypeProperty ; rdfs:domain cmp:DecisionQuestion ; rdfs:range xsd:string .
181
+ cmp:criterionTrue a owl:DatatypeProperty ; rdfs:domain cmp:DecisionQuestion ; rdfs:range xsd:string .
182
+ cmp:criterionFalse a owl:DatatypeProperty ; rdfs:domain cmp:DecisionQuestion ; rdfs:range xsd:string .
183
+ cmp:operativeRuleQuestion a cmp:DecisionQuestion ;
184
+ cmp:questionInstructions "Is this sentence itself a BINDING operative rule (obligation/prohibition/permission or a binding liability/conditional consequence)?" ;
185
+ cmp:criterionTrue "it binds conduct directly" ;
186
+ cmp:criterionFalse "an illustrative example, definition, scope, cross-reference, negated requirement, or descriptive remark" .