trustgraph-flow 0.18.2__tar.gz → 0.18.3__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 (262) hide show
  1. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/PKG-INFO +2 -2
  2. trustgraph-flow-0.18.3/scripts/triples-query-falkordb +6 -0
  3. trustgraph-flow-0.18.3/scripts/triples-write-falkordb +6 -0
  4. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/setup.py +3 -0
  5. trustgraph-flow-0.18.3/trustgraph/flow_version.py +1 -0
  6. trustgraph-flow-0.18.3/trustgraph/query/triples/falkordb/service.py +341 -0
  7. trustgraph-flow-0.18.3/trustgraph/query/triples/neo4j/__init__.py +3 -0
  8. trustgraph-flow-0.18.3/trustgraph/query/triples/neo4j/__main__.py +7 -0
  9. trustgraph-flow-0.18.3/trustgraph/storage/triples/falkordb/write.py +150 -0
  10. trustgraph-flow-0.18.3/trustgraph/storage/triples/neo4j/__init__.py +3 -0
  11. trustgraph-flow-0.18.3/trustgraph/storage/triples/neo4j/__main__.py +7 -0
  12. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/triples/neo4j/write.py +1 -1
  13. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph_flow.egg-info/PKG-INFO +2 -2
  14. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph_flow.egg-info/SOURCES.txt +8 -0
  15. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph_flow.egg-info/requires.txt +1 -0
  16. trustgraph-flow-0.18.2/trustgraph/flow_version.py +0 -1
  17. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/README.md +0 -0
  18. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/agent-manager-react +0 -0
  19. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/api-gateway +0 -0
  20. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/chunker-recursive +0 -0
  21. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/chunker-token +0 -0
  22. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/de-query-milvus +0 -0
  23. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/de-query-pinecone +0 -0
  24. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/de-query-qdrant +0 -0
  25. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/de-write-milvus +0 -0
  26. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/de-write-pinecone +0 -0
  27. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/de-write-qdrant +0 -0
  28. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/document-rag +0 -0
  29. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/embeddings-ollama +0 -0
  30. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/embeddings-vectorize +0 -0
  31. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/ge-query-milvus +0 -0
  32. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/ge-query-pinecone +0 -0
  33. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/ge-query-qdrant +0 -0
  34. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/ge-write-milvus +0 -0
  35. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/ge-write-pinecone +0 -0
  36. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/ge-write-qdrant +0 -0
  37. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/graph-rag +0 -0
  38. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/kg-extract-definitions +0 -0
  39. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/kg-extract-relationships +0 -0
  40. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/kg-extract-topics +0 -0
  41. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/metering +0 -0
  42. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/object-extract-row +0 -0
  43. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/oe-write-milvus +0 -0
  44. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/pdf-decoder +0 -0
  45. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/prompt-generic +0 -0
  46. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/prompt-template +0 -0
  47. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/rows-write-cassandra +0 -0
  48. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/run-processing +0 -0
  49. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/text-completion-azure +0 -0
  50. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/text-completion-azure-openai +0 -0
  51. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/text-completion-claude +0 -0
  52. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/text-completion-cohere +0 -0
  53. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/text-completion-googleaistudio +0 -0
  54. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/text-completion-llamafile +0 -0
  55. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/text-completion-ollama +0 -0
  56. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/text-completion-openai +0 -0
  57. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/triples-query-cassandra +0 -0
  58. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/triples-query-memgraph +0 -0
  59. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/triples-query-neo4j +0 -0
  60. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/triples-write-cassandra +0 -0
  61. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/triples-write-memgraph +0 -0
  62. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/triples-write-neo4j +0 -0
  63. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/scripts/wikipedia-lookup +0 -0
  64. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/setup.cfg +0 -0
  65. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/__init__.py +0 -0
  66. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/agent/__init__.py +0 -0
  67. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/agent/react/__init__.py +0 -0
  68. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/agent/react/__main__.py +0 -0
  69. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/agent/react/agent_manager.py +0 -0
  70. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/agent/react/service.py +0 -0
  71. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/agent/react/tools.py +0 -0
  72. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/agent/react/types.py +0 -0
  73. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/chunking/__init__.py +0 -0
  74. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/chunking/recursive/__init__.py +0 -0
  75. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/chunking/recursive/__main__.py +0 -0
  76. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/chunking/recursive/chunker.py +0 -0
  77. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/chunking/token/__init__.py +0 -0
  78. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/chunking/token/__main__.py +0 -0
  79. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/chunking/token/chunker.py +0 -0
  80. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/decoding/__init__.py +0 -0
  81. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/decoding/pdf/__init__.py +0 -0
  82. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/decoding/pdf/__main__.py +0 -0
  83. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/decoding/pdf/pdf_decoder.py +0 -0
  84. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/direct/__init__.py +0 -0
  85. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/direct/cassandra.py +0 -0
  86. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/direct/milvus_doc_embeddings.py +0 -0
  87. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/direct/milvus_graph_embeddings.py +0 -0
  88. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/direct/milvus_object_embeddings.py +0 -0
  89. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/document_rag.py +0 -0
  90. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/embeddings/__init__.py +0 -0
  91. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/embeddings/ollama/__init__.py +0 -0
  92. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/embeddings/ollama/__main__.py +0 -0
  93. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/embeddings/ollama/processor.py +0 -0
  94. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/embeddings/vectorize/__init__.py +0 -0
  95. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/embeddings/vectorize/__main__.py +0 -0
  96. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/embeddings/vectorize/vectorize.py +0 -0
  97. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/external/__init__.py +0 -0
  98. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/external/wikipedia/__init__.py +0 -0
  99. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/external/wikipedia/__main__.py +0 -0
  100. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/external/wikipedia/service.py +0 -0
  101. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/extract/__init__.py +0 -0
  102. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/extract/kg/__init__.py +0 -0
  103. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/extract/kg/definitions/__init__.py +0 -0
  104. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/extract/kg/definitions/__main__.py +0 -0
  105. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/extract/kg/definitions/extract.py +0 -0
  106. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/extract/kg/relationships/__init__.py +0 -0
  107. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/extract/kg/relationships/__main__.py +0 -0
  108. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/extract/kg/relationships/extract.py +0 -0
  109. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/extract/kg/topics/__init__.py +0 -0
  110. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/extract/kg/topics/__main__.py +0 -0
  111. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/extract/kg/topics/extract.py +0 -0
  112. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/extract/object/__init__.py +0 -0
  113. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/extract/object/row/__init__.py +0 -0
  114. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/extract/object/row/__main__.py +0 -0
  115. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/extract/object/row/extract.py +0 -0
  116. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/__init__.py +0 -0
  117. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/__main__.py +0 -0
  118. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/agent.py +0 -0
  119. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/auth.py +0 -0
  120. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/dbpedia.py +0 -0
  121. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/embeddings.py +0 -0
  122. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/encyclopedia.py +0 -0
  123. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/endpoint.py +0 -0
  124. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/graph_embeddings_load.py +0 -0
  125. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/graph_embeddings_query.py +0 -0
  126. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/graph_embeddings_stream.py +0 -0
  127. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/graph_rag.py +0 -0
  128. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/internet_search.py +0 -0
  129. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/mux.py +0 -0
  130. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/prompt.py +0 -0
  131. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/publisher.py +0 -0
  132. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/requestor.py +0 -0
  133. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/running.py +0 -0
  134. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/serialize.py +0 -0
  135. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/service.py +0 -0
  136. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/socket.py +0 -0
  137. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/subscriber.py +0 -0
  138. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/text_completion.py +0 -0
  139. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/triples_load.py +0 -0
  140. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/triples_query.py +0 -0
  141. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/gateway/triples_stream.py +0 -0
  142. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/graph_rag.py +0 -0
  143. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/metering/__init__.py +0 -0
  144. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/metering/__main__.py +0 -0
  145. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/metering/counter.py +0 -0
  146. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/metering/pricelist.py +0 -0
  147. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/__init__.py +0 -0
  148. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/prompt/__init__.py +0 -0
  149. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/prompt/generic/__init__.py +0 -0
  150. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/prompt/generic/__main__.py +0 -0
  151. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/prompt/generic/prompts.py +0 -0
  152. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/prompt/generic/service.py +0 -0
  153. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/prompt/template/__init__.py +0 -0
  154. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/prompt/template/__main__.py +0 -0
  155. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/prompt/template/prompt_manager.py +0 -0
  156. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/prompt/template/service.py +0 -0
  157. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/text_completion/__init__.py +0 -0
  158. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/text_completion/azure/__init__.py +0 -0
  159. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/text_completion/azure/__main__.py +0 -0
  160. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/text_completion/azure/llm.py +0 -0
  161. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/text_completion/azure_openai/__init__.py +0 -0
  162. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/text_completion/azure_openai/__main__.py +0 -0
  163. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/text_completion/azure_openai/llm.py +0 -0
  164. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/text_completion/claude/__init__.py +0 -0
  165. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/text_completion/claude/__main__.py +0 -0
  166. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/text_completion/claude/llm.py +0 -0
  167. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/text_completion/cohere/__init__.py +0 -0
  168. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/text_completion/cohere/__main__.py +0 -0
  169. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/text_completion/cohere/llm.py +0 -0
  170. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/text_completion/googleaistudio/__init__.py +0 -0
  171. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/text_completion/googleaistudio/__main__.py +0 -0
  172. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/text_completion/googleaistudio/llm.py +0 -0
  173. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/text_completion/llamafile/__init__.py +0 -0
  174. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/text_completion/llamafile/__main__.py +0 -0
  175. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/text_completion/llamafile/llm.py +0 -0
  176. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/text_completion/ollama/__init__.py +0 -0
  177. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/text_completion/ollama/__main__.py +0 -0
  178. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/text_completion/ollama/llm.py +0 -0
  179. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/text_completion/openai/__init__.py +0 -0
  180. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/text_completion/openai/__main__.py +0 -0
  181. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/model/text_completion/openai/llm.py +0 -0
  182. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/processing/__init__.py +0 -0
  183. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/processing/__main__.py +0 -0
  184. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/processing/processing.py +0 -0
  185. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/__init__.py +0 -0
  186. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/doc_embeddings/__init__.py +0 -0
  187. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/doc_embeddings/milvus/__init__.py +0 -0
  188. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/doc_embeddings/milvus/__main__.py +0 -0
  189. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/doc_embeddings/milvus/service.py +0 -0
  190. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/doc_embeddings/pinecone/__init__.py +0 -0
  191. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/doc_embeddings/pinecone/__main__.py +0 -0
  192. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/doc_embeddings/pinecone/service.py +0 -0
  193. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/doc_embeddings/qdrant/__init__.py +0 -0
  194. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/doc_embeddings/qdrant/__main__.py +0 -0
  195. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/doc_embeddings/qdrant/service.py +0 -0
  196. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/graph_embeddings/__init__.py +0 -0
  197. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/graph_embeddings/milvus/__init__.py +0 -0
  198. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/graph_embeddings/milvus/__main__.py +0 -0
  199. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/graph_embeddings/milvus/service.py +0 -0
  200. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/graph_embeddings/pinecone/__init__.py +0 -0
  201. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/graph_embeddings/pinecone/__main__.py +0 -0
  202. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/graph_embeddings/pinecone/service.py +0 -0
  203. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/graph_embeddings/qdrant/__init__.py +0 -0
  204. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/graph_embeddings/qdrant/__main__.py +0 -0
  205. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/graph_embeddings/qdrant/service.py +0 -0
  206. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/triples/__init__.py +0 -0
  207. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/triples/cassandra/__init__.py +0 -0
  208. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/triples/cassandra/__main__.py +0 -0
  209. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/triples/cassandra/service.py +0 -0
  210. {trustgraph-flow-0.18.2/trustgraph/query/triples/memgraph → trustgraph-flow-0.18.3/trustgraph/query/triples/falkordb}/__init__.py +0 -0
  211. {trustgraph-flow-0.18.2/trustgraph/query/triples/memgraph → trustgraph-flow-0.18.3/trustgraph/query/triples/falkordb}/__main__.py +0 -0
  212. {trustgraph-flow-0.18.2/trustgraph/query/triples/neo4j → trustgraph-flow-0.18.3/trustgraph/query/triples/memgraph}/__init__.py +0 -0
  213. {trustgraph-flow-0.18.2/trustgraph/query/triples/neo4j → trustgraph-flow-0.18.3/trustgraph/query/triples/memgraph}/__main__.py +0 -0
  214. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/triples/memgraph/service.py +0 -0
  215. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/query/triples/neo4j/service.py +0 -0
  216. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/retrieval/__init__.py +0 -0
  217. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/retrieval/document_rag/__init__.py +0 -0
  218. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/retrieval/document_rag/__main__.py +0 -0
  219. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/retrieval/document_rag/rag.py +0 -0
  220. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/retrieval/graph_rag/__init__.py +0 -0
  221. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/retrieval/graph_rag/__main__.py +0 -0
  222. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/retrieval/graph_rag/rag.py +0 -0
  223. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/__init__.py +0 -0
  224. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/doc_embeddings/__init__.py +0 -0
  225. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/doc_embeddings/milvus/__init__.py +0 -0
  226. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/doc_embeddings/milvus/__main__.py +0 -0
  227. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/doc_embeddings/milvus/write.py +0 -0
  228. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/doc_embeddings/pinecone/__init__.py +0 -0
  229. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/doc_embeddings/pinecone/__main__.py +0 -0
  230. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/doc_embeddings/pinecone/write.py +0 -0
  231. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/doc_embeddings/qdrant/__init__.py +0 -0
  232. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/doc_embeddings/qdrant/__main__.py +0 -0
  233. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/doc_embeddings/qdrant/write.py +0 -0
  234. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/graph_embeddings/__init__.py +0 -0
  235. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/graph_embeddings/milvus/__init__.py +0 -0
  236. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/graph_embeddings/milvus/__main__.py +0 -0
  237. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/graph_embeddings/milvus/write.py +0 -0
  238. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/graph_embeddings/pinecone/__init__.py +0 -0
  239. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/graph_embeddings/pinecone/__main__.py +0 -0
  240. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/graph_embeddings/pinecone/write.py +0 -0
  241. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/graph_embeddings/qdrant/__init__.py +0 -0
  242. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/graph_embeddings/qdrant/__main__.py +0 -0
  243. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/graph_embeddings/qdrant/write.py +0 -0
  244. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/object_embeddings/__init__.py +0 -0
  245. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/object_embeddings/milvus/__init__.py +0 -0
  246. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/object_embeddings/milvus/__main__.py +0 -0
  247. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/object_embeddings/milvus/write.py +0 -0
  248. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/rows/__init__.py +0 -0
  249. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/rows/cassandra/__init__.py +0 -0
  250. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/rows/cassandra/__main__.py +0 -0
  251. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/rows/cassandra/write.py +0 -0
  252. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/triples/__init__.py +0 -0
  253. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/triples/cassandra/__init__.py +0 -0
  254. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/triples/cassandra/__main__.py +0 -0
  255. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/triples/cassandra/write.py +0 -0
  256. {trustgraph-flow-0.18.2/trustgraph/storage/triples/memgraph → trustgraph-flow-0.18.3/trustgraph/storage/triples/falkordb}/__init__.py +0 -0
  257. {trustgraph-flow-0.18.2/trustgraph/storage/triples/memgraph → trustgraph-flow-0.18.3/trustgraph/storage/triples/falkordb}/__main__.py +0 -0
  258. {trustgraph-flow-0.18.2/trustgraph/storage/triples/neo4j → trustgraph-flow-0.18.3/trustgraph/storage/triples/memgraph}/__init__.py +0 -0
  259. {trustgraph-flow-0.18.2/trustgraph/storage/triples/neo4j → trustgraph-flow-0.18.3/trustgraph/storage/triples/memgraph}/__main__.py +0 -0
  260. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph/storage/triples/memgraph/write.py +0 -0
  261. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph_flow.egg-info/dependency_links.txt +0 -0
  262. {trustgraph-flow-0.18.2 → trustgraph-flow-0.18.3}/trustgraph_flow.egg-info/top_level.txt +0 -0
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: trustgraph-flow
3
- Version: 0.18.2
3
+ Version: 0.18.3
4
4
  Summary: TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.
