textgraph-kg 3.2.0__tar.gz → 3.3.0__tar.gz

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 (232) hide show
  1. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/CHANGELOG.md +40 -0
  2. textgraph_kg-3.3.0/LICENSE +21 -0
  3. textgraph_kg-3.2.0/README.md → textgraph_kg-3.3.0/PKG-INFO +143 -9
  4. textgraph_kg-3.2.0/PKG-INFO → textgraph_kg-3.3.0/README.md +51 -80
  5. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/docs/COMPARISON_SEMANTICA.md +3 -2
  6. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/docs/RUNNING.md +10 -4
  7. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/pyproject.toml +27 -1
  8. textgraph_kg-3.3.0/tests/unit/test_export_rdf.py +95 -0
  9. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/__init__.py +1 -1
  10. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/cli.py +20 -4
  11. textgraph_kg-3.3.0/textgraph/l9_artifacts/ontology.py +125 -0
  12. textgraph_kg-3.3.0/textgraph/l9_artifacts/rdf.py +125 -0
  13. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/uv.lock +4 -4
  14. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/.gitattributes +0 -0
  15. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/.github/workflows/benchmark.yml +0 -0
  16. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/.github/workflows/determinism.yml +0 -0
  17. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/.github/workflows/lint-and-typecheck.yml +0 -0
  18. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/.github/workflows/pages.yml +0 -0
  19. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/.github/workflows/pre-commit.yml +0 -0
  20. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/.github/workflows/publish-pypi.yml +0 -0
  21. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/.github/workflows/release.yml +0 -0
  22. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/.github/workflows/test.yml +0 -0
  23. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/.gitignore +0 -0
  24. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/.pre-commit-config.yaml +0 -0
  25. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/ARCHITECTURE.md +0 -0
  26. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/BENCHMARKS.md +0 -0
  27. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/PLAN.md +0 -0
  28. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/SECURITY.md +0 -0
  29. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/TextGraph Architecture Gap Analysis.docx +0 -0
  30. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/TextGraph_Engineering_Blueprint.pdf +0 -0
  31. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/benchmarks/__init__.py +0 -0
  32. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/benchmarks/quality.py +0 -0
  33. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/benchmarks/reasoning.py +0 -0
  34. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/benchmarks/retrieval.py +0 -0
  35. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/benchmarks/run.py +0 -0
  36. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/benchmarks/security.py +0 -0
  37. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/docs/SKILL.md +0 -0
  38. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/docs/how-it-works.md +0 -0
  39. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/docs/plans/chat-console.md +0 -0
  40. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/docs/plans/neo4j-backend.md +0 -0
  41. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/docs/retrieval-routing.md +0 -0
  42. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/docs/site/index.html +0 -0
  43. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/requirements-dev.txt +0 -0
  44. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/requirements-full.txt +0 -0
  45. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/requirements.txt +0 -0
  46. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/schema/graph.schema.json +0 -0
  47. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/schema/manifest.schema.json +0 -0
  48. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/schema/schema.yaml +0 -0
  49. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/schema/validate.py +0 -0
  50. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/__init__.py +0 -0
  51. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/determinism/test_byte_identical.py +0 -0
  52. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/fixtures/README.md +0 -0
  53. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/fixtures/corpora/adr/adr-0007-case-linking.md +0 -0
  54. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/fixtures/corpora/adr/adr-0008-retention.md +0 -0
  55. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/fixtures/corpora/chat/case-4471.chat +0 -0
  56. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/fixtures/corpora/conflict/filing-a.md +0 -0
  57. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/fixtures/corpora/conflict/filing-b.md +0 -0
  58. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/fixtures/corpora/contradiction/filing.md +0 -0
  59. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/fixtures/corpora/decision_chain/adr-0001-retention.md +0 -0
  60. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/fixtures/corpora/decision_chain/adr-0002-citations.md +0 -0
  61. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/fixtures/corpora/decision_chain/adr-0003-tooling.md +0 -0
  62. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/fixtures/corpora/docs/aml-overview.md +0 -0
  63. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/fixtures/corpora/docs/shell-company.md +0 -0
  64. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/fixtures/corpora/docs/wire-transfers.md +0 -0
  65. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/fixtures/corpora/secure/public.md +0 -0
  66. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/fixtures/corpora/secure/secret.md +0 -0
  67. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/fixtures/corpora/temporal/correction.md +0 -0
  68. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/fixtures/corpus_docs/adr-0001.md +0 -0
  69. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/fixtures/corpus_docs/mixed-encoding.log +0 -0
  70. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/fixtures/corpus_docs/notes.txt +0 -0
  71. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/fixtures/er/aliases.md +0 -0
  72. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/integration/test_agent_session.py +0 -0
  73. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/integration/test_artifacts.py +0 -0
  74. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/integration/test_duckdb_store.py +0 -0
  75. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/integration/test_edge_provenance.py +0 -0
  76. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/integration/test_er_pipeline.py +0 -0
  77. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/integration/test_ie_pipeline.py +0 -0
  78. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/integration/test_incremental.py +0 -0
  79. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/integration/test_incremental_stress.py +0 -0
  80. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/integration/test_provenance_integrity.py +0 -0
  81. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/integration/test_quality_benchmark.py +0 -0
  82. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/integration/test_report_corpora.py +0 -0
  83. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/integration/test_security_redteam.py +0 -0
  84. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_canonical_doc.py +0 -0
  85. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_canonical_json.py +0 -0
  86. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_chat.py +0 -0
  87. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_chat_decisions.py +0 -0
  88. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_cli.py +0 -0
  89. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_config.py +0 -0
  90. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_conflicts.py +0 -0
  91. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_console.py +0 -0
  92. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_content_address.py +0 -0
  93. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_decision_chain.py +0 -0
  94. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_decisions.py +0 -0
  95. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_dense.py +0 -0
  96. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_doctor.py +0 -0
  97. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_gliner_backend.py +0 -0
  98. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_got.py +0 -0
  99. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_gql.py +0 -0
  100. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_ingest.py +0 -0
  101. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_integrations.py +0 -0
  102. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_l0_ingest.py +0 -0
  103. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_l1_structure.py +0 -0
  104. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_l2_linguistic.py +0 -0
  105. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_l3_encoder_ie.py +0 -0
  106. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_l4_llm.py +0 -0
  107. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_l5_resolution.py +0 -0
  108. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_l6_claims.py +0 -0
  109. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_l7_analytics.py +0 -0
  110. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_l7_layout.py +0 -0
  111. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_l8_retrieval.py +0 -0
  112. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_llm_augment.py +0 -0
  113. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_mcp_tools.py +0 -0
  114. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_offsets.py +0 -0
  115. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_richdocs.py +0 -0
  116. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_routing.py +0 -0
  117. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_security.py +0 -0
  118. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/tests/unit/test_vision.py +0 -0
  119. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/console/__init__.py +0 -0
  120. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/console/api.py +0 -0
  121. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/console/chat.py +0 -0
  122. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/console/ingest.py +0 -0
  123. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/console/page.py +0 -0
  124. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/console/renderer.py +0 -0
  125. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/console/server.py +0 -0
  126. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/core/__init__.py +0 -0
  127. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/core/canonical_doc.py +0 -0
  128. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/core/canonical_json.py +0 -0
  129. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/core/config.py +0 -0
  130. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/core/content_address.py +0 -0
  131. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/core/incremental.py +0 -0
  132. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/core/layout.py +0 -0
  133. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/core/offsets.py +0 -0
  134. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/doctor.py +0 -0
  135. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/got/__init__.py +0 -0
  136. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/got/reason.py +0 -0
  137. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/got/thought.py +0 -0
  138. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/gql/__init__.py +0 -0
  139. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/gql/ast.py +0 -0
  140. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/gql/engine.py +0 -0
  141. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/gql/errors.py +0 -0
  142. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/gql/parser.py +0 -0
  143. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/gql/tokenizer.py +0 -0
  144. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/integrations/__init__.py +0 -0
  145. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/integrations/adapters.py +0 -0
  146. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l0_ingest/__init__.py +0 -0
  147. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l0_ingest/base.py +0 -0
  148. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l0_ingest/dispatch.py +0 -0
  149. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l0_ingest/logs.py +0 -0
  150. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l0_ingest/markdown.py +0 -0
  151. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l0_ingest/plaintext.py +0 -0
  152. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l0_ingest/richdocs.py +0 -0
  153. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l0_ingest/structured.py +0 -0
  154. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l0_ingest/transcript.py +0 -0
  155. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l1_structure/__init__.py +0 -0
  156. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l1_structure/decisions.py +0 -0
  157. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l1_structure/emit.py +0 -0
  158. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l1_structure/structure.py +0 -0
  159. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l2_linguistic/__init__.py +0 -0
  160. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l2_linguistic/negation.py +0 -0
  161. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l2_linguistic/sentences.py +0 -0
  162. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l3_encoder_ie/__init__.py +0 -0
  163. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l3_encoder_ie/canonicalize.py +0 -0
  164. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l3_encoder_ie/emit_ie.py +0 -0
  165. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l3_encoder_ie/extract.py +0 -0
  166. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l3_encoder_ie/gliner_backend.py +0 -0
  167. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l3_encoder_ie/model.py +0 -0
  168. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l3_encoder_ie/rules.py +0 -0
  169. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l4_llm_optional/__init__.py +0 -0
  170. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l4_llm_optional/cache.py +0 -0
  171. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l4_llm_optional/client.py +0 -0
  172. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l4_llm_optional/extract.py +0 -0
  173. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l4_llm_optional/synthesize.py +0 -0
  174. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l5_entity_resolution/__init__.py +0 -0
  175. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l5_entity_resolution/audit.py +0 -0
  176. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l5_entity_resolution/blocking.py +0 -0
  177. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l5_entity_resolution/clustering.py +0 -0
  178. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l5_entity_resolution/emit_er.py +0 -0
  179. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l5_entity_resolution/metrics.py +0 -0
  180. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l5_entity_resolution/model.py +0 -0
  181. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l5_entity_resolution/resolve.py +0 -0
  182. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l5_entity_resolution/scoring.py +0 -0
  183. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l5_entity_resolution/similarity.py +0 -0
  184. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l5_entity_resolution/splink_backend.py +0 -0
  185. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l6_graph_model/__init__.py +0 -0
  186. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l6_graph_model/claims.py +0 -0
  187. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l6_graph_model/conflicts.py +0 -0
  188. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l6_graph_model/temporal.py +0 -0
  189. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l7_analytics/__init__.py +0 -0
  190. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l7_analytics/algorithms.py +0 -0
  191. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l7_analytics/analyze.py +0 -0
  192. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l7_analytics/communities.py +0 -0
  193. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l7_analytics/enrich.py +0 -0
  194. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l7_analytics/layout.py +0 -0
  195. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l8_retrieval/__init__.py +0 -0
  196. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l8_retrieval/bm25.py +0 -0
  197. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l8_retrieval/dense.py +0 -0
  198. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l8_retrieval/emit_chunks.py +0 -0
  199. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l8_retrieval/engine.py +0 -0
  200. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l8_retrieval/grounding.py +0 -0
  201. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l8_retrieval/model.py +0 -0
  202. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l8_retrieval/narrate.py +0 -0
  203. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l8_retrieval/rerank.py +0 -0
  204. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l8_retrieval/routing.py +0 -0
  205. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l8_retrieval/vision/__init__.py +0 -0
  206. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l8_retrieval/vision/embed.py +0 -0
  207. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l8_retrieval/vision/maxsim.py +0 -0
  208. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l8_retrieval/vision/retriever.py +0 -0
  209. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l9_artifacts/__init__.py +0 -0
  210. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l9_artifacts/analytics_lite.py +0 -0
  211. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l9_artifacts/artifacts.py +0 -0
  212. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l9_artifacts/graph_html.py +0 -0
  213. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l9_artifacts/graph_json.py +0 -0
  214. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l9_artifacts/prov.py +0 -0
  215. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/l9_artifacts/report.py +0 -0
  216. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/mcp/__init__.py +0 -0
  217. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/mcp/server.py +0 -0
  218. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/mcp/tools.py +0 -0
  219. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/pipeline.py +0 -0
  220. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/security/__init__.py +0 -0
  221. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/security/abac.py +0 -0
  222. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/security/context.py +0 -0
  223. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/security/policy.py +0 -0
  224. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/security/rebac.py +0 -0
  225. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/store/__init__.py +0 -0
  226. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/store/base.py +0 -0
  227. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/store/duckdb_store.py +0 -0
  228. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/store/memory.py +0 -0
  229. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph/watch.py +0 -0
  230. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/textgraph-engineering-research.md +0 -0
  231. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/ui/graph_html/README.md +0 -0
  232. {textgraph_kg-3.2.0 → textgraph_kg-3.3.0}/ui/pipeline_console/README.md +0 -0
