trustgraph-cli 2.2.15__tar.gz → 2.2.17__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 (87) hide show
  1. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/PKG-INFO +1 -1
  2. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/pyproject.toml +1 -0
  3. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/dump_queues.py +2 -4
  4. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/init_trustgraph.py +53 -33
  5. trustgraph_cli-2.2.17/trustgraph/cli/invoke_sparql_query.py +239 -0
  6. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/monitor_prompts.py +2 -4
  7. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/verify_system_status.py +2 -12
  8. trustgraph_cli-2.2.17/trustgraph/cli_version.py +1 -0
  9. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph_cli.egg-info/PKG-INFO +1 -1
  10. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph_cli.egg-info/SOURCES.txt +1 -0
  11. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph_cli.egg-info/entry_points.txt +1 -0
  12. trustgraph_cli-2.2.15/trustgraph/cli_version.py +0 -1
  13. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/README.md +0 -0
  14. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/setup.cfg +0 -0
  15. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/__init__.py +0 -0
  16. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/add_library_document.py +0 -0
  17. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/delete_collection.py +0 -0
  18. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/delete_config_item.py +0 -0
  19. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/delete_flow_blueprint.py +0 -0
  20. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/delete_kg_core.py +0 -0
  21. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/delete_mcp_tool.py +0 -0
  22. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/delete_tool.py +0 -0
  23. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/dump_msgpack.py +0 -0
  24. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/get_config_item.py +0 -0
  25. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/get_document_content.py +0 -0
  26. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/get_flow_blueprint.py +0 -0
  27. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/get_kg_core.py +0 -0
  28. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/graph_to_turtle.py +0 -0
  29. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/init_pulsar_manager.py +0 -0
  30. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/invoke_agent.py +0 -0
  31. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/invoke_document_embeddings.py +0 -0
  32. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/invoke_document_rag.py +0 -0
  33. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/invoke_embeddings.py +0 -0
  34. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/invoke_graph_embeddings.py +0 -0
  35. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/invoke_graph_rag.py +0 -0
  36. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/invoke_llm.py +0 -0
  37. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/invoke_mcp_tool.py +0 -0
  38. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/invoke_nlp_query.py +0 -0
  39. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/invoke_prompt.py +0 -0
  40. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/invoke_row_embeddings.py +0 -0
  41. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/invoke_rows_query.py +0 -0
  42. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/invoke_structured_query.py +0 -0
  43. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/list_collections.py +0 -0
  44. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/list_config_items.py +0 -0
  45. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/list_explain_traces.py +0 -0
  46. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/load_doc_embeds.py +0 -0
  47. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/load_kg_core.py +0 -0
  48. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/load_knowledge.py +0 -0
  49. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/load_sample_documents.py +0 -0
  50. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/load_structured_data.py +0 -0
  51. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/load_turtle.py +0 -0
  52. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/put_config_item.py +0 -0
  53. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/put_flow_blueprint.py +0 -0
  54. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/put_kg_core.py +0 -0
  55. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/query_graph.py +0 -0
  56. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/remove_library_document.py +0 -0
  57. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/save_doc_embeds.py +0 -0
  58. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/set_collection.py +0 -0
  59. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/set_mcp_tool.py +0 -0
  60. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/set_prompt.py +0 -0
  61. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/set_token_costs.py +0 -0
  62. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/set_tool.py +0 -0
  63. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/show_config.py +0 -0
  64. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/show_explain_trace.py +0 -0
  65. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/show_extraction_provenance.py +0 -0
  66. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/show_flow_blueprints.py +0 -0
  67. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/show_flow_state.py +0 -0
  68. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/show_flows.py +0 -0
  69. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/show_graph.py +0 -0
  70. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/show_kg_cores.py +0 -0
  71. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/show_library_documents.py +0 -0
  72. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/show_library_processing.py +0 -0
  73. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/show_mcp_tools.py +0 -0
  74. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/show_parameter_types.py +0 -0
  75. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/show_processor_state.py +0 -0
  76. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/show_prompts.py +0 -0
  77. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/show_token_costs.py +0 -0
  78. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/show_token_rate.py +0 -0
  79. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/show_tools.py +0 -0
  80. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/start_flow.py +0 -0
  81. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/start_library_processing.py +0 -0
  82. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/stop_flow.py +0 -0
  83. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/stop_library_processing.py +0 -0
  84. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph/cli/unload_kg_core.py +0 -0
  85. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph_cli.egg-info/dependency_links.txt +0 -0
  86. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph_cli.egg-info/requires.txt +0 -0
  87. {trustgraph_cli-2.2.15 → trustgraph_cli-2.2.17}/trustgraph_cli.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trustgraph-cli