5
5
  Home-page: https://github.com/trustgraph-ai/trustgraph
6
6
  Author: trustgraph.ai
7
7
  Author-email: security@trustgraph.ai
8
8
  License: UNKNOWN
9
- Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.18.2.tar.gz
9
+ Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.18.3.tar.gz
10
10
  Platform: UNKNOWN
11
11
  Classifier: Programming Language :: Python :: 3
12
12
  Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env python3
2
+
3
+ from trustgraph.query.triples.falkordb import run
4
+
5
+ run()
6
+
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env python3
2
+
3
+ from trustgraph.storage.triples.falkordb import run
4
+
5
+ run()
6
+
@@ -60,6 +60,7 @@ setuptools.setup(
60
60
  "jsonschema",
61
61
  "aiohttp",
62
62
  "pinecone[grpc]",
63
+ "falkordb",
63
64
  ],
64
65
  scripts=[
65
66
  "scripts/api-gateway",
@@ -104,9 +105,11 @@ setuptools.setup(
104
105
  "scripts/triples-query-cassandra",
105
106
  "scripts/triples-query-neo4j",
106
107
  "scripts/triples-query-memgraph",
108
+ "scripts/triples-query-falkordb",
107
109
  "scripts/triples-write-cassandra",
108
110
  "scripts/triples-write-neo4j",
109
111
  "scripts/triples-write-memgraph",
112
+ "scripts/triples-write-falkordb",
110
113
  "scripts/wikipedia-lookup",
111
114
  ]
112
115
  )