@@ -6,6 +6,46 @@ to Semantic Versioning.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [3.3.0] - 2026-08-08
10
+
11
+ **Semantic-web interop — closing the RDF / ontology gap with polyglot peers.** New
12
+ deterministic, dependency-free exports so the graph loads into any triple store and
13
+ validates in any semantic-web toolchain.
14
+
15
+ ### Added
16
+ - **RDF/Turtle export** — `textgraph export --format rdf` emits the whole graph as Turtle
17
+ (loads into Oxigraph / Apache Jena / RDF4J / any SPARQL store): nodes typed by their
18
+ labels, relations as `tgr:` predicates, and **every cited edge reified as an
19
+ `rdf:Statement`** carrying the `ConfidenceTag` + the re-verifiable byte span
20
+ (`prov:wasDerivedFrom`, `tgo:sourceStart/End/Hash`) — provenance survives the round-trip
21
+ (G3). Validated with rdflib; pure-string, no RDF dependency.
22
+ - **OWL vocabulary export** — `--format owl` emits `owl:Class` per node label,
23
+ `owl:ObjectProperty` per relation predicate (with induced `rdfs:domain`/`range`), and
24
+ `owl:DatatypeProperty` per scalar key.
25
+ - **SHACL shapes export** — `--format shacl` emits a `sh:NodeShape` per class with
26
+ constraints (label cardinality, per-predicate `sh:class`) **induced from the actual data**
27
+ — validate the graph in pySHACL / TopBraid / Jena.
28
+
29
+ All four export formats (`rdf`, `owl`, `shacl`, `prov-o`) are byte-deterministic (G1).
30
+
31
+ ## [3.2.1] - 2026-08-08
32
+
33
+ **Packaging & presentation polish** (no code/API changes). Makes the PyPI page and repo
34
+ look the part next to [Semantica](docs/COMPARISON_SEMANTICA.md).
35
+
36
+ ### Added
37
+ - **`LICENSE`** file (MIT) — so the license is detectable on GitHub and shipped in the sdist.
38
+ - **PyPI project metadata** — `[project.urls]` (Homepage / Repository / Documentation /
39
+ Changelog / Live demo / Bug Tracker → the PyPI sidebar) and trove `classifiers` (Python
40
+ versions, MIT, audiences, topics), plus `license-files`.
41
+ - **README** — a compact **TextGraph vs. Semantica** section (where TextGraph leads: byte-
42
+ identical builds, re-hashable citations, zero-LLM core; and the honest roadmap: RDF store,
43
+ OWL/SHACL, more providers/vector stores). A **Python-API** quick start alongside the CLI.
44
+
45
+ ### Fixed
46
+ - **Broken README badges** — the CI badge pointed at a non-existent `ci.yml`; replaced with
47
+ working **tests** + **determinism** workflow badges and an MIT license badge.
48
+
9
49
  ## [3.2.0] - 2026-08-08
