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