@@ -0,0 +1 @@
1
+ __version__ = "0.18.3"
@@ -0,0 +1,341 @@
1
+
2
+ """
3
+ Triples query service for FalkorDB.
4
+ Input is a (s, p, o) triple, some values may be null. Output is a list of
5
+ triples.
6
+ """
7
+
8
+ from falkordb import FalkorDB
9
+
10
+ from .... schema import TriplesQueryRequest, TriplesQueryResponse, Error
11
+ from .... schema import Value, Triple
12
+ from .... schema import triples_request_queue
13
+ from .... schema import triples_response_queue
14
+ from .... base import ConsumerProducer
15
+
16
+ module = ".".join(__name__.split(".")[1:-1])
17
+
18
+ default_input_queue = triples_request_queue
19
+ default_output_queue = triples_response_queue
20
+ default_subscriber = module
21
+
22
+ default_graph_url = 'falkor://falkordb:6379'
23
+ default_database = 'falkordb'
24
+
25
+ class Processor(ConsumerProducer):
26
+
27
+ def __init__(self, **params):
28
+
29
+ input_queue = params.get("input_queue", default_input_queue)
30
+ output_queue = params.get("output_queue", default_output_queue)
31
+ subscriber = params.get("subscriber", default_subscriber)
32
+ graph_url = params.get("graph_host", default_graph_url)
33
+ database = params.get("database", default_database)
34
+
35
+ super(Processor, self).__init__(
36
+ **params | {
37
+ "input_queue": input_queue,
38
+ "output_queue": output_queue,
39
+ "subscriber": subscriber,
40
+ "input_schema": TriplesQueryRequest,
41
+ "output_schema": TriplesQueryResponse,
42
+ "graph_url": graph_url,
43
+ }
44
+ )
45
+
46
+ self.db = database
47
+
48
+ self.io = FalkorDB.from_url(graph_url).select_graph(database)
49
+
50
+ def create_value(self, ent):
51
+
52
+ if ent.startswith("http://") or ent.startswith("https://"):
53
+ return Value(value=ent, is_uri=True)
54
+ else:
55
+ return Value(value=ent, is_uri=False)
56
+
57
+ def handle(self, msg):
58
+
59
+ try:
60
+
61
+ v = msg.value()
62
+
63
+ # Sender-produced ID
64
+ id = msg.properties()["id"]
65
+
66
+ print(f"Handling input {id}...", flush=True)
67
+
68
+ triples = []
69
+
70
+ if v.s is not None:
71
+ if v.p is not None:
72
+ if v.o is not None:
73
+
74
+ # SPO
75
+
76
+ records = self.io.query(
77
+ "MATCH (src:Node {uri: $src})-[rel:Rel {uri: $rel}]->(dest:Literal {value: $value}) "
78
+ "RETURN $src as src",
79
+ src=v.s.value, rel=v.p.value, value=v.o.value,
80
+ database_=self.db,
81
+ ).result_set
82
+
83
+ for rec in records:
84
+ triples.append((v.s.value, v.p.value, v.o.value))
85
+
86
+ records = self.io.query(
87
+ "MATCH (src:Node {uri: $src})-[rel:Rel {uri: $rel}]->(dest:Node {uri: $uri}) "
88
+ "RETURN $src as src",
89
+ src=v.s.value, rel=v.p.value, uri=v.o.value,
90
+ database_=self.db,
91
+ ).result_set
92
+
93
+ for rec in records:
94
+ triples.append((v.s.value, v.p.value, v.o.value))
95
+
96
+ else:
97
+
98
+ # SP
99
+
100
+ records = self.io.query(
101
+ "MATCH (src:Node {uri: $src})-[rel:Rel {uri: $rel}]->(dest:Literal) "
102
+ "RETURN dest.value as dest",
103
+ src=v.s.value, rel=v.p.value,
104
+ database_=self.db,
105
+ ).result_set
106
+
107
+ for rec in records:
108
+ data = rec.data()
109
+ triples.append((v.s.value, v.p.value, data["dest"]))
110
+
111
+ records = self.io.query(
112
+ "MATCH (src:Node {uri: $src})-[rel:Rel {uri: $rel}]->(dest:Node) "
113
+ "RETURN dest.uri as dest",
114
+ src=v.s.value, rel=v.p.value,
115
+ database_=self.db,
116
+ ).result_set
117
+
118
+ for rec in records:
119
+ data = rec.data()
120
+ triples.append((v.s.value, v.p.value, data["dest"]))
121
+
122
+ else:
123
+
124
+ if v.o is not None:
125
+
126
+ # SO
127
+
128
+ records = self.io.query(
129
+ "MATCH (src:Node {uri: $src})-[rel:Rel]->(dest:Literal {value: $value}) "
130
+ "RETURN rel.uri as rel",
131
+ src=v.s.value, value=v.o.value,
132
+ database_=self.db,
133
+ ).result_set
134
+
135
+ for rec in records:
136
+ data = rec.data()
137
+ triples.append((v.s.value, data["rel"], v.o.value))
138
+
139
+ records = self.io.query(
140
+ "MATCH (src:Node {uri: $src})-[rel:Rel]->(dest:Node {uri: $uri}) "
141
+ "RETURN rel.uri as rel",
142
+ src=v.s.value, uri=v.o.value,
143
+ database_=self.db,
144
+ ).result_set
145
+
146
+ for rec in records:
147
+ data = rec.data()
148
+ triples.append((v.s.value, data["rel"], v.o.value))
149
+
150
+ else:
151
+
152
+ # S
153
+
154
+ records = self.io.query(
155
+ "MATCH (src:Node {uri: $src})-[rel:Rel]->(dest:Literal) "
156
+ "RETURN rel.uri as rel, dest.value as dest",
157
+ src=v.s.value,
158
+ database_=self.db,
159
+ ).result_set
160
+
161
+ for rec in records:
162
+ data = rec.data()
163
+ triples.append((v.s.value, data["rel"], data["dest"]))
164
+
165
+ records = self.io.query(
166
+ "MATCH (src:Node {uri: $src})-[rel:Rel]->(dest:Node) "
167
+ "RETURN rel.uri as rel, dest.uri as dest",
168
+ src=v.s.value,
169
+ database_=self.db,
170
+ ).result_set
171
+
172
+ for rec in records:
173
+ data = rec.data()
174
+ triples.append((v.s.value, data["rel"], data["dest"]))
175
+
176
+
177
+ else:
178
+
179
+ if v.p is not None:
180
+
181
+ if v.o is not None:
182
+
183
+ # PO
184
+
185
+ records = self.io.query(
186
+ "MATCH (src:Node)-[rel:Rel {uri: $uri}]->(dest:Literal {value: $value}) "
187
+ "RETURN src.uri as src",
188
+ uri=v.p.value, value=v.o.value,
189
+ database_=self.db,
190
+ ).result_set
191
+
192
+ for rec in records:
193
+ data = rec.data()
194
+ triples.append((data["src"], v.p.value, v.o.value))
195
+
196
+ records = self.io.query(
197
+ "MATCH (src:Node)-[rel:Rel {uri: $uri}]->(dest:Node {uri: $uri}) "
198
+ "RETURN src.uri as src",
199
+ uri=v.p.value, dest=v.o.value,
200
+ database_=self.db,
201
+ ).result_set
202
+
203
+ for rec in records:
204
+ data = rec.data()
205
+ triples.append((data["src"], v.p.value, v.o.value))
206
+
207
+ else:
208
+
209
+ # P
210
+
211
+ records = self.io.query(
212
+ "MATCH (src:Node)-[rel:Rel {uri: $uri}]->(dest:Literal) "
213
+ "RETURN src.uri as src, dest.value as dest",
214
+ uri=v.p.value,
215
+ database_=self.db,
216
+ ).result_set
217
+
218
+ for rec in records:
219
+ data = rec.data()
220
+ triples.append((data["src"], v.p.value, data["dest"]))
221
+
222
+ records = self.io.query(
223
+ "MATCH (src:Node)-[rel:Rel {uri: $uri}]->(dest:Node) "
224
+ "RETURN src.uri as src, dest.uri as dest",
225
+ uri=v.p.value,
226
+ database_=self.db,
227
+ ).result_set
228
+
229
+ for rec in records:
230
+ data = rec.data()
231
+ triples.append((data["src"], v.p.value, data["dest"]))
232
+
233
+ else:
234
+
235
+ if v.o is not None:
236
+
237
+ # O
238
+
239
+ records = self.io.query(
240
+ "MATCH (src:Node)-[rel:Rel]->(dest:Literal {value: $value}) "
241
+ "RETURN src.uri as src, rel.uri as rel",
242
+ value=v.o.value,
243
+ database_=self.db,
244
+ ).result_set
245
+
246
+ for rec in records:
247
+ data = rec.data()
248
+ triples.append((data["src"], data["rel"], v.o.value))
249
+
250
+ records = self.io.query(
251
+ "MATCH (src:Node)-[rel:Rel]->(dest:Node {uri: $uri}) "
252
+ "RETURN src.uri as src, rel.uri as rel",
253
+ uri=v.o.value,
254
+ database_=self.db,
255
+ ).result_set
256
+
257
+ for rec in records:
258
+ data = rec.data()
259
+ triples.append((data["src"], data["rel"], v.o.value))
260
+
261
+ else:
262
+
263
+ # *
264
+
265
+ records = self.io.query(
266
+ "MATCH (src:Node)-[rel:Rel]->(dest:Literal) "
267
+ "RETURN src.uri as src, rel.uri as rel, dest.value as dest",
268
+ database_=self.db,
269
+ ).result_set
270
+
271
+ for rec in records:
272
+ data = rec.data()
273
+ triples.append((data["src"], data["rel"], data["dest"]))
274
+
275
+ records = self.io.query(
276
+ "MATCH (src:Node)-[rel:Rel]->(dest:Node) "
277
+ "RETURN src.uri as src, rel.uri as rel, dest.uri as dest",
278
+ database_=self.db,
279
+ ).result_set
280
+
281
+ for rec in records:
282
+ data = rec.data()
283
+ triples.append((data["src"], data["rel"], data["dest"]))
284
+
285
+ triples = [
286
+ Triple(
287
+ s=self.create_value(t[0]),
288
+ p=self.create_value(t[1]),
289
+ o=self.create_value(t[2])
290
+ )
291
+ for t in triples
292
+ ]
293
+
294
+ print("Send response...", flush=True)
295
+ r = TriplesQueryResponse(triples=triples, error=None)
296
+ self.producer.send(r, properties={"id": id})
297
+
298
+ print("Done.", flush=True)
299
+
300
+ except Exception as e:
301
+
302
+ print(f"Exception: {e}")
303
+
304
+ print("Send error response...", flush=True)
305
+
306
+ r = TriplesQueryResponse(
307
+ error=Error(
308
+ type = "llm-error",
309
+ message = str(e),
310
+ ),
311
+ response=None,
312
+ )
313
+
314
+ self.producer.send(r, properties={"id": id})
315
+
316
+ self.consumer.acknowledge(msg)
317
+
318
+ @staticmethod
319
+ def add_args(parser):
320
+
321
+ ConsumerProducer.add_args(
322
+ parser, default_input_queue, default_subscriber,
323
+ default_output_queue,
324
+ )
325
+
326
+ parser.add_argument(
327
+ '-g', '--graph-url',
328
+ default=default_graph_url,
329
+ help=f'Graph url (default: {default_graph_url})'
330
+ )
331
+
332
+ parser.add_argument(
333
+ '--database',
334
+ default=default_database,
335
+ help=f'FalkorDB database (default: {default_database})'
336
+ )
337
+
338
+ def run():
339
+
340
+ Processor.start(module, __doc__)
341
+
@@ -0,0 +1,3 @@
1
+
2
+ from . service import *
3
+
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env python3
2
+
3
+ from . hf import run
4
+
5
+ if __name__ == '__main__':
6
+ run()
7
+
@@ -0,0 +1,150 @@
1
+
2
+ """
3
+ Graph writer. Input is graph edge. Writes edges to FalkorDB graph.
4
+ """
5
+
6
+ import pulsar
7
+ import base64
8
+ import os
9
+ import argparse
10
+ import time
11
+
12
+ from falkordb import FalkorDB
13
+
14
+ from .... schema import Triples
15
+ from .... schema import triples_store_queue
16
+ from .... log_level import LogLevel
17
+ from .... base import Consumer
18
+
19
+ module = ".".join(__name__.split(".")[1:-1])
20
+
21
+ default_input_queue = triples_store_queue
22
+ default_subscriber = module
23
+
24
+ default_graph_url = 'falkor://falkordb:6379'
25
+ default_database = 'falkordb'
26
+
27
+ class Processor(Consumer):
28
+
29
+ def __init__(self, **params):
30
+
31
+ input_queue = params.get("input_queue", default_input_queue)
32
+ subscriber = params.get("subscriber", default_subscriber)
33
+ graph_url = params.get("graph_host", default_graph_url)
34
+ database = params.get("database", default_database)
35
+
36
+ super(Processor, self).__init__(
37
+ **params | {
38
+ "input_queue": input_queue,
39
+ "subscriber": subscriber,
40
+ "input_schema": Triples,
41
+ "graph_url": graph_url,
42
+ }
43
+ )
44
+
45
+ self.db = database
46
+
47
+ self.io = FalkorDB.from_url(graph_url).select_graph(database)
48
+
49
+ def create_node(self, uri):
50
+
51
+ print("Create node", uri)
52
+
53
+ res = self.io.query(
54
+ "MERGE (n:Node {uri: $uri})",
55
+ uri=uri,
56
+ database_=self.db,
57
+ )
58
+
59
+ print("Created {nodes_created} nodes in {time} ms.".format(
60
+ nodes_created=res.nodes_created,
61
+ time=res.run_time_ms
62
+ ))
63
+
64
+ def create_literal(self, value):
65
+
66
+ print("Create literal", value)
67
+
68
+ res = self.io.query(
69
+ "MERGE (n:Literal {value: $value})",
70
+ value=value,
71
+ database_=self.db,
72
+ )
73
+
74
+ print("Created {nodes_created} nodes in {time} ms.".format(
75
+ nodes_created=res.nodes_created,
76
+ time=res.run_time_ms
77
+ ))
78
+
79
+ def relate_node(self, src, uri, dest):
80
+
81
+ print("Create node rel", src, uri, dest)
82
+
83
+ res = self.io.query(
84
+ "MATCH (src:Node {uri: $src}) "
85
+ "MATCH (dest:Node {uri: $dest}) "
86
+ "MERGE (src)-[:Rel {uri: $uri}]->(dest)",
87
+ src=src, dest=dest, uri=uri,
88
+ database_=self.db,
89
+ )
90
+
91
+ print("Created {nodes_created} nodes in {time} ms.".format(
92
+ nodes_created=res.nodes_created,
93
+ time=res.run_time_ms
94
+ ))
95
+
96
+ def relate_literal(self, src, uri, dest):
97
+
98
+ print("Create literal rel", src, uri, dest)
99
+
100
+ res = self.io.query(
101
+ "MATCH (src:Node {uri: $src}) "
102
+ "MATCH (dest:Literal {value: $dest}) "
103
+ "MERGE (src)-[:Rel {uri: $uri}]->(dest)",
104
+ src=src, dest=dest, uri=uri,
105
+ database_=self.db,
106
+ )
107
+
108
+ print("Created {nodes_created} nodes in {time} ms.".format(
109
+ nodes_created=res.nodes_created,
110
+ time=res.run_time_ms
111
+ ))
112
+
113
+ def handle(self, msg):
114
+
115
+ v = msg.value()
116
+
117
+ for t in v.triples:
118
+
119
+ self.create_node(t.s.value)
120
+
121
+ if t.o.is_uri:
122
+ self.create_node(t.o.value)
123
+ self.relate_node(t.s.value, t.p.value, t.o.value)
124
+ else:
125
+ self.create_literal(t.o.value)
126
+ self.relate_literal(t.s.value, t.p.value, t.o.value)
127
+
128
+ @staticmethod
129
+ def add_args(parser):
130
+
131
+ Consumer.add_args(
132
+ parser, default_input_queue, default_subscriber,
133
+ )
134
+
135
+ parser.add_argument(
136
+ '-g', '--graph_host',
137
+ default=default_graph_url,
138
+ help=f'Graph host (default: {default_graph_url})'
139
+ )
140
+
141
+ parser.add_argument(
142
+ '--database',
143
+ default=default_database,
144
+ help=f'FalkorDB database (default: {default_database})'
145
+ )
146
+
147
+ def run():
148
+
149
+ Processor.start(module, __doc__)
150
+
@@ -0,0 +1,3 @@
1
+
2
+ from . write import *
3
+
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env python3
2
+
3
+ from . write import run
4
+
5
+ if __name__ == '__main__':
6
+ run()
7
+
@@ -1,6 +1,6 @@
1
1
 