10
50
 
11
51
  **TextGraph 3.2 — LLM-augmented intelligence, without losing the moat.** Adds semantic
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 krishddd
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.
@@ -1,14 +1,107 @@
1
+ Metadata-Version: 2.4
2
+ Name: textgraph-kg
3
+ Version: 3.3.0
4
+ Summary: Turn any textual corpus into a queryable knowledge graph with byte-level provenance on every claim. Local-first, deterministic, zero-LLM-by-default.
5
+ Project-URL: Homepage, https://krishddd.github.io/Wiki_textgraph/
6
+ Project-URL: Repository, https://github.com/krishddd/Wiki_textgraph
7
+ Project-URL: Documentation, https://github.com/krishddd/Wiki_textgraph/blob/main/docs/RUNNING.md
8
+ Project-URL: Changelog, https://github.com/krishddd/Wiki_textgraph/blob/main/CHANGELOG.md
9
+ Project-URL: Live demo, https://krishddd.github.io/Wiki_textgraph/
10
+ Project-URL: Bug Tracker, https://github.com/krishddd/Wiki_textgraph/issues
11
+ Author: krishddd
12
+ License: MIT
13
+ License-File: LICENSE
14
+ Keywords: deterministic,information-extraction,knowledge-graph,mcp,provenance,rag
15
+ Classifier: Development Status :: 5 - Production/Stable
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Intended Audience :: Financial and Insurance Industry
18
+ Classifier: Intended Audience :: Legal Industry
19
+ Classifier: License :: OSI Approved :: MIT License
20
+ Classifier: Operating System :: OS Independent
21
+ Classifier: Programming Language :: Python :: 3
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Programming Language :: Python :: 3.13
25
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
26
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
27
+ Classifier: Topic :: Text Processing :: Linguistic
28
+ Classifier: Typing :: Typed
29
+ Requires-Python: >=3.11
30
+ Requires-Dist: blake3>=0.4.1
31
+ Requires-Dist: markdown-it-py>=3.0.0
32
+ Requires-Dist: pypdf>=4.0.0
33
+ Requires-Dist: pyyaml>=6.0
34
+ Provides-Extra: dev
35
+ Requires-Dist: jsonschema>=4.20.0; extra == 'dev'
36
+ Requires-Dist: mypy>=1.11.0; extra == 'dev'
37
+ Requires-Dist: pre-commit>=3.8.0; extra == 'dev'
38
+ Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
39
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
40
+ Requires-Dist: ruff>=0.6.0; extra == 'dev'
41
+ Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
42
+ Provides-Extra: embed
43
+ Requires-Dist: sentence-transformers>=3.0.0; extra == 'embed'
44
+ Provides-Extra: er
45
+ Requires-Dist: duckdb>=1.0.0; extra == 'er'
46
+ Requires-Dist: splink>=4.0.0; extra == 'er'
47
+ Provides-Extra: full
48
+ Requires-Dist: docling>=2.0.0; extra == 'full'
49
+ Requires-Dist: drain3>=0.9.11; extra == 'full'
50
+ Requires-Dist: duckdb>=1.0.0; extra == 'full'
51
+ Requires-Dist: fastcoref>=2.1.6; extra == 'full'
52
+ Requires-Dist: gliner>=0.2.0; extra == 'full'
53
+ Requires-Dist: leidenalg>=0.10.0; extra == 'full'
54
+ Requires-Dist: mcp>=1.0.0; extra == 'full'
55
+ Requires-Dist: networkx>=3.2; extra == 'full'
56
+ Requires-Dist: pyarrow>=15.0.0; extra == 'full'
57
+ Requires-Dist: python-igraph>=0.11.0; extra == 'full'
58
+ Requires-Dist: spacy>=3.7.0; extra == 'full'
59
+ Requires-Dist: splink>=4.0.0; extra == 'full'
60
+ Requires-Dist: tree-sitter>=0.21.0; extra == 'full'
61
+ Provides-Extra: graph
62
+ Requires-Dist: duckdb>=1.0.0; extra == 'graph'
63
+ Requires-Dist: leidenalg>=0.10.0; extra == 'graph'
64
+ Requires-Dist: networkx>=3.2; extra == 'graph'
65
+ Requires-Dist: pyarrow>=15.0.0; extra == 'graph'
66
+ Requires-Dist: python-igraph>=0.11.0; extra == 'graph'
67
+ Provides-Extra: ie
68
+ Requires-Dist: fastcoref>=2.1.6; extra == 'ie'
69
+ Requires-Dist: gliner>=0.2.0; extra == 'ie'
70
+ Requires-Dist: spacy>=3.7.0; extra == 'ie'
71
+ Provides-Extra: ingest
72
+ Requires-Dist: docling>=2.0.0; extra == 'ingest'
73
+ Requires-Dist: drain3>=0.9.11; extra == 'ingest'
74
+ Requires-Dist: tree-sitter>=0.21.0; extra == 'ingest'
75
+ Provides-Extra: langchain
76
+ Requires-Dist: langchain-core>=0.3.0; extra == 'langchain'
77
+ Provides-Extra: llamaindex
78
+ Requires-Dist: llama-index-core>=0.11.0; extra == 'llamaindex'
79
+ Provides-Extra: mcp
80
+ Requires-Dist: mcp>=1.0.0; extra == 'mcp'
81
+ Provides-Extra: neo4j
82
+ Requires-Dist: neo4j>=5.0.0; extra == 'neo4j'
83
+ Provides-Extra: ocr
84
+ Requires-Dist: rapidocr-onnxruntime>=1.3.0; extra == 'ocr'
85
+ Provides-Extra: rerank
86
+ Requires-Dist: sentence-transformers>=3.0.0; extra == 'rerank'
87
+ Provides-Extra: security
88
+ Requires-Dist: openfga-sdk>=0.5.0; extra == 'security'
89
+ Provides-Extra: vision
90
+ Requires-Dist: colpali-engine>=0.3.0; extra == 'vision'
91
+ Description-Content-Type: text/markdown
92
+
1
93
  # TextGraph