3
- Version: 2.2.15
3
+ Version: 2.2.17
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
  Author-email: "trustgraph.ai" <security@trustgraph.ai>
6
6
  Project-URL: Homepage, https://github.com/trustgraph-ai/trustgraph
@@ -51,6 +51,7 @@ tg-invoke-document-embeddings = "trustgraph.cli.invoke_document_embeddings:main"
51
51
  tg-invoke-mcp-tool = "trustgraph.cli.invoke_mcp_tool:main"
52
52
  tg-invoke-nlp-query = "trustgraph.cli.invoke_nlp_query:main"
53
53
  tg-invoke-rows-query = "trustgraph.cli.invoke_rows_query:main"
54
+ tg-invoke-sparql-query = "trustgraph.cli.invoke_sparql_query:main"
54
55
  tg-invoke-row-embeddings = "trustgraph.cli.invoke_row_embeddings:main"
55
56
  tg-invoke-prompt = "trustgraph.cli.invoke_prompt:main"
56
57
  tg-invoke-structured-query = "trustgraph.cli.invoke_structured_query:main"
@@ -354,10 +354,8 @@ IMPORTANT:
354
354
  output_file=args.output,
355
355
  subscriber_name=args.subscriber,
356
356
  append_mode=args.append,
357
- pubsub_backend=args.pubsub_backend,
358
- pulsar_host=args.pulsar_host,
359
- pulsar_api_key=args.pulsar_api_key,
360
- pulsar_listener=args.pulsar_listener,
357
+ **{k: v for k, v in vars(args).items()
358
+ if k not in ('queues', 'output', 'subscriber', 'append')},
361
359
  ))
362
360
  except KeyboardInterrupt:
363
361
  # Already handled in async_main
@@ -1,5 +1,8 @@
1
1
  """
2
- Initialises Pulsar with Trustgraph tenant / namespaces & policy.
2
+ Initialises TrustGraph pub/sub infrastructure and pushes initial config.
3
+
4
+ For Pulsar: creates tenant, namespaces, and retention policies.
5
+ For RabbitMQ: queues are auto-declared, so only config push is needed.
3
6
  """
4
7
 
5
8
  import requests
@@ -8,10 +11,11 @@ import argparse
8
11
  import json
9
12
 
10
13
  from trustgraph.clients.config_client import ConfigClient
14
+ from trustgraph.base.pubsub import add_pubsub_args
11
15
 
12
16
  default_pulsar_admin_url = "http://pulsar:8080"
13
- default_pulsar_host = "pulsar://pulsar:6650"
14
- subscriber = "tg-init-pulsar"
17
+ subscriber = "tg-init-pubsub"
18
+
15
19
 
16
20
  def get_clusters(url):
17
21
 
@@ -65,12 +69,11 @@ def ensure_namespace(url, tenant, namespace, config):
65
69
 
66
70
  print(f"Namespace {tenant}/{namespace} created.", flush=True)
67
71
 
68
- def ensure_config(config, pulsar_host, pulsar_api_key):
72
+ def ensure_config(config, **pubsub_config):
69
73
 