2
2
  """
3
- Graph writer. Input is graph edge. Writes edges to Cassandra graph.
3
+ Graph writer. Input is graph edge. Writes edges to Neo4j graph.
4
4
  """
5
5
 
6
6
  import pulsar
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: trustgraph-flow
3
- Version: 0.18.2
3
+ Version: 0.18.3
4
4
  Summary: TrustGraph provides a means to run a pipeline of flexible AI processing components in a flexible means to achieve a processing pipeline.
5
5
  Home-page: https://github.com/trustgraph-ai/trustgraph
6
6
  Author: trustgraph.ai
7
7
  Author-email: security@trustgraph.ai
8
8
  License: UNKNOWN
9
- Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.18.2.tar.gz
9
+ Download-URL: https://github.com/trustgraph-ai/trustgraph/archive/refs/tags/v0.18.3.tar.gz
10
10
  Platform: UNKNOWN
11
11
  Classifier: Programming Language :: Python :: 3
12
12
  Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
@@ -40,9 +40,11 @@ scripts/text-completion-llamafile
40
40
  scripts/text-completion-ollama
41
41
  scripts/text-completion-openai
42
42
  scripts/triples-query-cassandra
43
+ scripts/triples-query-falkordb
43
44
  scripts/triples-query-memgraph
44
45
  scripts/triples-query-neo4j