2
94
 
3
- [![PyPI](https://img.shields.io/pypi/v/textgraph-kg?logo=pypi&logoColor=white)](https://pypi.org/project/textgraph-kg/)
95
+ [![PyPI](https://img.shields.io/pypi/v/textgraph-kg?logo=pypi&logoColor=white&label=PyPI)](https://pypi.org/project/textgraph-kg/)
4
96
  [![Python](https://img.shields.io/pypi/pyversions/textgraph-kg?logo=python&logoColor=white)](https://pypi.org/project/textgraph-kg/)
5
- [![Live demo](https://img.shields.io/badge/demo-graph.html-3b5bdb)](https://krishddd.github.io/Wiki_textgraph/)
6
- [![CI](https://github.com/krishddd/Wiki_textgraph/actions/workflows/ci.yml/badge.svg)](https://github.com/krishddd/Wiki_textgraph/actions/workflows/ci.yml)
7
- [![License](https://img.shields.io/github/license/krishddd/Wiki_textgraph)](LICENSE)
97
+ [![Tests](https://img.shields.io/github/actions/workflow/status/krishddd/Wiki_textgraph/test.yml?branch=main&logo=github&label=tests)](https://github.com/krishddd/Wiki_textgraph/actions/workflows/test.yml)
98
+ [![Determinism](https://img.shields.io/github/actions/workflow/status/krishddd/Wiki_textgraph/determinism.yml?branch=main&label=determinism)](https://github.com/krishddd/Wiki_textgraph/actions/workflows/determinism.yml)
99
+ [![Live demo](https://img.shields.io/badge/demo-graph.html-3b5bdb?logo=googlechrome&logoColor=white)](https://krishddd.github.io/Wiki_textgraph/)
100
+ [![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)
8
101
 
9
102
  > Turn a pile of case documents into a **queryable knowledge graph with byte-level provenance on every claim** — local-first, deterministic, and agent-legible.
10
103
  >
11
- > **Install:** `pip install textgraph-kg` · **[Live demo →](https://krishddd.github.io/Wiki_textgraph/)**
104
+ > **`pip install textgraph-kg`** · **[Live demo →](https://krishddd.github.io/Wiki_textgraph/)** · **[vs. Semantica →](docs/COMPARISON_SEMANTICA.md)**
12
105
 
13
106
  TextGraph is built to help investigators make sense of **financial-crime and technical-crime** evidence: filings, contracts, wire-transfer logs, SARs, memos, chat/email exports, and reports. It ingests that corpus and emits a structured, versioned graph that shows **who is connected to whom, through what, and — crucially — *why*** — with every edge carrying the exact source span that supports it, so a finding can be re-verified and stands up to audit.
14
107
 
@@ -26,6 +119,26 @@ Most GraphRAG tools build the graph *with an LLM*: extraction is non-determinist
26
119
 
27
120
  Local-first / DuckDB stays the default; a graph DB (Neo4j) is an *optional* scale-out backend, never required. The trade is deliberate: the deterministic default caps peak recall vs an LLM extractor, which is exactly why the higher-recall `[ie]` and opt-in LLM paths exist — but the reproducibility and re-verifiable citations are the moat.
28
121
 
122
+ ## TextGraph vs. Semantica
123
+
124
+ [Semantica](https://github.com/semantica-agi/semantica) is the closest peer — same regulated-domain focus, PROV-O provenance, decision intelligence (`record_decision` / `trace_decision_chain` / `find_similar_decisions`), conflict detection, and bi-temporal facts. Independent convergence on the same shape is a good sign. Here's the honest split ([full comparison →](docs/COMPARISON_SEMANTICA.md)):
125
+
126
+ **✅ Where TextGraph leads**
127
+
128
+ - **Byte-identical builds, gated in CI** — diff two runs, reproduce any finding. (Semantica guarantees deterministic *reasoning*, not a byte-identical *build*.)
129
+ - **Re-hashable byte-span citations** — every non-generated edge re-verifies against source bytes; 100% re-verify is gated. (Stronger than document/field-level provenance.)
130
+ - **Zero-LLM, dependency-free core** — the whole default pipeline runs CPU-only, no API key, no vector DB. LLM/embeddings are opt-in and `GENERATED`-quarantined.
131
+ - **Interop with provenance intact** — `textgraph export` emits **RDF/Turtle** (loads into Oxigraph/Jena/any SPARQL store, with cited spans as reified `rdf:Statement`s), an **OWL** vocabulary, a **SHACL** shapes graph, and a **PROV-O** decision trail — all deterministic.
132
+
133
+ **🧭 Where to improve (roadmap)**
134
+
135
+ - **LPG storage backends** — Semantica is polyglot (RDF *and* labeled-property graphs: Neo4j/Neptune/AGE). TextGraph now exports RDF and has a Neo4j design; a live LPG driver is next.
136
+ - **Rule reasoning** — Semantica has Datalog/Rete/SPARQL. TextGraph has typed labels, Graph-of-Thoughts, GQL, and now OWL/SHACL export for external validators; an embedded forward-chaining rule engine is on the roadmap.
137
+ - **Provider & vector-store breadth** — Semantica spans LiteLLM providers and FAISS/Qdrant/Weaviate/Milvus. TextGraph ships one OpenAI-compatible client (chat + embeddings) + a cosine index; more backends welcome.
138
+ - **Ecosystem polish** — Semantica has a hosted docs site and published benchmarks. TextGraph has an **MCP server**, a **REST API** (the console's `/api/*`), a **live demo**, and honest fixture benchmarks ([BENCHMARKS.md](BENCHMARKS.md)) — and is growing the rest.
139
+
140
+ The design rule that keeps the moat while closing the gap: **the LLM augments, it never becomes ground truth** — anything model-authored is `GENERATED`-tagged next to its re-verifiable citations.
141
+
29
142
  ## Who it's for
30
143
 
31
144
  - **Financial-crime analysts** — trace structuring/layering, link cases through a shared beneficial owner, follow the money across accounts, and answer *why* two cases are related with a cited path.
@@ -56,11 +169,32 @@ Unknown extensions fall back to plain text; a format needing a missing extra is
56
169
  > how to open the interactive UI.
57
170
 
58
171
  ```bash
59
- # Simplest install (plain pip, three small pure-Python packages — no GPU, no network):
60
- python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
61
- pip install -r requirements.txt && pip install -e .
62
- # (or, with uv: uv sync — then prefix commands with `uv run`)
172
+ pip install textgraph-kg # the import package + CLI are named `textgraph`
173
+ ```
63
174
 
175
+ **Python API** — build once, then call the eight typed, cited tools:
176
+
177
+ ```python
178
+ from textgraph.pipeline import build
179
+ from textgraph.l8_retrieval import QueryEngine
180
+
181
+ result = build("./case-files") # deterministic; byte-identical graph.json
182
+ engine = QueryEngine(result.nodes, result.edges)
183
+
184
+ hits = engine.search("who transferred funds to whom", k=5)
185
+ for h in hits.hits:
186
+ print(h.name, "→", [c.ref() for c in h.citations]) # every hit re-verifiable
187
+
188
+ engine.path("Acme Corp", "Gamma Holdings") # max-likelihood cited path
189
+ engine.why("Acme Corp") # cited claims + validity windows
190
+ engine.conflicts() # single-truth conflicts, surfaced not merged
191
+ engine.trace_decision_chain("beneficial owner policy") # decision lineage
192
+ ```
193
+
194
+ **CLI** — the same tools from the shell:
195
+
196
+ ```bash
197
+ # ...or from source (dev): pip install -r requirements.txt && pip install -e .
64
198
  textgraph build ./case-files -o textgraph-out
65
199
  # → textgraph-out/graph.json, GRAPH_REPORT.md, graph.html, schema.yaml, manifest.json
66
200
 
@@ -1,85 +1,15 @@
1
- Metadata-Version: 2.4
2
- Name: textgraph-kg
3
- Version: 3.2.0
4
- Summary: Turn any textual corpus into a queryable knowledge graph with byte-level provenance on every claim. Local-first, deterministic, zero-LLM-by-default.
5
- Author: krishddd
6
- License: MIT
7
- Keywords: deterministic,information-extraction,knowledge-graph,mcp,provenance,rag
8
- Requires-Python: >=3.11
9
- Requires-Dist: blake3>=0.4.1
10
- Requires-Dist: markdown-it-py>=3.0.0
11
- Requires-Dist: pypdf>=4.0.0
12
- Requires-Dist: pyyaml>=6.0
13
- Provides-Extra: dev
14
- Requires-Dist: jsonschema>=4.20.0; extra == 'dev'
15
- Requires-Dist: mypy>=1.11.0; extra == 'dev'
16
- Requires-Dist: pre-commit>=3.8.0; extra == 'dev'
17
- Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
18
- Requires-Dist: pytest>=8.0.0; extra == 'dev'
19
- Requires-Dist: ruff>=0.6.0; extra == 'dev'
20
- Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
21
- Provides-Extra: embed
22
- Requires-Dist: sentence-transformers>=3.0.0; extra == 'embed'
23
- Provides-Extra: er
24
- Requires-Dist: duckdb>=1.0.0; extra == 'er'
25
- Requires-Dist: splink>=4.0.0; extra == 'er'
26
- Provides-Extra: full
27
- Requires-Dist: docling>=2.0.0; extra == 'full'
28
- Requires-Dist: drain3>=0.9.11; extra == 'full'
29
- Requires-Dist: duckdb>=1.0.0; extra == 'full'
30
- Requires-Dist: fastcoref>=2.1.6; extra == 'full'
31
- Requires-Dist: gliner>=0.2.0; extra == 'full'
32
- Requires-Dist: leidenalg>=0.10.0; extra == 'full'
33
- Requires-Dist: mcp>=1.0.0; extra == 'full'
34
- Requires-Dist: networkx>=3.2; extra == 'full'
35
- Requires-Dist: pyarrow>=15.0.0; extra == 'full'
36
- Requires-Dist: python-igraph>=0.11.0; extra == 'full'
37
- Requires-Dist: spacy>=3.7.0; extra == 'full'
38
- Requires-Dist: splink>=4.0.0; extra == 'full'
39
- Requires-Dist: tree-sitter>=0.21.0; extra == 'full'
40
- Provides-Extra: graph
41
- Requires-Dist: duckdb>=1.0.0; extra == 'graph'
42
- Requires-Dist: leidenalg>=0.10.0; extra == 'graph'
43
- Requires-Dist: networkx>=3.2; extra == 'graph'
44
- Requires-Dist: pyarrow>=15.0.0; extra == 'graph'
45
- Requires-Dist: python-igraph>=0.11.0; extra == 'graph'
46
- Provides-Extra: ie
47
- Requires-Dist: fastcoref>=2.1.6; extra == 'ie'
48
- Requires-Dist: gliner>=0.2.0; extra == 'ie'
49
- Requires-Dist: spacy>=3.7.0; extra == 'ie'
50
- Provides-Extra: ingest
51
- Requires-Dist: docling>=2.0.0; extra == 'ingest'
52
- Requires-Dist: drain3>=0.9.11; extra == 'ingest'
53
- Requires-Dist: tree-sitter>=0.21.0; extra == 'ingest'
54
- Provides-Extra: langchain
55
- Requires-Dist: langchain-core>=0.3.0; extra == 'langchain'
56
- Provides-Extra: llamaindex
57
- Requires-Dist: llama-index-core>=0.11.0; extra == 'llamaindex'
58
- Provides-Extra: mcp
59
- Requires-Dist: mcp>=1.0.0; extra == 'mcp'
60
- Provides-Extra: neo4j
61
- Requires-Dist: neo4j>=5.0.0; extra == 'neo4j'
62
- Provides-Extra: ocr
63
- Requires-Dist: rapidocr-onnxruntime>=1.3.0; extra == 'ocr'
64
- Provides-Extra: rerank
65
- Requires-Dist: sentence-transformers>=3.0.0; extra == 'rerank'
66
- Provides-Extra: security
67
- Requires-Dist: openfga-sdk>=0.5.0; extra == 'security'
68
- Provides-Extra: vision
69
- Requires-Dist: colpali-engine>=0.3.0; extra == 'vision'
70
- Description-Content-Type: text/markdown
71
-
72
1
  # TextGraph
73
2
 
74
- [![PyPI](https://img.shields.io/pypi/v/textgraph-kg?logo=pypi&logoColor=white)](https://pypi.org/project/textgraph-kg/)
3
+ [![PyPI](https://img.shields.io/pypi/v/textgraph-kg?logo=pypi&logoColor=white&label=PyPI)](https://pypi.org/project/textgraph-kg/)
75
4
  [![Python](https://img.shields.io/pypi/pyversions/textgraph-kg?logo=python&logoColor=white)](https://pypi.org/project/textgraph-kg/)
76
- [![Live demo](https://img.shields.io/badge/demo-graph.html-3b5bdb)](https://krishddd.github.io/Wiki_textgraph/)
77
- [![CI](https://github.com/krishddd/Wiki_textgraph/actions/workflows/ci.yml/badge.svg)](https://github.com/krishddd/Wiki_textgraph/actions/workflows/ci.yml)
78
- [![License](https://img.shields.io/github/license/krishddd/Wiki_textgraph)](LICENSE)
5
+ [![Tests](https://img.shields.io/github/actions/workflow/status/krishddd/Wiki_textgraph/test.yml?branch=main&logo=github&label=tests)](https://github.com/krishddd/Wiki_textgraph/actions/workflows/test.yml)
6
+ [![Determinism](https://img.shields.io/github/actions/workflow/status/krishddd/Wiki_textgraph/determinism.yml?branch=main&label=determinism)](https://github.com/krishddd/Wiki_textgraph/actions/workflows/determinism.yml)
7
+ [![Live demo](https://img.shields.io/badge/demo-graph.html-3b5bdb?logo=googlechrome&logoColor=white)](https://krishddd.github.io/Wiki_textgraph/)
8
+ [![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)
79
9
 
80
10
  > Turn a pile of case documents into a **queryable knowledge graph with byte-level provenance on every claim** — local-first, deterministic, and agent-legible.
81
11
  >
82
- > **Install:** `pip install textgraph-kg` · **[Live demo →](https://krishddd.github.io/Wiki_textgraph/)**
12
+ > **`pip install textgraph-kg`** · **[Live demo →](https://krishddd.github.io/Wiki_textgraph/)** · **[vs. Semantica →](docs/COMPARISON_SEMANTICA.md)**
83
13
 
84
14
  TextGraph is built to help investigators make sense of **financial-crime and technical-crime** evidence: filings, contracts, wire-transfer logs, SARs, memos, chat/email exports, and reports. It ingests that corpus and emits a structured, versioned graph that shows **who is connected to whom, through what, and — crucially — *why*** — with every edge carrying the exact source span that supports it, so a finding can be re-verified and stands up to audit.
85
15
 
@@ -97,6 +27,26 @@ Most GraphRAG tools build the graph *with an LLM*: extraction is non-determinist
97
27
 
98
28
  Local-first / DuckDB stays the default; a graph DB (Neo4j) is an *optional* scale-out backend, never required. The trade is deliberate: the deterministic default caps peak recall vs an LLM extractor, which is exactly why the higher-recall `[ie]` and opt-in LLM paths exist — but the reproducibility and re-verifiable citations are the moat.
99
29
 
30
+ ## TextGraph vs. Semantica
31
+
32
+ [Semantica](https://github.com/semantica-agi/semantica) is the closest peer — same regulated-domain focus, PROV-O provenance, decision intelligence (`record_decision` / `trace_decision_chain` / `find_similar_decisions`), conflict detection, and bi-temporal facts. Independent convergence on the same shape is a good sign. Here's the honest split ([full comparison →](docs/COMPARISON_SEMANTICA.md)):
33
+
34
+ **✅ Where TextGraph leads**
35
+
36
+ - **Byte-identical builds, gated in CI** — diff two runs, reproduce any finding. (Semantica guarantees deterministic *reasoning*, not a byte-identical *build*.)
37
+ - **Re-hashable byte-span citations** — every non-generated edge re-verifies against source bytes; 100% re-verify is gated. (Stronger than document/field-level provenance.)
38
+ - **Zero-LLM, dependency-free core** — the whole default pipeline runs CPU-only, no API key, no vector DB. LLM/embeddings are opt-in and `GENERATED`-quarantined.
39
+ - **Interop with provenance intact** — `textgraph export` emits **RDF/Turtle** (loads into Oxigraph/Jena/any SPARQL store, with cited spans as reified `rdf:Statement`s), an **OWL** vocabulary, a **SHACL** shapes graph, and a **PROV-O** decision trail — all deterministic.
40
+
41
+ **🧭 Where to improve (roadmap)**
42
+
43
+ - **LPG storage backends** — Semantica is polyglot (RDF *and* labeled-property graphs: Neo4j/Neptune/AGE). TextGraph now exports RDF and has a Neo4j design; a live LPG driver is next.
44
+ - **Rule reasoning** — Semantica has Datalog/Rete/SPARQL. TextGraph has typed labels, Graph-of-Thoughts, GQL, and now OWL/SHACL export for external validators; an embedded forward-chaining rule engine is on the roadmap.
45
+ - **Provider & vector-store breadth** — Semantica spans LiteLLM providers and FAISS/Qdrant/Weaviate/Milvus. TextGraph ships one OpenAI-compatible client (chat + embeddings) + a cosine index; more backends welcome.
46
+ - **Ecosystem polish** — Semantica has a hosted docs site and published benchmarks. TextGraph has an **MCP server**, a **REST API** (the console's `/api/*`), a **live demo**, and honest fixture benchmarks ([BENCHMARKS.md](BENCHMARKS.md)) — and is growing the rest.
47
+
48
+ The design rule that keeps the moat while closing the gap: **the LLM augments, it never becomes ground truth** — anything model-authored is `GENERATED`-tagged next to its re-verifiable citations.
49
+
100
50
  ## Who it's for
101
51
 
102
52
  - **Financial-crime analysts** — trace structuring/layering, link cases through a shared beneficial owner, follow the money across accounts, and answer *why* two cases are related with a cited path.
@@ -127,11 +77,32 @@ Unknown extensions fall back to plain text; a format needing a missing extra is
127
77
  > how to open the interactive UI.
128
78
 
129
79
  ```bash
130
- # Simplest install (plain pip, three small pure-Python packages — no GPU, no network):
131
- python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
132
- pip install -r requirements.txt && pip install -e .
133
- # (or, with uv: uv sync — then prefix commands with `uv run`)
80
+ pip install textgraph-kg # the import package + CLI are named `textgraph`
81
+ ```
134
82
 
83
+ **Python API** — build once, then call the eight typed, cited tools:
84
+
85
+ ```python
86
+ from textgraph.pipeline import build
87
+ from textgraph.l8_retrieval import QueryEngine
88
+
89
+ result = build("./case-files") # deterministic; byte-identical graph.json
90
+ engine = QueryEngine(result.nodes, result.edges)
91
+
92
+ hits = engine.search("who transferred funds to whom", k=5)
93
+ for h in hits.hits:
94
+ print(h.name, "→", [c.ref() for c in h.citations]) # every hit re-verifiable
95
+
96
+ engine.path("Acme Corp", "Gamma Holdings") # max-likelihood cited path
97
+ engine.why("Acme Corp") # cited claims + validity windows
98
+ engine.conflicts() # single-truth conflicts, surfaced not merged
99
+ engine.trace_decision_chain("beneficial owner policy") # decision lineage
100
+ ```
101
+
102
+ **CLI** — the same tools from the shell:
103
+
104
+ ```bash
105
+ # ...or from source (dev): pip install -r requirements.txt && pip install -e .
135
106
  textgraph build ./case-files -o textgraph-out
136
107
  # → textgraph-out/graph.json, GRAPH_REPORT.md, graph.html, schema.yaml, manifest.json
137
108
 
@@ -23,8 +23,9 @@ for compliance-grade AI.
23
23
  | **Extraction** | Rule + GLiNER (deterministic); **opt-in LLM relation enrichment** (v3.2). | NER/relation/event/triplet backends, LLM-assisted. |
24
24
  | **Retrieval** | BM25 + Personalized-PageRank + **dense embeddings** (v3.2), RRF-fused. | Hybrid dense+sparse over FAISS/Qdrant/Weaviate/Milvus/… |
25
25
  | **Answers** | Templated + cited by default; **opt-in grounded LLM synthesis** (v3.2). | Rule-engine justifications; explicitly avoids LLM prose for answers. |
26
- | **Graph store** | DuckDB default; Neo4j design (optional). | Polyglot: RDF (Oxigraph/Jena/…) **and** LPG (Neo4j/Neptune/…). |
27
- | **Ontology** | Typed labels + PROV-O export. | OWL generation, SHACL validation, SKOS. |
26
+ | **Graph store** | DuckDB default; **RDF/Turtle export** (loads into Oxigraph/Jena/any SPARQL store); Neo4j design. | Polyglot: RDF (Oxigraph/Jena/…) **and** LPG (Neo4j/Neptune/…), live. |
27
+ | **Ontology** | **OWL vocabulary + SHACL shapes export** (induced from the graph) + PROV-O. | OWL generation, SHACL validation, SKOS. |
28
+ | **Export formats** | `graph.json`, **RDF/Turtle**, **OWL**, **SHACL**, **PROV-O JSON-LD**, RDF-reified provenance. | RDF, OWL, Parquet, Cypher, JSON-LD, PROV-O. |
28
29
  | **Reasoning** | Graph-of-Thoughts (complexity-gated), GQL. | Forward chaining, Rete, Datalog, SPARQL. |
29
30
  | **Footprint** | Dependency-free core (stdlib); everything heavy behind extras. | Broader dependency surface (many backends/providers). |
30
31
  | **Access control** | Built-in ReBAC/ABAC, security-aware retrieval. | Self-hosted; enterprise data-platform integrations. |
@@ -180,14 +180,20 @@ never deleted. Strategies: `most_recent`, `voting`, `credibility_weighted` (the
180
180
  a `--credibility source_name.json` map). Bake a resolution into `graph.json` with
181
181
  `textgraph build ./docs --resolve-conflicts voting`.
182
182
 
183
- Export an interoperable **decision-provenance trail** (W3C PROV-O JSON-LD) — each
184
- decision as a `prov:Activity`, cited to its source span, with `CAUSED`/`INFLUENCED`/
185
- `PRECEDENT_FOR` links rendered as `prov:wasInformedBy`:
183
+ **Interoperable exports** — the graph as standard semantic-web artifacts, all deterministic:
186
184
 
187
185
  ```bash
188
- textgraph export ./my-documents --format prov-o -o decisions.prov.jsonld
186
+ textgraph export ./my-documents --format rdf -o graph.ttl # RDF/Turtle triple store
187
+ textgraph export ./my-documents --format owl -o ontology.ttl # OWL vocabulary
188
+ textgraph export ./my-documents --format shacl -o shapes.ttl # SHACL shapes
189
+ textgraph export ./my-documents --format prov-o -o decisions.jsonld # PROV-O decision trail
189
190
  ```
190
191
 
192
+ The **RDF/Turtle** export loads straight into Oxigraph, Apache Jena, RDF4J, or any SPARQL
193
+ store — and cited edges become reified `rdf:Statement`s carrying the re-verifiable byte span,
194
+ so provenance survives the round-trip. **PROV-O** renders each decision as a `prov:Activity`
195
+ with `CAUSED`/`INFLUENCED`/`PRECEDENT_FOR` as `prov:wasInformedBy`.
196
+
191
197
  Run `textgraph --help` for the full list.
192
198
 
193
199
  ## 7. Running the tests (contributors)
@@ -1,12 +1,30 @@
1
1
  [project]
2
2
  name = "textgraph-kg"
3
- version = "3.2.0"
3
+ version = "3.3.0"
4
4
  description = "Turn any textual corpus into a queryable knowledge graph with byte-level provenance on every claim. Local-first, deterministic, zero-LLM-by-default."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
7
7
  license = { text = "MIT" }
8
+ license-files = ["LICENSE"]
8
9
  authors = [{ name = "krishddd" }]
9
10
  keywords = ["knowledge-graph", "provenance", "information-extraction", "mcp", "deterministic", "rag"]
11
+ classifiers = [
12
+ "Development Status :: 5 - Production/Stable",
13
+ "Intended Audience :: Developers",
14
+ "Intended Audience :: Legal Industry",
15
+ "Intended Audience :: Financial and Insurance Industry",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Operating System :: OS Independent",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Programming Language :: Python :: 3.13",
22
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
23
+ "Topic :: Text Processing :: Linguistic",
24
+ "Topic :: Software Development :: Libraries :: Python Modules",
25
+ "Typing :: Typed",
26
+ ]
27
+
10
28
  dependencies = [
11
29
  # Lean core: content addressing + pure-Python structural parsers.
12
30
  # Everything heavy (Docling, tree-sitter, encoder models) lives behind extras.
@@ -19,6 +37,14 @@ dependencies = [
19
37
  "pypdf>=4.0.0",
20
38
  ]
21
39
 
40
+ [project.urls]
41
+ Homepage = "https://krishddd.github.io/Wiki_textgraph/"
42
+ Repository = "https://github.com/krishddd/Wiki_textgraph"
43
+ Documentation = "https://github.com/krishddd/Wiki_textgraph/blob/main/docs/RUNNING.md"
44
+ Changelog = "https://github.com/krishddd/Wiki_textgraph/blob/main/CHANGELOG.md"
45
+ "Live demo" = "https://krishddd.github.io/Wiki_textgraph/"
46
+ "Bug Tracker" = "https://github.com/krishddd/Wiki_textgraph/issues"
47
+
22
48
  [project.optional-dependencies]
23
49
  # Higher-fidelity rich-document ingestion. Docling adds layout/table/OCR; tree-sitter/Drain3
24
50
  # give deterministic structured-text/log parsing. (PDF text works without this — see core.)
@@ -0,0 +1,95 @@
1
+ """RDF / OWL / SHACL export — deterministic, valid Turtle triple-store artifacts."""
2
+
3
+ from pathlib import Path
4
+
5
+ import pytest
6
+ from textgraph.cli import main
7
+ from textgraph.l9_artifacts.ontology import export_owl_bytes, export_shacl_bytes
8
+ from textgraph.l9_artifacts.rdf import export_rdf_bytes
9
+ from textgraph.pipeline import build
10
+
11
+ DOCS = Path(__file__).parent.parent / "fixtures" / "corpora" / "docs"
12
+
13
+
14
+ def _built() -> object:
15
+ return build(DOCS)
16
+
17
+
18
+ # --- RDF (Turtle) ------------------------------------------------------------
19
+
20
+
21
+ def test_rdf_has_prefixes_classes_and_relations() -> None:
22
+ r = _built()
23
+ ttl = export_rdf_bytes(r.nodes, r.edges).decode("utf-8")
24
+ assert ttl.startswith("@prefix")
25
+ assert "@prefix rdf:" in ttl and "@prefix prov:" in ttl
26
+ assert "a <https://textgraph.dev/class/" in ttl # node typed by its label
27
+ assert "<https://textgraph.dev/rel/" in ttl # relation predicate triples
28
+ assert ttl.endswith("\n")
29
+
30
+
31
+ def test_rdf_reifies_provenance_for_cited_edges() -> None:
32
+ r = _built()
33
+ ttl = export_rdf_bytes(r.nodes, r.edges).decode("utf-8")
34
+ # Cited edges become rdf:Statement with the re-verifiable byte span (G3).
35
+ assert "a rdf:Statement" in ttl
36
+ assert "tgo:sourceHash" in ttl and "prov:wasDerivedFrom" in ttl
37
+ assert "tgo:confidenceTag" in ttl
38
+
39
+
40
+ def test_rdf_is_deterministic() -> None:
41
+ r = _built()
42
+ assert export_rdf_bytes(r.nodes, r.edges) == export_rdf_bytes(r.nodes, r.edges)
43
+
44
+
45
+ # --- OWL ---------------------------------------------------------------------
46
+
47
+
48
+ def test_owl_declares_classes_and_object_properties() -> None:
49
+ r = _built()
50
+ owl = export_owl_bytes(r.nodes, r.edges).decode("utf-8")
51
+ assert "owl:Class" in owl
52
+ assert "owl:ObjectProperty" in owl
53
+ assert "owl:DatatypeProperty" in owl # scalar property keys
54
+ assert export_owl_bytes(r.nodes, r.edges) == export_owl_bytes(r.nodes, r.edges)
55
+
56
+
57
+ # --- SHACL -------------------------------------------------------------------
58
+
59
+
60
+ def test_shacl_emits_node_shapes_per_class() -> None:
61
+ r = _built()
62
+ shacl = export_shacl_bytes(r.nodes, r.edges).decode("utf-8")
63
+ assert "sh:NodeShape" in shacl
64
+ assert "sh:targetClass" in shacl
65
+ assert "sh:property" in shacl and "sh:minCount 1" in shacl
66
+ assert export_shacl_bytes(r.nodes, r.edges) == export_shacl_bytes(r.nodes, r.edges)
67
+
68
+
69
+ # --- validity (optional, only if rdflib happens to be installed) -------------
70
+
71
+
72
+ def test_all_exports_are_valid_turtle() -> None:
73
+ rdflib = pytest.importorskip("rdflib")
74
+ r = _built()
75
+ for fn in (export_rdf_bytes, export_owl_bytes, export_shacl_bytes):
76
+ g = rdflib.Graph()
77
+ g.parse(data=fn(r.nodes, r.edges).decode("utf-8"), format="turtle")
78
+ assert len(g) > 0 # parsed into real triples
79
+
80
+
81
+ # --- CLI ---------------------------------------------------------------------
82
+
83
+
84
+ @pytest.mark.parametrize("fmt", ["rdf", "owl", "shacl"])
85
+ def test_export_cli_writes_file(fmt: str, tmp_path: Path) -> None:
86
+ out = tmp_path / f"graph.{fmt}"
87
+ assert main(["export", str(DOCS), "--format", fmt, "-o", str(out)]) == 0
88
+ body = out.read_text(encoding="utf-8")
89
+ assert body.startswith("@prefix") and body.endswith("\n")
90
+
91
+
92
+ def test_export_cli_rdf_to_stdout(capsys: pytest.CaptureFixture[str]) -> None:
93
+ assert main(["export", str(DOCS), "--format", "rdf"]) == 0
94
+ out = capsys.readouterr().out
95
+ assert "@prefix tg:" in out and "class/" in out
@@ -3,4 +3,4 @@
3
3
  Local-first, deterministic, zero-LLM-by-default. See ARCHITECTURE.md for the L0-L9 stack.
4
4
  """
5
5
 
6
- __version__ = "3.2.0"
6
+ __version__ = "3.3.0"