70
74
  cli = ConfigClient(
71
75
  subscriber=subscriber,
72
- pulsar_host=pulsar_host,
73
- pulsar_api_key=pulsar_api_key,
76
+ **pubsub_config,
74
77
  )
75
78
 
76
79
  while True:
@@ -115,11 +118,9 @@ def ensure_config(config, pulsar_host, pulsar_api_key):
115
118
  time.sleep(2)
116
119
  print("Retrying...", flush=True)
117
120
  continue
118
-
119
- def init(
120
- pulsar_admin_url, pulsar_host, pulsar_api_key, tenant,
121
- config, config_file,
122
- ):
121
+
122
+ def init_pulsar(pulsar_admin_url, tenant):
123
+ """Pulsar-specific setup: create tenant, namespaces, retention policies."""
123
124
 
124
125
  clusters = get_clusters(pulsar_admin_url)
125
126
 
@@ -145,17 +146,21 @@ def init(
145
146
  }
146
147
  })
147
148
 
148
- if config is not None:
149
+
150
+ def push_config(config_json, config_file, **pubsub_config):
151
+ """Push initial config if provided."""
152
+
153
+ if config_json is not None:
149
154
 
150
155
  try:
151
156
  print("Decoding config...", flush=True)
152
- dec = json.loads(config)
157
+ dec = json.loads(config_json)
153
158
  print("Decoded.", flush=True)
154
159
  except Exception as e:
155
160
  print("Exception:", e, flush=True)
156
161
  raise e
157
162
 
158
- ensure_config(dec, pulsar_host, pulsar_api_key)
163
+ ensure_config(dec, **pubsub_config)
159
164
 
160
165
  elif config_file is not None:
161
166
 