45
46
  scripts/triples-write-cassandra
47
+ scripts/triples-write-falkordb
46
48
  scripts/triples-write-memgraph
47
49
  scripts/triples-write-neo4j
48
50
  scripts/wikipedia-lookup
@@ -192,6 +194,9 @@ trustgraph/query/triples/__init__.py
192
194
  trustgraph/query/triples/cassandra/__init__.py
193
195
  trustgraph/query/triples/cassandra/__main__.py
194
196
  trustgraph/query/triples/cassandra/service.py
197
+ trustgraph/query/triples/falkordb/__init__.py
198
+ trustgraph/query/triples/falkordb/__main__.py
199
+ trustgraph/query/triples/falkordb/service.py
195
200
  trustgraph/query/triples/memgraph/__init__.py
196
201
  trustgraph/query/triples/memgraph/__main__.py
197
202
  trustgraph/query/triples/memgraph/service.py
@@ -238,6 +243,9 @@ trustgraph/storage/triples/__init__.py
238
243
  trustgraph/storage/triples/cassandra/__init__.py
239
244
  trustgraph/storage/triples/cassandra/__main__.py
240
245
  trustgraph/storage/triples/cassandra/write.py
246
+ trustgraph/storage/triples/falkordb/__init__.py
247
+ trustgraph/storage/triples/falkordb/__main__.py
248
+ trustgraph/storage/triples/falkordb/write.py
241
249
  trustgraph/storage/triples/memgraph/__init__.py
242
250
  trustgraph/storage/triples/memgraph/__main__.py
243
251
  trustgraph/storage/triples/memgraph/write.py
@@ -2,6 +2,7 @@ aiohttp
2
2
  anthropic
3
3
  cassandra-driver
4
4
  cohere
5
+ falkordb
5
6
  google-generativeai
6
7
  ibis
7
8
  jsonschema
@@ -1 +0,0 @@
1
- __version__ = "0.18.2"