trustgraph-cli 3.0.0rc11__tar.gz → 3.0.0rc13__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.
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/PKG-INFO +2 -1
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/pyproject.toml +10 -0
- trustgraph_cli-3.0.0rc13/trustgraph/cli/bump_graph_version.py +96 -0
- trustgraph_cli-3.0.0rc13/trustgraph/cli/delete_triples.py +127 -0
- trustgraph_cli-3.0.0rc13/trustgraph/cli/diff_graph.py +146 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/graph_to_turtle.py +30 -3
- trustgraph_cli-3.0.0rc13/trustgraph/cli/label_graph_version.py +106 -0
- trustgraph_cli-3.0.0rc13/trustgraph/cli/list_graph_versions.py +123 -0
- trustgraph_cli-3.0.0rc13/trustgraph/cli/list_named_graphs.py +104 -0
- trustgraph_cli-3.0.0rc13/trustgraph/cli/purge_graph_history.py +111 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/put_ontology.py +68 -2
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/query_graph.py +23 -8
- trustgraph_cli-3.0.0rc13/trustgraph/cli/revert_graph.py +107 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/show_explain_trace.py +17 -2
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/show_graph.py +24 -10
- trustgraph_cli-3.0.0rc13/trustgraph/cli/write_triples.py +177 -0
- trustgraph_cli-3.0.0rc13/trustgraph/cli_version.py +1 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph_cli.egg-info/PKG-INFO +2 -1
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph_cli.egg-info/SOURCES.txt +9 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph_cli.egg-info/entry_points.txt +9 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph_cli.egg-info/requires.txt +1 -0
- trustgraph_cli-3.0.0rc11/trustgraph/cli_version.py +0 -1
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/README.md +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/setup.cfg +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/__init__.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/_iam.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/add_library_document.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/bootstrap_iam.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/change_password.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/create_api_key.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/create_user.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/create_workspace.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/delete_collection.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/delete_config_item.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/delete_flow_blueprint.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/delete_kg_core.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/delete_mcp_tool.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/delete_ontology.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/delete_tool.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/delete_user.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/describe_image.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/disable_user.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/dump_msgpack.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/dump_queues.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/enable_user.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/export_workspace.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/export_workspace_config.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/get_config_item.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/get_de_core.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/get_document_content.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/get_flow_blueprint.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/get_kg_core.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/get_ontology.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/import_workspace.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/import_workspace_config.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/init_pulsar_manager.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_action.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_agent.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_chunk.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_cloze.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_concept_extraction.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_decision_scoring.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_document_decode.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_document_embeddings.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_document_rag.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_embeddings.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_extraction.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_field_extraction.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_graph_embeddings.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_graph_rag.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_knowledge_retrieval.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_llm.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_mcp_tool.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_nl_sparql.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_nlp_query.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_ontology_subset.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_orchestrator.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_planner.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_policy.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_prompt.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_query_formulation.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_reranker.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_row_embeddings.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_rows_query.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_sparql_nl_query.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_sparql_query.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_structured_query.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/invoke_verification.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/list_api_keys.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/list_cloze_models.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/list_collections.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/list_config_items.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/list_explain_traces.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/list_models.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/list_my_workspaces.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/list_ontologies.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/list_users.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/list_workspaces.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/load_doc_embeds.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/load_kg_core.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/load_knowledge.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/load_sample_documents.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/load_structured_data.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/load_turtle.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/login.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/mint_token.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/monitor_prompts.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/nquads.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/put_config_item.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/put_de_core.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/put_flow_blueprint.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/put_kg_core.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/remove_library_document.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/reset_password.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/revoke_api_key.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/sample_documents/__init__.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/sample_documents/belgian-beer.md +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/sample_documents/bronze-age-collapse.pdf +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/sample_documents/corporate-scandals.pdf +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/sample_documents/history-of-pets.md +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/sample_documents/metadata.json +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/sample_documents/mil-fortifications-america-19th-c.md +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/sample_documents/recipes.md +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/sample_documents/trade-routes-europe.md +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/save_doc_embeds.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/set_collection.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/set_mcp_tool.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/set_prompt.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/set_token_costs.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/set_tool.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/show_config.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/show_extraction_provenance.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/show_flow_blueprints.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/show_flow_state.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/show_flows.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/show_kg_cores.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/show_library_documents.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/show_library_processing.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/show_mcp_tools.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/show_parameter_types.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/show_processor_state.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/show_prompts.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/show_token_costs.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/show_token_rate.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/show_tools.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/start_flow.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/start_library_processing.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/stop_flow.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/stop_library_processing.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/unload_kg_core.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/update_user.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/verify_system_status.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph/cli/whoami.py +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/trustgraph_cli.egg-info/dependency_links.txt +0 -0
- {trustgraph_cli-3.0.0rc11 → trustgraph_cli-3.0.0rc13}/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: 3.0.
|
|
3
|
+
Version: 3.0.0rc13
|
|
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
|
|
@@ -13,6 +13,7 @@ Requires-Dist: requests
|
|
|
13
13
|
Requires-Dist: pulsar-client
|
|
14
14
|
Requires-Dist: aiohttp
|
|
15
15
|
Requires-Dist: rdflib
|
|
16
|
+
Requires-Dist: ohi-sdk<0.19,>=0.18.7
|
|
16
17
|
Requires-Dist: tabulate
|
|
17
18
|
Requires-Dist: msgpack
|
|
18
19
|
Requires-Dist: websockets
|
|
@@ -15,6 +15,7 @@ dependencies = [
|
|
|
15
15
|
"pulsar-client",
|
|
16
16
|
"aiohttp",
|
|
17
17
|
"rdflib",
|
|
18
|
+
"ohi-sdk>=0.18.7,<0.19",
|
|
18
19
|
"tabulate",
|
|
19
20
|
"msgpack",
|
|
20
21
|
"websockets",
|
|
@@ -29,10 +30,13 @@ Homepage = "https://github.com/trustgraph-ai/trustgraph"
|
|
|
29
30
|
|
|
30
31
|
[project.scripts]
|
|
31
32
|
tg-add-library-document = "trustgraph.cli.add_library_document:main"
|
|
33
|
+
tg-bump-graph-version = "trustgraph.cli.bump_graph_version:main"
|
|
32
34
|
tg-delete-flow-blueprint = "trustgraph.cli.delete_flow_blueprint:main"
|
|
33
35
|
tg-delete-mcp-tool = "trustgraph.cli.delete_mcp_tool:main"
|
|
34
36
|
tg-delete-kg-core = "trustgraph.cli.delete_kg_core:main"
|
|
35
37
|
tg-delete-tool = "trustgraph.cli.delete_tool:main"
|
|
38
|
+
tg-delete-triples = "trustgraph.cli.delete_triples:main"
|
|
39
|
+
tg-diff-graph = "trustgraph.cli.diff_graph:main"
|
|
36
40
|
tg-describe-image = "trustgraph.cli.describe_image:main"
|
|
37
41
|
tg-dump-msgpack = "trustgraph.cli.dump_msgpack:main"
|
|
38
42
|
tg-dump-queues = "trustgraph.cli.dump_queues:main"
|
|
@@ -56,11 +60,13 @@ tg-change-password = "trustgraph.cli.change_password:main"
|
|
|
56
60
|
tg-reset-password = "trustgraph.cli.reset_password:main"
|
|
57
61
|
tg-create-api-key = "trustgraph.cli.create_api_key:main"
|
|
58
62
|
tg-list-api-keys = "trustgraph.cli.list_api_keys:main"
|
|
63
|
+
tg-list-graph-versions = "trustgraph.cli.list_graph_versions:main"
|
|
59
64
|
tg-revoke-api-key = "trustgraph.cli.revoke_api_key:main"
|
|
60
65
|
tg-list-workspaces = "trustgraph.cli.list_workspaces:main"
|
|
61
66
|
tg-list-my-workspaces = "trustgraph.cli.list_my_workspaces:main"
|
|
62
67
|
tg-create-workspace = "trustgraph.cli.create_workspace:main"
|
|
63
68
|
tg-list-models = "trustgraph.cli.list_models:main"
|
|
69
|
+
tg-list-named-graphs = "trustgraph.cli.list_named_graphs:main"
|
|
64
70
|
tg-invoke-agent = "trustgraph.cli.invoke_agent:main"
|
|
65
71
|
tg-invoke-planner = "trustgraph.cli.invoke_planner:main"
|
|
66
72
|
tg-invoke-query-formulation = "trustgraph.cli.invoke_query_formulation:main"
|
|
@@ -98,12 +104,14 @@ tg-invoke-row-embeddings = "trustgraph.cli.invoke_row_embeddings:main"
|
|
|
98
104
|
tg-invoke-prompt = "trustgraph.cli.invoke_prompt:main"
|
|
99
105
|
tg-invoke-reranker = "trustgraph.cli.invoke_reranker:main"
|
|
100
106
|
tg-invoke-structured-query = "trustgraph.cli.invoke_structured_query:main"
|
|
107
|
+
tg-label-graph-version = "trustgraph.cli.label_graph_version:main"
|
|
101
108
|
tg-load-doc-embeds = "trustgraph.cli.load_doc_embeds:main"
|
|
102
109
|
tg-load-kg-core = "trustgraph.cli.load_kg_core:main"
|
|
103
110
|
tg-load-sample-documents = "trustgraph.cli.load_sample_documents:main"
|
|
104
111
|
tg-load-turtle = "trustgraph.cli.load_turtle:main"
|
|
105
112
|
tg-load-knowledge = "trustgraph.cli.load_knowledge:main"
|
|
106
113
|
tg-load-structured-data = "trustgraph.cli.load_structured_data:main"
|
|
114
|
+
tg-purge-graph-history = "trustgraph.cli.purge_graph_history:main"
|
|
107
115
|
tg-put-flow-blueprint = "trustgraph.cli.put_flow_blueprint:main"
|
|
108
116
|
tg-put-de-core = "trustgraph.cli.put_de_core:main"
|
|
109
117
|
tg-put-kg-core = "trustgraph.cli.put_kg_core:main"
|
|
@@ -118,6 +126,7 @@ tg-show-flow-blueprints = "trustgraph.cli.show_flow_blueprints:main"
|
|
|
118
126
|
tg-show-flow-state = "trustgraph.cli.show_flow_state:main"
|
|
119
127
|
tg-show-flows = "trustgraph.cli.show_flows:main"
|
|
120
128
|
tg-query-graph = "trustgraph.cli.query_graph:main"
|
|
129
|
+
tg-revert-graph = "trustgraph.cli.revert_graph:main"
|
|
121
130
|
tg-show-graph = "trustgraph.cli.show_graph:main"
|
|
122
131
|
tg-show-kg-cores = "trustgraph.cli.show_kg_cores:main"
|
|
123
132
|
tg-show-library-documents = "trustgraph.cli.show_library_documents:main"
|
|
@@ -149,6 +158,7 @@ tg-delete-collection = "trustgraph.cli.delete_collection:main"
|
|
|
149
158
|
tg-show-extraction-provenance = "trustgraph.cli.show_extraction_provenance:main"
|
|
150
159
|
tg-list-explain-traces = "trustgraph.cli.list_explain_traces:main"
|
|
151
160
|
tg-show-explain-trace = "trustgraph.cli.show_explain_trace:main"
|
|
161
|
+
tg-write-triples = "trustgraph.cli.write_triples:main"
|
|
152
162
|
|
|
153
163
|
[tool.setuptools.package-data]
|
|
154
164
|
"trustgraph.cli.sample_documents" = ["*.md", "*.pdf", "*.json"]
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Create a new version for a named graph.
|
|
3
|
+
|
|
4
|
+
The current version is incremented by one. No data is copied — versioning
|
|
5
|
+
is zero-cost.
|
|
6
|
+
|
|
7
|
+
Examples:
|
|
8
|
+
tg-bump-graph-version -g urn:graph:source
|
|
9
|
+
tg-bump-graph-version -g urn:graph:source -C my-collection
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
import argparse
|
|
13
|
+
import os
|
|
14
|
+
import sys
|
|
15
|
+
from trustgraph.api import Api
|
|
16
|
+
|
|
17
|
+
default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8888/')
|
|
18
|
+
default_collection = 'default'
|
|
19
|
+
default_token = os.getenv("TRUSTGRAPH_TOKEN", None)
|
|
20
|
+
default_workspace = os.getenv("TRUSTGRAPH_WORKSPACE", "default")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def main():
|
|
24
|
+
|
|
25
|
+
parser = argparse.ArgumentParser(
|
|
26
|
+
prog='tg-bump-graph-version',
|
|
27
|
+
description=__doc__,
|
|
28
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
parser.add_argument(
|
|
32
|
+
'-u', '--api-url',
|
|
33
|
+
default=default_url,
|
|
34
|
+
help=f'API URL (default: {default_url})',
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
parser.add_argument(
|
|
38
|
+
'-f', '--flow-id',
|
|
39
|
+
default="default",
|
|
40
|
+
help='Flow ID (default: default)',
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
parser.add_argument(
|
|
44
|
+
'-C', '--collection',
|
|
45
|
+
default=default_collection,
|
|
46
|
+
help=f'Collection (default: {default_collection})',
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
parser.add_argument(
|
|
50
|
+
'-t', '--token',
|
|
51
|
+
default=default_token,
|
|
52
|
+
help='Auth token (default: $TRUSTGRAPH_TOKEN)',
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
parser.add_argument(
|
|
56
|
+
'-w', '--workspace',
|
|
57
|
+
default=default_workspace,
|
|
58
|
+
help=f'Workspace (default: {default_workspace})',
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
parser.add_argument(
|
|
62
|
+
'-g', '--named-graph',
|
|
63
|
+
default='',
|
|
64
|
+
help='Named graph IRI (default: empty = default graph)',
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
args = parser.parse_args()
|
|
68
|
+
|
|
69
|
+
try:
|
|
70
|
+
socket = Api(args.api_url, token=args.token, workspace=args.workspace).socket()
|
|
71
|
+
flow = socket.flow(args.flow_id)
|
|
72
|
+
|
|
73
|
+
try:
|
|
74
|
+
result = flow.triples_query(
|
|
75
|
+
operation="version-bump",
|
|
76
|
+
collection=args.collection,
|
|
77
|
+
**{"named-graph": args.named_graph},
|
|
78
|
+
)
|
|
79
|
+
finally:
|
|
80
|
+
socket.close()
|
|
81
|
+
|
|
82
|
+
if isinstance(result, dict) and "error" in result:
|
|
83
|
+
err = result["error"]
|
|
84
|
+
print(f"Error: {err.get('message', err)}", file=sys.stderr)
|
|
85
|
+
sys.exit(1)
|
|
86
|
+
|
|
87
|
+
new_version = result.get("version", "?") if isinstance(result, dict) else "?"
|
|
88
|
+
print(f"{args.collection}/{args.named_graph} bumped to v{new_version}")
|
|
89
|
+
|
|
90
|
+
except Exception as e:
|
|
91
|
+
print(f"Error: {e}", file=sys.stderr)
|
|
92
|
+
sys.exit(1)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
if __name__ == "__main__":
|
|
96
|
+
main()
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Delete triples from a named graph by pattern or explicit list.
|
|
3
|
+
|
|
4
|
+
Pattern mode (default): specify -s, -p, -o to match triples for deletion.
|
|
5
|
+
Omitted fields act as wildcards.
|
|
6
|
+
|
|
7
|
+
Examples:
|
|
8
|
+
tg-delete-triples -g urn:graph:source -s "http://example.org/entity"
|
|
9
|
+
tg-delete-triples -g urn:graph:source -p "http://www.w3.org/2000/01/rdf-schema#label"
|
|
10
|
+
tg-delete-triples -g urn:graph:source -s "http://example.org/entity" -p "http://example.org/name"
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
import argparse
|
|
14
|
+
import os
|
|
15
|
+
import sys
|
|
16
|
+
from trustgraph.api import Api
|
|
17
|
+
from . query_graph import build_term
|
|
18
|
+
|
|
19
|
+
default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8888/')
|
|
20
|
+
default_collection = 'default'
|
|
21
|
+
default_token = os.getenv("TRUSTGRAPH_TOKEN", None)
|
|
22
|
+
default_workspace = os.getenv("TRUSTGRAPH_WORKSPACE", "default")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def main():
|
|
26
|
+
|
|
27
|
+
parser = argparse.ArgumentParser(
|
|
28
|
+
prog='tg-delete-triples',
|
|
29
|
+
description=__doc__,
|
|
30
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
parser.add_argument(
|
|
34
|
+
'-u', '--api-url',
|
|
35
|
+
default=default_url,
|
|
36
|
+
help=f'API URL (default: {default_url})',
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
parser.add_argument(
|
|
40
|
+
'-f', '--flow-id',
|
|
41
|
+
default="default",
|
|
42
|
+
help='Flow ID (default: default)',
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
parser.add_argument(
|
|
46
|
+
'-C', '--collection',
|
|
47
|
+
default=default_collection,
|
|
48
|
+
help=f'Collection (default: {default_collection})',
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
parser.add_argument(
|
|
52
|
+
'-t', '--token',
|
|
53
|
+
default=default_token,
|
|
54
|
+
help='Auth token (default: $TRUSTGRAPH_TOKEN)',
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
parser.add_argument(
|
|
58
|
+
'-w', '--workspace',
|
|
59
|
+
default=default_workspace,
|
|
60
|
+
help=f'Workspace (default: {default_workspace})',
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
parser.add_argument(
|
|
64
|
+
'-g', '--named-graph',
|
|
65
|
+
default='',
|
|
66
|
+
help='Named graph IRI (default: empty = default graph)',
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
parser.add_argument(
|
|
70
|
+
'-s', '--subject',
|
|
71
|
+
help='Subject filter (auto-detected as IRI or literal)',
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
parser.add_argument(
|
|
75
|
+
'-p', '--predicate',
|
|
76
|
+
help='Predicate filter (auto-detected as IRI)',
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
parser.add_argument(
|
|
80
|
+
'-o', '--object',
|
|
81
|
+
dest='obj',
|
|
82
|
+
help='Object filter (IRI or literal)',
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
args = parser.parse_args()
|
|
86
|
+
|
|
87
|
+
if not args.subject and not args.predicate and not args.obj:
|
|
88
|
+
parser.error("At least one of -s, -p, -o must be specified for pattern deletion")
|
|
89
|
+
|
|
90
|
+
try:
|
|
91
|
+
socket = Api(args.api_url, token=args.token, workspace=args.workspace).socket()
|
|
92
|
+
flow = socket.flow(args.flow_id)
|
|
93
|
+
|
|
94
|
+
request_kwargs = {
|
|
95
|
+
"operation": "delete",
|
|
96
|
+
"collection": args.collection,
|
|
97
|
+
"named-graph": args.named_graph,
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
s_term = build_term(args.subject) if args.subject else None
|
|
101
|
+
p_term = build_term(args.predicate) if args.predicate else None
|
|
102
|
+
o_term = build_term(args.obj) if args.obj else None
|
|
103
|
+
|
|
104
|
+
try:
|
|
105
|
+
result = flow.triples_query(
|
|
106
|
+
s=s_term,
|
|
107
|
+
p=p_term,
|
|
108
|
+
o=o_term,
|
|
109
|
+
**request_kwargs,
|
|
110
|
+
)
|
|
111
|
+
finally:
|
|
112
|
+
socket.close()
|
|
113
|
+
|
|
114
|
+
if isinstance(result, dict) and "error" in result:
|
|
115
|
+
err = result["error"]
|
|
116
|
+
print(f"Error: {err.get('message', err)}", file=sys.stderr)
|
|
117
|
+
sys.exit(1)
|
|
118
|
+
|
|
119
|
+
print("Delete operation completed")
|
|
120
|
+
|
|
121
|
+
except Exception as e:
|
|
122
|
+
print(f"Error: {e}", file=sys.stderr)
|
|
123
|
+
sys.exit(1)
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
if __name__ == "__main__":
|
|
127
|
+
main()
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Show added and removed triples between two graph versions.
|
|
3
|
+
|
|
4
|
+
Examples:
|
|
5
|
+
tg-diff-graph -g urn:graph:source --v1 1 --v2 3
|
|
6
|
+
tg-diff-graph -g urn:graph:source --v1 2 --v2 5 --format json
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import argparse
|
|
10
|
+
import json
|
|
11
|
+
import os
|
|
12
|
+
import sys
|
|
13
|
+
from trustgraph.api import Api
|
|
14
|
+
from . query_graph import format_term
|
|
15
|
+
|
|
16
|
+
default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8888/')
|
|
17
|
+
default_collection = 'default'
|
|
18
|
+
default_token = os.getenv("TRUSTGRAPH_TOKEN", None)
|
|
19
|
+
default_workspace = os.getenv("TRUSTGRAPH_WORKSPACE", "default")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def print_triples(label, triples, output_format):
|
|
23
|
+
if not triples:
|
|
24
|
+
return
|
|
25
|
+
|
|
26
|
+
if output_format == "json":
|
|
27
|
+
print(json.dumps({label: triples}, indent=2))
|
|
28
|
+
return
|
|
29
|
+
|
|
30
|
+
print(f"\n{label} ({len(triples)}):")
|
|
31
|
+
for triple in triples:
|
|
32
|
+
s = format_term(triple.get("s", {}))
|
|
33
|
+
p = format_term(triple.get("p", {}))
|
|
34
|
+
o = format_term(triple.get("o", {}))
|
|
35
|
+
prefix = "+" if label == "Added" else "-"
|
|
36
|
+
print(f" {prefix} {s} {p} {o}")
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def main():
|
|
40
|
+
|
|
41
|
+
parser = argparse.ArgumentParser(
|
|
42
|
+
prog='tg-diff-graph',
|
|
43
|
+
description=__doc__,
|
|
44
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
parser.add_argument(
|
|
48
|
+
'-u', '--api-url',
|
|
49
|
+
default=default_url,
|
|
50
|
+
help=f'API URL (default: {default_url})',
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
parser.add_argument(
|
|
54
|
+
'-f', '--flow-id',
|
|
55
|
+
default="default",
|
|
56
|
+
help='Flow ID (default: default)',
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
parser.add_argument(
|
|
60
|
+
'-C', '--collection',
|
|
61
|
+
default=default_collection,
|
|
62
|
+
help=f'Collection (default: {default_collection})',
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
parser.add_argument(
|
|
66
|
+
'-t', '--token',
|
|
67
|
+
default=default_token,
|
|
68
|
+
help='Auth token (default: $TRUSTGRAPH_TOKEN)',
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
parser.add_argument(
|
|
72
|
+
'-w', '--workspace',
|
|
73
|
+
default=default_workspace,
|
|
74
|
+
help=f'Workspace (default: {default_workspace})',
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
parser.add_argument(
|
|
78
|
+
'-g', '--named-graph',
|
|
79
|
+
default='',
|
|
80
|
+
help='Named graph IRI (default: empty = default graph)',
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
parser.add_argument(
|
|
84
|
+
'--v1',
|
|
85
|
+
type=int,
|
|
86
|
+
required=True,
|
|
87
|
+
help='First version (older)',
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
parser.add_argument(
|
|
91
|
+
'--v2',
|
|
92
|
+
type=int,
|
|
93
|
+
required=True,
|
|
94
|
+
help='Second version (newer)',
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
parser.add_argument(
|
|
98
|
+
'--format',
|
|
99
|
+
choices=['text', 'json'],
|
|
100
|
+
default='text',
|
|
101
|
+
help='Output format (default: text)',
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
args = parser.parse_args()
|
|
105
|
+
|
|
106
|
+
try:
|
|
107
|
+
socket = Api(args.api_url, token=args.token, workspace=args.workspace).socket()
|
|
108
|
+
flow = socket.flow(args.flow_id)
|
|
109
|
+
|
|
110
|
+
try:
|
|
111
|
+
result = flow.triples_query(
|
|
112
|
+
operation="diff",
|
|
113
|
+
collection=args.collection,
|
|
114
|
+
**{
|
|
115
|
+
"named-graph": args.named_graph,
|
|
116
|
+
"v1": args.v1,
|
|
117
|
+
"v2": args.v2,
|
|
118
|
+
},
|
|
119
|
+
)
|
|
120
|
+
finally:
|
|
121
|
+
socket.close()
|
|
122
|
+
|
|
123
|
+
if isinstance(result, dict) and "error" in result:
|
|
124
|
+
err = result["error"]
|
|
125
|
+
print(f"Error: {err.get('message', err)}", file=sys.stderr)
|
|
126
|
+
sys.exit(1)
|
|
127
|
+
|
|
128
|
+
added = result.get("added", []) if isinstance(result, dict) else []
|
|
129
|
+
removed = result.get("removed", []) if isinstance(result, dict) else []
|
|
130
|
+
|
|
131
|
+
if args.format == "json":
|
|
132
|
+
print(json.dumps({"added": added, "removed": removed}, indent=2))
|
|
133
|
+
else:
|
|
134
|
+
if not added and not removed:
|
|
135
|
+
print(f"No changes between v{args.v1} and v{args.v2}")
|
|
136
|
+
else:
|
|
137
|
+
print_triples("Added", added, args.format)
|
|
138
|
+
print_triples("Removed", removed, args.format)
|
|
139
|
+
|
|
140
|
+
except Exception as e:
|
|
141
|
+
print(f"Error: {e}", file=sys.stderr)
|
|
142
|
+
sys.exit(1)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
if __name__ == "__main__":
|
|
146
|
+
main()
|
|
@@ -66,7 +66,7 @@ def term_to_rdflib(term):
|
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
def show_graph(url, flow_id, collection, limit, batch_size,
|
|
69
|
-
token=None, workspace="default"):
|
|
69
|
+
graph='', token=None, workspace="default", version=None):
|
|
70
70
|
|
|
71
71
|
socket = Api(url, token=token, workspace=workspace).socket()
|
|
72
72
|
flow = socket.flow(flow_id)
|
|
@@ -74,12 +74,17 @@ def show_graph(url, flow_id, collection, limit, batch_size,
|
|
|
74
74
|
g = rdflib.Graph()
|
|
75
75
|
|
|
76
76
|
try:
|
|
77
|
-
|
|
77
|
+
kwargs = dict(
|
|
78
78
|
s=None, p=None, o=None,
|
|
79
|
+
g=graph,
|
|
79
80
|
collection=collection,
|
|
80
81
|
limit=limit,
|
|
81
82
|
batch_size=batch_size,
|
|
82
|
-
)
|
|
83
|
+
)
|
|
84
|
+
if version is not None:
|
|
85
|
+
kwargs["version"] = version
|
|
86
|
+
|
|
87
|
+
for batch in flow.triples_query_stream(**kwargs):
|
|
83
88
|
for triple in batch:
|
|
84
89
|
sv = term_to_rdflib(triple.get("s"))
|
|
85
90
|
pv = term_to_rdflib(triple.get("p"))
|
|
@@ -148,8 +153,28 @@ def main():
|
|
|
148
153
|
help='Triples per streaming batch (default: 20)',
|
|
149
154
|
)
|
|
150
155
|
|
|
156
|
+
graph_group = parser.add_mutually_exclusive_group()
|
|
157
|
+
graph_group.add_argument(
|
|
158
|
+
'-g', '--graph',
|
|
159
|
+
default='',
|
|
160
|
+
help='Filter by named graph (default: default graph)',
|
|
161
|
+
)
|
|
162
|
+
graph_group.add_argument(
|
|
163
|
+
'--all-graphs',
|
|
164
|
+
action='store_true',
|
|
165
|
+
help='Export across all named graphs',
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
parser.add_argument(
|
|
169
|
+
'-V', '--version',
|
|
170
|
+
default=None,
|
|
171
|
+
help='Query at a specific graph version number or name (default: current)',
|
|
172
|
+
)
|
|
173
|
+
|
|
151
174
|
args = parser.parse_args()
|
|
152
175
|
|
|
176
|
+
graph = None if args.all_graphs else args.graph
|
|
177
|
+
|
|
153
178
|
try:
|
|
154
179
|
|
|
155
180
|
show_graph(
|
|
@@ -158,8 +183,10 @@ def main():
|
|
|
158
183
|
collection = args.collection,
|
|
159
184
|
limit = args.limit,
|
|
160
185
|
batch_size = args.batch_size,
|
|
186
|
+
graph = graph,
|
|
161
187
|
token = args.token,
|
|
162
188
|
workspace = args.workspace,
|
|
189
|
+
version = args.version,
|
|
163
190
|
)
|
|
164
191
|
|
|
165
192
|
except Exception as e:
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Set a symbolic name on a graph version.
|
|
3
|
+
|
|
4
|
+
Examples:
|
|
5
|
+
tg-label-graph-version -g urn:graph:source -V 3 -n baseline
|
|
6
|
+
tg-label-graph-version -g urn:graph:source -V 5 -n "before-q4-reingestion"
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import argparse
|
|
10
|
+
import os
|
|
11
|
+
import sys
|
|
12
|
+
from trustgraph.api import Api
|
|
13
|
+
|
|
14
|
+
default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8888/')
|
|
15
|
+
default_collection = 'default'
|
|
16
|
+
default_token = os.getenv("TRUSTGRAPH_TOKEN", None)
|
|
17
|
+
default_workspace = os.getenv("TRUSTGRAPH_WORKSPACE", "default")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def main():
|
|
21
|
+
|
|
22
|
+
parser = argparse.ArgumentParser(
|
|
23
|
+
prog='tg-label-graph-version',
|
|
24
|
+
description=__doc__,
|
|
25
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
parser.add_argument(
|
|
29
|
+
'-u', '--api-url',
|
|
30
|
+
default=default_url,
|
|
31
|
+
help=f'API URL (default: {default_url})',
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
parser.add_argument(
|
|
35
|
+
'-f', '--flow-id',
|
|
36
|
+
default="default",
|
|
37
|
+
help='Flow ID (default: default)',
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
parser.add_argument(
|
|
41
|
+
'-C', '--collection',
|
|
42
|
+
default=default_collection,
|
|
43
|
+
help=f'Collection (default: {default_collection})',
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
parser.add_argument(
|
|
47
|
+
'-t', '--token',
|
|
48
|
+
default=default_token,
|
|
49
|
+
help='Auth token (default: $TRUSTGRAPH_TOKEN)',
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
parser.add_argument(
|
|
53
|
+
'-w', '--workspace',
|
|
54
|
+
default=default_workspace,
|
|
55
|
+
help=f'Workspace (default: {default_workspace})',
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
parser.add_argument(
|
|
59
|
+
'-g', '--named-graph',
|
|
60
|
+
default='',
|
|
61
|
+
help='Named graph IRI (default: empty = default graph)',
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
parser.add_argument(
|
|
65
|
+
'-V', '--version',
|
|
66
|
+
required=True,
|
|
67
|
+
help='Version number or name to label',
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
parser.add_argument(
|
|
71
|
+
'-n', '--name',
|
|
72
|
+
required=True,
|
|
73
|
+
help='Symbolic name to assign to the version',
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
args = parser.parse_args()
|
|
77
|
+
|
|
78
|
+
try:
|
|
79
|
+
socket = Api(args.api_url, token=args.token, workspace=args.workspace).socket()
|
|
80
|
+
flow = socket.flow(args.flow_id)
|
|
81
|
+
|
|
82
|
+
try:
|
|
83
|
+
result = flow.triples_query(
|
|
84
|
+
operation="version-label",
|
|
85
|
+
collection=args.collection,
|
|
86
|
+
**{
|
|
87
|
+
"named-graph": args.named_graph,
|
|
88
|
+
"version": args.version,
|
|
89
|
+
"name": args.name,
|
|
90
|
+
},
|
|
91
|
+
)
|
|
92
|
+
finally:
|
|
93
|
+
socket.close()
|
|
94
|
+
|
|
95
|
+
print(
|
|
96
|
+
f"Labelled {args.collection}/{args.named_graph} "
|
|
97
|
+
f"v{args.version} as '{args.name}'"
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
except Exception as e:
|
|
101
|
+
print(f"Error: {e}", file=sys.stderr)
|
|
102
|
+
sys.exit(1)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
if __name__ == "__main__":
|
|
106
|
+
main()
|