@@ -167,11 +172,12 @@ def init(
167
172
  print("Exception:", e, flush=True)
168
173
  raise e
169
174
 
170
- ensure_config(dec, pulsar_host, pulsar_api_key)
175
+ ensure_config(dec, **pubsub_config)
171
176
 
172
177
  else:
173
178
  print("No config to update.", flush=True)
174
179
 
180
+
175
181
  def main():
176
182
 
177
183
  parser = argparse.ArgumentParser(
@@ -180,22 +186,11 @@ def main():
180
186
  )
181
187
 
182
188
  parser.add_argument(
183
- '-p', '--pulsar-admin-url',
189
+ '--pulsar-admin-url',
184
190
  default=default_pulsar_admin_url,
185
191
  help=f'Pulsar admin URL (default: {default_pulsar_admin_url})',
186
192
  )
187
193
 
188
- parser.add_argument(
189
- '--pulsar-host',
190
- default=default_pulsar_host,
191
- help=f'Pulsar host (default: {default_pulsar_host})',
192
- )
193
-
194
- parser.add_argument(
195
- '--pulsar-api-key',
196
- help=f'Pulsar API key',
197
- )
198
-
199
194
  parser.add_argument(
200
195
  '-c', '--config',
201
196
  help=f'Initial configuration to load',
@@ -212,18 +207,43 @@ def main():
212
207
  help=f'Tenant (default: tg)',
213
208
  )
214
209
 
210
+ add_pubsub_args(parser)
211
+
215
212
  args = parser.parse_args()
216
213
 
214
+ backend_type = args.pubsub_backend
215
+
216
+ # Extract pubsub config from args
217
+ pubsub_config = {
218
+ k: v for k, v in vars(args).items()
219
+ if k not in ('pulsar_admin_url', 'config', 'config_file', 'tenant')
220
+ }
221
+
217
222
  while True:
218
223
 
219
224
  try:
220
225
 
221
- print(flush=True)
222
- print(
223
- f"Initialising with Pulsar {args.pulsar_admin_url}...",
224
- flush=True
226
+ # Pulsar-specific setup (tenants, namespaces)
227
+ if backend_type == 'pulsar':
228
+ print(flush=True)
229
+ print(
230
+ f"Initialising Pulsar at {args.pulsar_admin_url}...",
231
+ flush=True,
232
+ )
233
+ init_pulsar(args.pulsar_admin_url, args.tenant)
234
+ else:
235
+ print(flush=True)
236
+ print(
237
+ f"Using {backend_type} backend (no admin setup needed).",
238
+ flush=True,
239
+ )
240
+
241
+ # Push config (works with any backend)
242
+ push_config(
243
+ args.config, args.config_file,
244
+ **pubsub_config,
225
245
  )
226
- init(**vars(args))
246
+
227
247
  print("Initialisation complete.", flush=True)
228
248
  break
229
249
 
@@ -236,4 +256,4 @@ def main():
236
256
  print("Will retry...", flush=True)
237
257
 
238
258
  if __name__ == "__main__":
239
- main()
259
+ main()
@@ -0,0 +1,239 @@
1
+ """
2
+ Execute a SPARQL query against the TrustGraph knowledge graph.
3
+ """
4
+
5
+ import argparse
6
+ import os
7
+ import json
8
+ import sys
9
+ from trustgraph.api import Api
10
+
11
+ default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/')
12
+ default_user = 'trustgraph'
13
+ default_collection = 'default'
14
+
15
+
16
+ def _term_cell(val):
17
+ """Extract display string from a wire-format term."""
18
+ if val is None:
19
+ return ""
20
+ t = val.get("t", "")
21
+ if t == "i":
22
+ return val.get("i", "")
23
+ elif t == "l":
24
+ return val.get("v", "")
25
+ return val.get("v", val.get("i", ""))
26
+
27
+
28
+ def _term_str(val):
29
+ """Convert a wire-format term to a Turtle-style display string."""
30
+ if val is None:
31
+ return "?"
32
+ t = val.get("t", "")
33
+ if t == "i":
34
+ return f"<{val.get('i', '')}>"
35
+ elif t == "l":
36
+ v = val.get("v", "")
37
+ dt = val.get("d", "")
38
+ lang = val.get("l", "")
39
+ if lang:
40
+ return f'"{v}"@{lang}'
41
+ elif dt:
42
+ return f'"{v}"^^<{dt}>'
43
+ return f'"{v}"'
44
+ return str(val)
45
+
46
+
47
+ def sparql_query(url, token, flow_id, query, user, collection, limit,
48
+ batch_size, output_format):
49
+
50
+ socket = Api(url=url, token=token).socket()
51
+ flow = socket.flow(flow_id)
52
+
53
+ variables = None
54
+ all_rows = []
55
+
56
+ try:
57
+
58
+ for response in flow.sparql_query_stream(
59
+ query=query,
60
+ user=user,
61
+ collection=collection,
62
+ limit=limit,
63
+ batch_size=batch_size,
64
+ ):
65
+ query_type = response.get("query-type", "select")
66
+
67
+ # ASK queries - just print and return
68
+ if query_type == "ask":
69
+ print("true" if response.get("ask-result") else "false")
70
+ return
71
+
72
+ # CONSTRUCT/DESCRIBE - print triples
73
+ if query_type in ("construct", "describe"):
74
+ triples = response.get("triples", [])
75
+ if not triples:
76
+ print("No triples.")
77
+ elif output_format == "json":
78
+ print(json.dumps(triples, indent=2))
79
+ else:
80
+ for t in triples:
81
+ s = _term_str(t.get("s"))
82
+ p = _term_str(t.get("p"))
83
+ o = _term_str(t.get("o"))
84
+ print(f"{s} {p} {o} .")
85
+ return
86
+
87
+ # SELECT - accumulate bindings across batches
88
+ if variables is None:
89
+ variables = response.get("variables", [])
90
+
91
+ bindings = response.get("bindings", [])
92
+ for binding in bindings:
93
+ values = binding.get("values", [])
94
+ all_rows.append([_term_cell(v) for v in values])
95
+
96
+ # Output SELECT results
97
+ if variables is None:
98
+ print("No results.")
99
+ return
100
+
101
+ if not all_rows:
102
+ print("No results.")
103
+ return
104
+
105
+ if output_format == "json":
106
+ rows = []
107
+ for row in all_rows:
108
+ rows.append({
109
+ var: cell for var, cell in zip(variables, row)
110
+ })
111
+ print(json.dumps(rows, indent=2))
112
+ else:
113
+ # Table format
114
+ col_widths = [len(v) for v in variables]
115
+ for row in all_rows:
116
+ for i, cell in enumerate(row):
117
+ if i < len(col_widths):
118
+ col_widths[i] = max(col_widths[i], len(cell))
119
+
120
+ header = " | ".join(
121
+ v.ljust(col_widths[i]) for i, v in enumerate(variables)
122
+ )
123
+ separator = "-+-".join("-" * w for w in col_widths)
124
+ print(header)
125
+ print(separator)
126
+ for row in all_rows:
127
+ line = " | ".join(
128
+ cell.ljust(col_widths[i]) if i < len(col_widths) else cell
129
+ for i, cell in enumerate(row)
130
+ )
131
+ print(line)
132
+
133
+ finally:
134
+ socket.close()
135
+
136
+
137
+ def main():
138
+
139
+ parser = argparse.ArgumentParser(
140
+ prog='tg-invoke-sparql-query',
141
+ description=__doc__,
142
+ )
143
+
144
+ parser.add_argument(
145
+ '-u', '--url',
146
+ default=default_url,
147
+ help=f'API URL (default: {default_url})',
148
+ )
149
+
150
+ parser.add_argument(
151
+ '-t', '--token',
152
+ default=os.getenv("TRUSTGRAPH_TOKEN"),
153
+ help='API bearer token (default: TRUSTGRAPH_TOKEN env var)',
154
+ )
155
+
156
+ parser.add_argument(
157
+ '-f', '--flow-id',
158
+ default="default",
159
+ help='Flow ID (default: default)',
160
+ )
161
+
162
+ parser.add_argument(
163
+ '-q', '--query',
164
+ help='SPARQL query string',
165
+ )
166
+
167
+ parser.add_argument(
168
+ '-i', '--input',
169
+ help='Read SPARQL query from file (use - for stdin)',
170
+ )
171
+
172
+ parser.add_argument(
173
+ '-U', '--user',
174
+ default=default_user,
175
+ help=f'User ID (default: {default_user})',
176
+ )
177
+
178
+ parser.add_argument(
179
+ '-C', '--collection',
180
+ default=default_collection,
181
+ help=f'Collection ID (default: {default_collection})',
182
+ )
183
+
184
+ parser.add_argument(
185
+ '-l', '--limit',
186
+ type=int,
187
+ default=10000,
188
+ help='Result limit (default: 10000)',
189
+ )
190
+
191
+ parser.add_argument(
192
+ '-b', '--batch-size',
193
+ type=int,
194
+ default=20,
195
+ help='Streaming batch size (default: 20)',
196
+ )
197
+
198
+ parser.add_argument(
199
+ '--format',
200
+ choices=['table', 'json'],
201
+ default='table',
202
+ help='Output format (default: table)',
203
+ )
204
+
205
+ args = parser.parse_args()
206
+
207
+ # Get query from argument or file
208
+ query = args.query
209
+ if not query and args.input:
210
+ if args.input == '-':
211
+ query = sys.stdin.read()
212
+ else:
213
+ with open(args.input) as f:
214
+ query = f.read()
215
+
216
+ if not query:
217
+ parser.error("Either -q/--query or -i/--input is required")
218
+
219
+ try:
220
+
221
+ sparql_query(
222
+ url=args.url,
223
+ token=args.token,
224
+ flow_id=args.flow_id,
225
+ query=query,
226
+ user=args.user,
227
+ collection=args.collection,
228
+ limit=args.limit,
229
+ batch_size=args.batch_size,
230
+ output_format=args.format,
231
+ )
232
+
233
+ except Exception as e:
234
+ print(f"Exception: {e}", flush=True, file=sys.stderr)
235
+ sys.exit(1)
236
+
237
+
238
+ if __name__ == "__main__":
239
+ main()
@@ -316,10 +316,8 @@ def main():
316
316
  queue_type=args.queue_type,
317
317
  max_lines=args.max_lines,
318
318
  max_width=args.max_width,
319
- pulsar_host=args.pulsar_host,
320
- pulsar_api_key=args.pulsar_api_key,
321
- pulsar_listener=args.pulsar_listener,
322
- pubsub_backend=args.pubsub_backend,
319
+ **{k: v for k, v in vars(args).items()
320
+ if k not in ('flow', 'queue_type', 'max_lines', 'max_width')},
323
321
  ))
324
322
  except KeyboardInterrupt:
325
323
  pass
@@ -377,24 +377,14 @@ def main():
377
377
  print("=" * 60)
378
378
  print("TrustGraph System Status Verification")
379
379
  print("=" * 60)
380
- # print(f"Global timeout: {args.global_timeout}s")
381
- # print(f"Check timeout: {args.check_timeout}s")
382
- # print(f"Retry delay: {args.retry_delay}s")
383
- # print("=" * 60)
384
380
  print()
385
381
 
386
382
  # Phase 1: Infrastructure
387
383
  print("Phase 1: Infrastructure")
388
384
  print("-" * 60)
389
385
 
390
- if not checker.run_check(
391
- "Pulsar",
392
- check_pulsar,
393
- args.pulsar_url,
394
- args.check_timeout
395
- ):
396
- print("\n⚠️ Pulsar is not responding - other checks may fail")
397
- print()
386
+ # Pulsar check is skipped — not all deployments use Pulsar.
387
+ # The API Gateway check covers broker connectivity indirectly.
398
388
 
399
389
  checker.run_check(
400
390
  "API Gateway",
@@ -0,0 +1 @@
1
+ __version__ = "2.2.17"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trustgraph-cli
3
- Version: 2.2.15
3
+ Version: 2.2.17
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
  Author-email: "trustgraph.ai" <security@trustgraph.ai>
6
6
  Project-URL: Homepage, https://github.com/trustgraph-ai/trustgraph
@@ -30,6 +30,7 @@ trustgraph/cli/invoke_nlp_query.py
30
30
  trustgraph/cli/invoke_prompt.py
31
31
  trustgraph/cli/invoke_row_embeddings.py
32
32
  trustgraph/cli/invoke_rows_query.py
33
+ trustgraph/cli/invoke_sparql_query.py
33
34
  trustgraph/cli/invoke_structured_query.py
34
35
  trustgraph/cli/list_collections.py
35
36
  trustgraph/cli/list_config_items.py
@@ -26,6 +26,7 @@ tg-invoke-nlp-query = trustgraph.cli.invoke_nlp_query:main
26
26
  tg-invoke-prompt = trustgraph.cli.invoke_prompt:main
27
27
  tg-invoke-row-embeddings = trustgraph.cli.invoke_row_embeddings:main
28
28
  tg-invoke-rows-query = trustgraph.cli.invoke_rows_query:main
29
+ tg-invoke-sparql-query = trustgraph.cli.invoke_sparql_query:main
29
30
  tg-invoke-structured-query = trustgraph.cli.invoke_structured_query:main
30
31
  tg-list-collections = trustgraph.cli.list_collections:main
31
32
  tg-list-config-items = trustgraph.cli.list_config_items:main
@@ -1 +0,0 @@
1
- __version__ = "2.2.15"