trustgraph-flow 2.10.0__tar.gz → 2.10.2__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_flow-2.10.0 → trustgraph_flow-2.10.2}/PKG-INFO +1 -1
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/pyproject.toml +1 -0
- trustgraph_flow-2.10.2/trustgraph/flow_version.py +1 -0
- trustgraph_flow-2.10.2/trustgraph/policy/__init__.py +2 -0
- trustgraph_flow-2.10.2/trustgraph/policy/policy_filter.py +661 -0
- trustgraph_flow-2.10.2/trustgraph/policy/triples/service.py +233 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/retrieval/graph_rag/graph_rag.py +11 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/retrieval/graph_rag/rag.py +2 -0
- trustgraph_flow-2.10.2/trustgraph/tables/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph_flow.egg-info/PKG-INFO +1 -1
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph_flow.egg-info/SOURCES.txt +4 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph_flow.egg-info/entry_points.txt +1 -0
- trustgraph_flow-2.10.0/trustgraph/flow_version.py +0 -1
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/README.md +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/setup.cfg +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/agent/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/agent/mcp_tool/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/agent/mcp_tool/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/agent/mcp_tool/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/agent/orchestrator/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/agent/orchestrator/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/agent/orchestrator/aggregator.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/agent/orchestrator/meta_router.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/agent/orchestrator/pattern_base.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/agent/orchestrator/plan_pattern.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/agent/orchestrator/react_pattern.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/agent/orchestrator/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/agent/orchestrator/supervisor_pattern.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/agent/react/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/agent/react/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/agent/react/agent_manager.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/agent/react/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/agent/react/streaming_parser.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/agent/react/tools.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/agent/react/types.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/agent/tool_filter.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/bootstrap/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/bootstrap/base.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/bootstrap/bootstrapper/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/bootstrap/bootstrapper/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/bootstrap/bootstrapper/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/bootstrap/initialisers/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/bootstrap/initialisers/default_flow_start.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/bootstrap/initialisers/pulsar_topology.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/bootstrap/initialisers/template_seed.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/bootstrap/initialisers/workspace_init.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/chunking/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/chunking/recursive/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/chunking/recursive/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/chunking/recursive/chunker.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/chunking/token/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/chunking/token/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/chunking/token/chunker.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/config/service/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/config/service/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/config/service/config.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/config/service/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/cores/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/cores/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/cores/knowledge.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/cores/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/decoding/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/decoding/mistral_ocr/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/decoding/mistral_ocr/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/decoding/mistral_ocr/processor.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/decoding/pdf/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/decoding/pdf/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/decoding/pdf/pdf_decoder.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/direct/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/direct/cassandra_kg.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/direct/milvus_doc_embeddings.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/direct/milvus_graph_embeddings.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/embeddings/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/embeddings/document_embeddings/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/embeddings/document_embeddings/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/embeddings/document_embeddings/embeddings.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/embeddings/fastembed/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/embeddings/fastembed/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/embeddings/fastembed/processor.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/embeddings/graph_embeddings/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/embeddings/graph_embeddings/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/embeddings/graph_embeddings/embeddings.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/embeddings/ollama/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/embeddings/ollama/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/embeddings/ollama/processor.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/embeddings/row_embeddings/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/embeddings/row_embeddings/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/embeddings/row_embeddings/embeddings.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/external/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/external/wikipedia/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/external/wikipedia/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/external/wikipedia/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/agent/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/agent/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/agent/extract.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/definitions/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/definitions/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/definitions/extract.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/extract_metrics.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/ontology/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/ontology/entity_normalizer.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/ontology/extract.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/ontology/ontology_embedder.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/ontology/ontology_loader.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/ontology/ontology_selector.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/ontology/run.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/ontology/simplified_parser.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/ontology/text_processor.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/ontology/triple_converter.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/ontology/vector_store.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/relationships/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/relationships/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/relationships/extract.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/rows/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/rows/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/rows/processor.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/topics/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/topics/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/extract/kg/topics/extract.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/flow/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/flow/service/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/flow/service/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/flow/service/flow.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/flow/service/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/audit.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/auth.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/capabilities.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/config/receiver.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/agent.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/collection_management.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/config.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/core_export.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/core_import.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/document_embeddings_export.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/document_embeddings_import.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/document_embeddings_query.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/document_load.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/document_rag.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/document_stream.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/embeddings.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/entity_contexts_export.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/entity_contexts_import.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/flow.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/graph_embeddings_export.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/graph_embeddings_import.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/graph_embeddings_query.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/graph_rag.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/iam.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/image_to_text.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/knowledge.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/librarian.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/manager.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/mcp_tool.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/mux.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/nlp_query.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/passthrough.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/prompt.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/requestor.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/reranker.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/row_embeddings_query.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/rows_import.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/rows_query.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/sender.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/serialize.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/sparql_query.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/structured_diag.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/structured_query.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/text_completion.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/text_load.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/triples_export.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/triples_import.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/dispatch/triples_query.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/endpoint/auth_endpoints.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/endpoint/constant_endpoint.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/endpoint/i18n.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/endpoint/iam_endpoint.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/endpoint/manager.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/endpoint/metrics.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/endpoint/registry_endpoint.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/endpoint/socket.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/endpoint/stream_endpoint.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/endpoint/variable_endpoint.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/registry.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/running.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/unused/dbpedia.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/unused/encyclopedia.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/gateway/unused/internet_search.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/iam/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/iam/noauth/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/iam/noauth/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/iam/noauth/handler.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/iam/noauth/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/iam/service/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/iam/service/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/iam/service/iam.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/iam/service/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/librarian/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/librarian/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/librarian/blob_store.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/librarian/collection_manager.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/librarian/librarian.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/librarian/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/metering/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/metering/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/metering/counter.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/image_to_text/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/image_to_text/openai/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/image_to_text/openai/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/image_to_text/openai/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/azure/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/azure/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/azure/llm.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/azure_openai/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/azure_openai/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/azure_openai/llm.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/claude/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/claude/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/claude/llm.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/cohere/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/cohere/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/cohere/llm.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/llamafile/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/llamafile/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/llamafile/llm.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/lmstudio/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/lmstudio/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/lmstudio/llm.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/mistral/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/mistral/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/mistral/llm.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/ollama/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/ollama/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/ollama/llm.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/openai/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/openai/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/openai/llm.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/openai/variants.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/tgi/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/tgi/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/tgi/llm.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/vllm/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/vllm/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/model/text_completion/vllm/llm.py +0 -0
- {trustgraph_flow-2.10.0/trustgraph/prompt → trustgraph_flow-2.10.2/trustgraph/policy/triples}/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/processing/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/processing/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/processing/processing.py +0 -0
- {trustgraph_flow-2.10.0/trustgraph/query → trustgraph_flow-2.10.2/trustgraph/prompt}/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/prompt/template/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/prompt/template/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/prompt/template/service.py +0 -0
- {trustgraph_flow-2.10.0/trustgraph/query/doc_embeddings → trustgraph_flow-2.10.2/trustgraph/query}/__init__.py +0 -0
- {trustgraph_flow-2.10.0/trustgraph/query/graph_embeddings → trustgraph_flow-2.10.2/trustgraph/query/doc_embeddings}/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/doc_embeddings/milvus/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/doc_embeddings/milvus/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/doc_embeddings/milvus/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/doc_embeddings/pinecone/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/doc_embeddings/pinecone/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/doc_embeddings/pinecone/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/doc_embeddings/qdrant/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/doc_embeddings/qdrant/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/doc_embeddings/qdrant/service.py +0 -0
- {trustgraph_flow-2.10.0/trustgraph/query/rows → trustgraph_flow-2.10.2/trustgraph/query/graph_embeddings}/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/graph_embeddings/milvus/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/graph_embeddings/milvus/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/graph_embeddings/milvus/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/graph_embeddings/pinecone/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/graph_embeddings/pinecone/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/graph_embeddings/pinecone/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/graph_embeddings/qdrant/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/graph_embeddings/qdrant/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/graph_embeddings/qdrant/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/graphql/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/graphql/filters.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/graphql/schema.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/graphql/types.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/ontology/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/ontology/answer_generator.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/ontology/backend_router.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/ontology/cache.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/ontology/cypher_executor.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/ontology/cypher_generator.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/ontology/error_handling.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/ontology/monitoring.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/ontology/multi_language.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/ontology/ontology_matcher.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/ontology/query_explanation.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/ontology/query_optimizer.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/ontology/query_service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/ontology/question_analyzer.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/ontology/sparql_cassandra.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/ontology/sparql_generator.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/row_embeddings/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/row_embeddings/qdrant/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/row_embeddings/qdrant/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/row_embeddings/qdrant/service.py +0 -0
- {trustgraph_flow-2.10.0/trustgraph/query/triples → trustgraph_flow-2.10.2/trustgraph/query/rows}/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/rows/cassandra/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/rows/cassandra/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/rows/cassandra/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/sparql/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/sparql/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/sparql/algebra.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/sparql/expressions.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/sparql/parser.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/sparql/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/sparql/solutions.py +0 -0
- {trustgraph_flow-2.10.0/trustgraph/retrieval → trustgraph_flow-2.10.2/trustgraph/query/triples}/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/triples/cassandra/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/triples/cassandra/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/triples/cassandra/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/triples/falkordb/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/triples/falkordb/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/triples/falkordb/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/triples/memgraph/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/triples/memgraph/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/triples/memgraph/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/triples/neo4j/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/triples/neo4j/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/query/triples/neo4j/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/reranker/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/reranker/flashrank/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/reranker/flashrank/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/reranker/flashrank/processor.py +0 -0
- {trustgraph_flow-2.10.0/trustgraph/storage → trustgraph_flow-2.10.2/trustgraph/retrieval}/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/retrieval/document_rag/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/retrieval/document_rag/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/retrieval/document_rag/document_rag.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/retrieval/document_rag/rag.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/retrieval/document_rag/rerank.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/retrieval/graph_rag/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/retrieval/graph_rag/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/retrieval/nlp_query/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/retrieval/nlp_query/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/retrieval/nlp_query/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/retrieval/structured_diag/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/retrieval/structured_diag/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/retrieval/structured_diag/type_detector.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/retrieval/structured_query/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/retrieval/structured_query/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/retrieval/structured_query/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/rev_gateway/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/rev_gateway/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/rev_gateway/dispatcher.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/rev_gateway/service.py +0 -0
- {trustgraph_flow-2.10.0/trustgraph/storage/doc_embeddings → trustgraph_flow-2.10.2/trustgraph/storage}/__init__.py +0 -0
- {trustgraph_flow-2.10.0/trustgraph/storage/graph_embeddings → trustgraph_flow-2.10.2/trustgraph/storage/doc_embeddings}/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/doc_embeddings/milvus/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/doc_embeddings/milvus/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/doc_embeddings/milvus/write.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/doc_embeddings/pinecone/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/doc_embeddings/pinecone/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/doc_embeddings/pinecone/write.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/doc_embeddings/qdrant/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/doc_embeddings/qdrant/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/doc_embeddings/qdrant/write.py +0 -0
- {trustgraph_flow-2.10.0/trustgraph/storage/kw_index → trustgraph_flow-2.10.2/trustgraph/storage/graph_embeddings}/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/graph_embeddings/milvus/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/graph_embeddings/milvus/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/graph_embeddings/milvus/write.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/graph_embeddings/pinecone/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/graph_embeddings/pinecone/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/graph_embeddings/pinecone/write.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/graph_embeddings/qdrant/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/graph_embeddings/qdrant/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/graph_embeddings/qdrant/write.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/knowledge/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/knowledge/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/knowledge/store.py +0 -0
- {trustgraph_flow-2.10.0/trustgraph/storage/rows → trustgraph_flow-2.10.2/trustgraph/storage/kw_index}/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/kw_index/fts5/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/kw_index/fts5/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/kw_index/fts5/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/row_embeddings/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/row_embeddings/qdrant/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/row_embeddings/qdrant/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/row_embeddings/qdrant/write.py +0 -0
- {trustgraph_flow-2.10.0/trustgraph/storage/triples → trustgraph_flow-2.10.2/trustgraph/storage/rows}/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/rows/cassandra/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/rows/cassandra/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/rows/cassandra/write.py +0 -0
- {trustgraph_flow-2.10.0/trustgraph/tables → trustgraph_flow-2.10.2/trustgraph/storage/triples}/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/triples/cassandra/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/triples/cassandra/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/triples/cassandra/write.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/triples/falkordb/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/triples/falkordb/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/triples/falkordb/write.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/triples/memgraph/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/triples/memgraph/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/triples/memgraph/write.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/triples/neo4j/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/triples/neo4j/__main__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/storage/triples/neo4j/write.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/tables/cassandra_async.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/tables/config.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/tables/iam.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/tables/knowledge.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/tables/library.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/template/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/template/prompt_manager.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/tool_service/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/tool_service/joke/__init__.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph/tool_service/joke/service.py +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph_flow.egg-info/dependency_links.txt +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph_flow.egg-info/requires.txt +0 -0
- {trustgraph_flow-2.10.0 → trustgraph_flow-2.10.2}/trustgraph_flow.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: trustgraph-flow
|
|
3
|
-
Version: 2.10.
|
|
3
|
+
Version: 2.10.2
|
|
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
|
|
@@ -118,6 +118,7 @@ text-completion-ollama = "trustgraph.model.text_completion.ollama:run"
|
|
|
118
118
|
text-completion-openai = "trustgraph.model.text_completion.openai:run"
|
|
119
119
|
text-completion-tgi = "trustgraph.model.text_completion.tgi:run"
|
|
120
120
|
text-completion-vllm = "trustgraph.model.text_completion.vllm:run"
|
|
121
|
+
triples-query-policy = "trustgraph.policy.triples.service:run"
|
|
121
122
|
triples-query-cassandra = "trustgraph.query.triples.cassandra:run"
|
|
122
123
|
triples-query-falkordb = "trustgraph.query.triples.falkordb:run"
|
|
123
124
|
triples-query-memgraph = "trustgraph.query.triples.memgraph:run"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.10.2"
|
|
@@ -0,0 +1,661 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Policy filter for post-query filtering of graph results.
|
|
3
|
+
|
|
4
|
+
Takes a set of triples and a UserContext, evaluates SHACL-AF policy
|
|
5
|
+
rules, and returns only the triples the user is permitted to see.
|
|
6
|
+
|
|
7
|
+
The filter is transport-agnostic: it receives a query_fn callback
|
|
8
|
+
for fetching data from the graph. This allows it to be used
|
|
9
|
+
inside the triples query service (direct store access) or inside
|
|
10
|
+
GraphRAG (via triples client).
|
|
11
|
+
|
|
12
|
+
query_fn signature:
|
|
13
|
+
async query_fn(s, p, o, collection, g) -> list[Triple]
|
|
14
|
+
where s, p, o are Term | None
|
|
15
|
+
|
|
16
|
+
Policy evaluation flow:
|
|
17
|
+
1. Load SHACL-AF NodeShape policies from urn:graph:policy
|
|
18
|
+
2. Parse each policy's sh:SPARQLTarget and sh:SPARQLRule
|
|
19
|
+
3. For each candidate node in the retrieved triples:
|
|
20
|
+
a. Hydrate: fetch the required predicates from the graph
|
|
21
|
+
b. Build a tiny evaluation graph (node props + user context)
|
|
22
|
+
c. Run each policy's SPARQL SELECT target in precedence order
|
|
23
|
+
d. If the target matches, run the CONSTRUCT rule
|
|
24
|
+
e. Parse sh:ValidationResult from CONSTRUCT output:
|
|
25
|
+
sh:resultSeverity (determination IRI),
|
|
26
|
+
sh:resultMessage (reason), tg-pol:blocks (default true)
|
|
27
|
+
f. First matching policy wins — its determination applies
|
|
28
|
+
4. Apply determinations: nodes with blocks=true are removed
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
import re
|
|
32
|
+
import time
|
|
33
|
+
import logging
|
|
34
|
+
from typing import Callable, Awaitable
|
|
35
|
+
from collections import OrderedDict
|
|
36
|
+
|
|
37
|
+
from rdflib import Graph, URIRef, Literal, BNode, Namespace
|
|
38
|
+
from rdflib.namespace import RDF, RDFS, XSD
|
|
39
|
+
from rdflib.plugins.sparql import prepareQuery
|
|
40
|
+
|
|
41
|
+
from .. schema import Triple, Term, IRI, LITERAL, UserContext
|
|
42
|
+
|
|
43
|
+
logger = logging.getLogger(__name__)
|
|
44
|
+
|
|
45
|
+
# Well-known namespaces used in policy SPARQL
|
|
46
|
+
SH = Namespace("http://www.w3.org/ns/shacl#")
|
|
47
|
+
TG_POL = Namespace("https://trustgraph.ai/ontology/policy/")
|
|
48
|
+
TG_UC = Namespace("https://trustgraph.ai/ontology/user-context/")
|
|
49
|
+
|
|
50
|
+
POLICY_GRAPH = "urn:graph:policy"
|
|
51
|
+
|
|
52
|
+
QUERY_CACHE_TTL = 30
|
|
53
|
+
QUERY_CACHE_MAX = 256
|
|
54
|
+
SPARQL_CACHE_MAX = 64
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class QueryCache:
|
|
58
|
+
"""LRU + TTL cache for triple query results."""
|
|
59
|
+
|
|
60
|
+
def __init__(self, query_fn, ttl=QUERY_CACHE_TTL,
|
|
61
|
+
max_size=QUERY_CACHE_MAX):
|
|
62
|
+
self._query_fn = query_fn
|
|
63
|
+
self._ttl = ttl
|
|
64
|
+
self._max_size = max_size
|
|
65
|
+
self._cache = OrderedDict()
|
|
66
|
+
|
|
67
|
+
def _make_key(self, s, p, o, collection, g):
|
|
68
|
+
s_key = (s.type, s.iri, s.value) if s else None
|
|
69
|
+
p_key = (p.type, p.iri, p.value) if p else None
|
|
70
|
+
o_key = (o.type, o.iri, o.value) if o else None
|
|
71
|
+
return (s_key, p_key, o_key, collection, g)
|
|
72
|
+
|
|
73
|
+
async def query(self, s, p, o, collection, g=""):
|
|
74
|
+
key = self._make_key(s, p, o, collection, g)
|
|
75
|
+
now = time.monotonic()
|
|
76
|
+
|
|
77
|
+
if key in self._cache:
|
|
78
|
+
result, ts = self._cache[key]
|
|
79
|
+
if now - ts < self._ttl:
|
|
80
|
+
self._cache.move_to_end(key)
|
|
81
|
+
return result
|
|
82
|
+
del self._cache[key]
|
|
83
|
+
|
|
84
|
+
result = await self._query_fn(s, p, o, collection, g)
|
|
85
|
+
|
|
86
|
+
self._cache[key] = (result, now)
|
|
87
|
+
if len(self._cache) > self._max_size:
|
|
88
|
+
self._cache.popitem(last=False)
|
|
89
|
+
|
|
90
|
+
return result
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
class SparqlCache:
|
|
94
|
+
"""Cache for compiled SPARQL queries."""
|
|
95
|
+
|
|
96
|
+
def __init__(self, max_size=SPARQL_CACHE_MAX):
|
|
97
|
+
self._max_size = max_size
|
|
98
|
+
self._cache = OrderedDict()
|
|
99
|
+
|
|
100
|
+
def prepare(self, query_string, initNs=None):
|
|
101
|
+
key = query_string
|
|
102
|
+
if key in self._cache:
|
|
103
|
+
self._cache.move_to_end(key)
|
|
104
|
+
return self._cache[key]
|
|
105
|
+
|
|
106
|
+
compiled = prepareQuery(query_string, initNs=initNs or {})
|
|
107
|
+
self._cache[key] = compiled
|
|
108
|
+
if len(self._cache) > self._max_size:
|
|
109
|
+
self._cache.popitem(last=False)
|
|
110
|
+
|
|
111
|
+
return compiled
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
class PolicyEvaluation:
|
|
115
|
+
"""Result of evaluating a node against a policy."""
|
|
116
|
+
def __init__(self, node_iri, policy_uri, policy_label,
|
|
117
|
+
determination, blocks=True, reason=""):
|
|
118
|
+
self.node_iri = node_iri
|
|
119
|
+
self.policy_uri = policy_uri
|
|
120
|
+
self.policy_label = policy_label
|
|
121
|
+
self.determination = determination
|
|
122
|
+
self.blocks = blocks
|
|
123
|
+
self.reason = reason
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
class LoadedPolicy:
|
|
127
|
+
"""A policy loaded from the policy graph."""
|
|
128
|
+
def __init__(self, uri, label, order, sparql_select,
|
|
129
|
+
target_prefixes, sparql_construct, construct_prefixes):
|
|
130
|
+
self.uri = uri
|
|
131
|
+
self.label = label
|
|
132
|
+
self.order = order
|
|
133
|
+
self.sparql_select = sparql_select
|
|
134
|
+
self.target_prefixes = target_prefixes
|
|
135
|
+
self.sparql_construct = sparql_construct
|
|
136
|
+
self.construct_prefixes = construct_prefixes
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
class PolicyFilter:
|
|
140
|
+
|
|
141
|
+
def __init__(
|
|
142
|
+
self,
|
|
143
|
+
query_fn: Callable[..., Awaitable[list[Triple]]],
|
|
144
|
+
on_evaluation: Callable[..., Awaitable[None]] | None = None,
|
|
145
|
+
):
|
|
146
|
+
"""
|
|
147
|
+
Args:
|
|
148
|
+
query_fn: async fn(s, p, o, collection, g) -> list[Triple]
|
|
149
|
+
on_evaluation: async fn(PolicyEvaluation) -> None
|
|
150
|
+
Called for every determination. No-op if None.
|
|
151
|
+
"""
|
|
152
|
+
self._query_cache = QueryCache(query_fn)
|
|
153
|
+
self.query_fn = self._query_cache.query
|
|
154
|
+
self.on_evaluation = on_evaluation
|
|
155
|
+
self._policies = None
|
|
156
|
+
self._required_predicates = None
|
|
157
|
+
self._sparql_cache = SparqlCache()
|
|
158
|
+
|
|
159
|
+
async def load_policies(self, collection: str) -> None:
|
|
160
|
+
"""Load policies from the policy graph if not already loaded."""
|
|
161
|
+
if self._policies is None:
|
|
162
|
+
self._policies = await self._load_policies(collection)
|
|
163
|
+
if self._policies:
|
|
164
|
+
self._required_predicates = self._discover_predicates(
|
|
165
|
+
self._policies
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
def has_policies(self) -> bool:
|
|
169
|
+
"""True if policies have been loaded and at least one exists."""
|
|
170
|
+
return bool(self._policies)
|
|
171
|
+
|
|
172
|
+
async def apply(
|
|
173
|
+
self,
|
|
174
|
+
triples: list[Triple],
|
|
175
|
+
collection: str,
|
|
176
|
+
user_context: UserContext,
|
|
177
|
+
) -> list[Triple]:
|
|
178
|
+
"""
|
|
179
|
+
Apply policy filtering to a set of triples.
|
|
180
|
+
|
|
181
|
+
Returns the filtered list of triples the user is permitted
|
|
182
|
+
to see.
|
|
183
|
+
"""
|
|
184
|
+
|
|
185
|
+
await self.load_policies(collection)
|
|
186
|
+
|
|
187
|
+
if not self._policies:
|
|
188
|
+
return triples
|
|
189
|
+
|
|
190
|
+
context_graph = self._build_context_graph(user_context)
|
|
191
|
+
|
|
192
|
+
candidate_iris = set()
|
|
193
|
+
for t in triples:
|
|
194
|
+
if t.s and t.s.type == IRI:
|
|
195
|
+
candidate_iris.add(t.s.iri)
|
|
196
|
+
if t.o and t.o.type == IRI:
|
|
197
|
+
candidate_iris.add(t.o.iri)
|
|
198
|
+
|
|
199
|
+
blocked_iris = set()
|
|
200
|
+
for node_iri in candidate_iris:
|
|
201
|
+
evaluation = await self._evaluate_node(
|
|
202
|
+
node_iri, collection, context_graph,
|
|
203
|
+
)
|
|
204
|
+
if evaluation:
|
|
205
|
+
if self.on_evaluation:
|
|
206
|
+
await self.on_evaluation(evaluation)
|
|
207
|
+
if evaluation.blocks:
|
|
208
|
+
blocked_iris.add(node_iri)
|
|
209
|
+
|
|
210
|
+
if not blocked_iris:
|
|
211
|
+
return triples
|
|
212
|
+
|
|
213
|
+
return [
|
|
214
|
+
t for t in triples
|
|
215
|
+
if not self._triple_blocked(t, blocked_iris)
|
|
216
|
+
]
|
|
217
|
+
|
|
218
|
+
def _triple_blocked(self, triple, blocked_iris):
|
|
219
|
+
if triple.s and triple.s.type == IRI:
|
|
220
|
+
if triple.s.iri in blocked_iris:
|
|
221
|
+
return True
|
|
222
|
+
return False
|
|
223
|
+
|
|
224
|
+
# -----------------------------------------------------------------
|
|
225
|
+
# Policy loading
|
|
226
|
+
# -----------------------------------------------------------------
|
|
227
|
+
|
|
228
|
+
async def _load_policies(self, collection):
|
|
229
|
+
"""Load SHACL-AF NodeShape policies from urn:graph:policy."""
|
|
230
|
+
|
|
231
|
+
sh_type = Term(type=IRI, iri=str(RDF.type))
|
|
232
|
+
sh_node_shape = Term(type=IRI, iri=str(SH.NodeShape))
|
|
233
|
+
|
|
234
|
+
shapes = await self.query_fn(
|
|
235
|
+
None, sh_type, sh_node_shape, collection, POLICY_GRAPH,
|
|
236
|
+
)
|
|
237
|
+
|
|
238
|
+
policies = []
|
|
239
|
+
for shape_triple in shapes:
|
|
240
|
+
policy = await self._load_one_policy(
|
|
241
|
+
shape_triple.s, collection,
|
|
242
|
+
)
|
|
243
|
+
if policy:
|
|
244
|
+
policies.append(policy)
|
|
245
|
+
|
|
246
|
+
policies.sort(key=lambda p: p.order)
|
|
247
|
+
|
|
248
|
+
return policies
|
|
249
|
+
|
|
250
|
+
async def _load_one_policy(self, shape_term, collection):
|
|
251
|
+
"""Load a single policy shape from the policy graph."""
|
|
252
|
+
|
|
253
|
+
shape_iri = shape_term.iri if shape_term.type == IRI else None
|
|
254
|
+
if not shape_iri:
|
|
255
|
+
return None
|
|
256
|
+
|
|
257
|
+
s = Term(type=IRI, iri=shape_iri)
|
|
258
|
+
|
|
259
|
+
# Label
|
|
260
|
+
label_results = await self.query_fn(
|
|
261
|
+
s, Term(type=IRI, iri=str(RDFS.label)), None,
|
|
262
|
+
collection, POLICY_GRAPH,
|
|
263
|
+
)
|
|
264
|
+
label = (
|
|
265
|
+
label_results[0].o.value if label_results else shape_iri
|
|
266
|
+
)
|
|
267
|
+
|
|
268
|
+
# Order
|
|
269
|
+
order_results = await self.query_fn(
|
|
270
|
+
s, Term(type=IRI, iri=str(SH.order)), None,
|
|
271
|
+
collection, POLICY_GRAPH,
|
|
272
|
+
)
|
|
273
|
+
order = 99
|
|
274
|
+
if order_results:
|
|
275
|
+
try:
|
|
276
|
+
order = int(order_results[0].o.value)
|
|
277
|
+
except (ValueError, AttributeError):
|
|
278
|
+
pass
|
|
279
|
+
|
|
280
|
+
# Target -> SPARQL SELECT
|
|
281
|
+
target_results = await self.query_fn(
|
|
282
|
+
s, Term(type=IRI, iri=str(SH.target)), None,
|
|
283
|
+
collection, POLICY_GRAPH,
|
|
284
|
+
)
|
|
285
|
+
|
|
286
|
+
sparql_select = None
|
|
287
|
+
target_prefixes = {}
|
|
288
|
+
for target_triple in target_results:
|
|
289
|
+
target_term = target_triple.o
|
|
290
|
+
|
|
291
|
+
target_prefixes = await self._resolve_prefixes(
|
|
292
|
+
target_term, collection,
|
|
293
|
+
)
|
|
294
|
+
|
|
295
|
+
select_results = await self.query_fn(
|
|
296
|
+
target_term, Term(type=IRI, iri=str(SH.select)), None,
|
|
297
|
+
collection, POLICY_GRAPH,
|
|
298
|
+
)
|
|
299
|
+
if select_results:
|
|
300
|
+
sparql_select = select_results[0].o.value
|
|
301
|
+
break
|
|
302
|
+
|
|
303
|
+
if not sparql_select:
|
|
304
|
+
logger.warning(
|
|
305
|
+
f"Policy {label} has no sh:SPARQLTarget, skipping"
|
|
306
|
+
)
|
|
307
|
+
return None
|
|
308
|
+
|
|
309
|
+
# Rule -> SPARQL CONSTRUCT
|
|
310
|
+
rule_results = await self.query_fn(
|
|
311
|
+
s, Term(type=IRI, iri=str(SH.rule)), None,
|
|
312
|
+
collection, POLICY_GRAPH,
|
|
313
|
+
)
|
|
314
|
+
|
|
315
|
+
sparql_construct = None
|
|
316
|
+
construct_prefixes = {}
|
|
317
|
+
for rule_triple in rule_results:
|
|
318
|
+
rule_term = rule_triple.o
|
|
319
|
+
|
|
320
|
+
construct_prefixes = await self._resolve_prefixes(
|
|
321
|
+
rule_term, collection,
|
|
322
|
+
)
|
|
323
|
+
|
|
324
|
+
construct_results = await self.query_fn(
|
|
325
|
+
rule_term, Term(type=IRI, iri=str(SH.construct)), None,
|
|
326
|
+
collection, POLICY_GRAPH,
|
|
327
|
+
)
|
|
328
|
+
if construct_results:
|
|
329
|
+
sparql_construct = construct_results[0].o.value
|
|
330
|
+
break
|
|
331
|
+
|
|
332
|
+
if not sparql_construct:
|
|
333
|
+
logger.warning(
|
|
334
|
+
f"Policy {label} has no sh:SPARQLRule, skipping"
|
|
335
|
+
)
|
|
336
|
+
return None
|
|
337
|
+
|
|
338
|
+
return LoadedPolicy(
|
|
339
|
+
uri=shape_iri, label=label, order=order,
|
|
340
|
+
sparql_select=sparql_select,
|
|
341
|
+
target_prefixes=target_prefixes,
|
|
342
|
+
sparql_construct=sparql_construct,
|
|
343
|
+
construct_prefixes=construct_prefixes,
|
|
344
|
+
)
|
|
345
|
+
|
|
346
|
+
# -----------------------------------------------------------------
|
|
347
|
+
# sh:prefixes / sh:declare resolution
|
|
348
|
+
# -----------------------------------------------------------------
|
|
349
|
+
|
|
350
|
+
async def _resolve_prefixes(self, sparql_component_term, collection):
|
|
351
|
+
"""Resolve sh:prefixes -> sh:declare chains from the policy graph.
|
|
352
|
+
|
|
353
|
+
Follows the SHACL-AF standard:
|
|
354
|
+
?component sh:prefixes ?prefixResource .
|
|
355
|
+
?prefixResource sh:declare ?decl .
|
|
356
|
+
?decl sh:prefix "bpo" .
|
|
357
|
+
?decl sh:namespace "http://..."^^xsd:anyURI .
|
|
358
|
+
|
|
359
|
+
Returns a dict of {prefix: namespace_iri}.
|
|
360
|
+
"""
|
|
361
|
+
prefixes = {}
|
|
362
|
+
|
|
363
|
+
prefix_refs = await self.query_fn(
|
|
364
|
+
sparql_component_term,
|
|
365
|
+
Term(type=IRI, iri=str(SH.prefixes)),
|
|
366
|
+
None, collection, POLICY_GRAPH,
|
|
367
|
+
)
|
|
368
|
+
|
|
369
|
+
for prefix_ref_triple in prefix_refs:
|
|
370
|
+
prefix_resource = prefix_ref_triple.o
|
|
371
|
+
|
|
372
|
+
declarations = await self.query_fn(
|
|
373
|
+
prefix_resource,
|
|
374
|
+
Term(type=IRI, iri=str(SH.declare)),
|
|
375
|
+
None, collection, POLICY_GRAPH,
|
|
376
|
+
)
|
|
377
|
+
|
|
378
|
+
for decl_triple in declarations:
|
|
379
|
+
decl_node = decl_triple.o
|
|
380
|
+
|
|
381
|
+
prefix_results = await self.query_fn(
|
|
382
|
+
decl_node,
|
|
383
|
+
Term(type=IRI, iri=str(SH.prefix)),
|
|
384
|
+
None, collection, POLICY_GRAPH,
|
|
385
|
+
)
|
|
386
|
+
ns_results = await self.query_fn(
|
|
387
|
+
decl_node,
|
|
388
|
+
Term(type=IRI, iri=str(SH.namespace)),
|
|
389
|
+
None, collection, POLICY_GRAPH,
|
|
390
|
+
)
|
|
391
|
+
|
|
392
|
+
if prefix_results and ns_results:
|
|
393
|
+
p_name = prefix_results[0].o.value
|
|
394
|
+
ns_term = ns_results[0].o
|
|
395
|
+
ns_iri = self._extract_term_value(ns_term)
|
|
396
|
+
if p_name and ns_iri:
|
|
397
|
+
prefixes[p_name] = ns_iri
|
|
398
|
+
|
|
399
|
+
return prefixes
|
|
400
|
+
|
|
401
|
+
def _extract_term_value(self, term):
|
|
402
|
+
"""Extract the string value from a Term, checking both value and iri.
|
|
403
|
+
|
|
404
|
+
sh:namespace values are typed xsd:anyURI which may be stored
|
|
405
|
+
as either a literal (value) or an IRI depending on the backend.
|
|
406
|
+
"""
|
|
407
|
+
if term is None:
|
|
408
|
+
return None
|
|
409
|
+
if term.value:
|
|
410
|
+
return term.value
|
|
411
|
+
if term.iri:
|
|
412
|
+
return term.iri
|
|
413
|
+
return None
|
|
414
|
+
|
|
415
|
+
def _build_prefix_header(self, prefixes):
|
|
416
|
+
"""Build a SPARQL PREFIX header string from a prefix dict."""
|
|
417
|
+
lines = []
|
|
418
|
+
for prefix, ns in sorted(prefixes.items()):
|
|
419
|
+
lines.append(f"PREFIX {prefix}: <{ns}>")
|
|
420
|
+
return "\n".join(lines)
|
|
421
|
+
|
|
422
|
+
# -----------------------------------------------------------------
|
|
423
|
+
# Predicate discovery
|
|
424
|
+
# -----------------------------------------------------------------
|
|
425
|
+
|
|
426
|
+
def _discover_predicates(self, policies):
|
|
427
|
+
"""Discover the union of predicates all policies need from ?this."""
|
|
428
|
+
all_preds = set()
|
|
429
|
+
for p in policies:
|
|
430
|
+
all_preds |= self._extract_node_predicates(p)
|
|
431
|
+
return all_preds
|
|
432
|
+
|
|
433
|
+
def _extract_node_predicates(self, policy):
|
|
434
|
+
"""Parse SPARQL to find predicates used on ?this."""
|
|
435
|
+
predicates = set()
|
|
436
|
+
sparql_select = policy.sparql_select
|
|
437
|
+
|
|
438
|
+
for m in re.finditer(r'\?this\s+<([^>]+)>', sparql_select):
|
|
439
|
+
predicates.add(m.group(1))
|
|
440
|
+
|
|
441
|
+
for m in re.finditer(r'\?this\s+([\w-]+:\w+)', sparql_select):
|
|
442
|
+
prefixed = m.group(1)
|
|
443
|
+
colon = prefixed.index(":")
|
|
444
|
+
prefix = prefixed[:colon]
|
|
445
|
+
local = prefixed[colon + 1:]
|
|
446
|
+
if prefix in policy.target_prefixes:
|
|
447
|
+
predicates.add(policy.target_prefixes[prefix] + local)
|
|
448
|
+
|
|
449
|
+
if re.search(r'\?this\s+a\s+', sparql_select):
|
|
450
|
+
predicates.add(str(RDF.type))
|
|
451
|
+
|
|
452
|
+
return predicates
|
|
453
|
+
|
|
454
|
+
# -----------------------------------------------------------------
|
|
455
|
+
# Node hydration
|
|
456
|
+
# -----------------------------------------------------------------
|
|
457
|
+
|
|
458
|
+
async def _hydrate_node(self, node_iri, collection):
|
|
459
|
+
"""Fetch policy-required properties for a node."""
|
|
460
|
+
hydrated = []
|
|
461
|
+
s = Term(type=IRI, iri=node_iri)
|
|
462
|
+
for pred_iri in self._required_predicates:
|
|
463
|
+
p = Term(type=IRI, iri=pred_iri)
|
|
464
|
+
results = await self.query_fn(s, p, None, collection, "")
|
|
465
|
+
hydrated.extend(results)
|
|
466
|
+
return hydrated
|
|
467
|
+
|
|
468
|
+
# -----------------------------------------------------------------
|
|
469
|
+
# User context -> rdflib Graph
|
|
470
|
+
# -----------------------------------------------------------------
|
|
471
|
+
|
|
472
|
+
def _build_context_graph(self, user_context):
|
|
473
|
+
"""Convert a UserContext dataclass to an rdflib Graph."""
|
|
474
|
+
g = Graph()
|
|
475
|
+
|
|
476
|
+
if not user_context.user_id:
|
|
477
|
+
return g
|
|
478
|
+
|
|
479
|
+
ctx = URIRef(user_context.user_id)
|
|
480
|
+
g.add((ctx, RDF.type, TG_UC.UserContext))
|
|
481
|
+
|
|
482
|
+
for ou in user_context.organisational_units:
|
|
483
|
+
g.add((ctx, TG_UC.organisationalUnit, URIRef(ou)))
|
|
484
|
+
|
|
485
|
+
for role in user_context.roles:
|
|
486
|
+
g.add((ctx, TG_UC.role, URIRef(role)))
|
|
487
|
+
|
|
488
|
+
for a in user_context.assignments:
|
|
489
|
+
assignment = BNode()
|
|
490
|
+
g.add((ctx, TG_UC.hasAssignment, assignment))
|
|
491
|
+
if a.resource:
|
|
492
|
+
g.add((assignment, TG_UC.resource, URIRef(a.resource)))
|
|
493
|
+
if a.scope:
|
|
494
|
+
g.add((assignment, TG_UC.scope, Literal(a.scope)))
|
|
495
|
+
if a.status:
|
|
496
|
+
g.add((assignment, TG_UC.status, Literal(a.status)))
|
|
497
|
+
if a.qualifiers:
|
|
498
|
+
qualifiers = BNode()
|
|
499
|
+
g.add((assignment, TG_UC.qualifiers, qualifiers))
|
|
500
|
+
for k, v in a.qualifiers.items():
|
|
501
|
+
g.add((qualifiers, TG_UC[k], Literal(v)))
|
|
502
|
+
|
|
503
|
+
for e in user_context.entitlements:
|
|
504
|
+
entitlement = BNode()
|
|
505
|
+
g.add((ctx, TG_UC.hasEntitlement, entitlement))
|
|
506
|
+
if e.resource_scope:
|
|
507
|
+
g.add((entitlement, TG_UC.resourceScope,
|
|
508
|
+
Literal(e.resource_scope)))
|
|
509
|
+
if e.access_level:
|
|
510
|
+
g.add((entitlement, TG_UC.accessLevel,
|
|
511
|
+
Literal(e.access_level)))
|
|
512
|
+
|
|
513
|
+
for oa in user_context.override_authorities:
|
|
514
|
+
override = BNode()
|
|
515
|
+
g.add((ctx, TG_UC.hasOverrideAuthority, override))
|
|
516
|
+
if oa.policy_area:
|
|
517
|
+
g.add((override, TG_UC.policyArea,
|
|
518
|
+
Literal(oa.policy_area)))
|
|
519
|
+
if oa.condition:
|
|
520
|
+
g.add((override, TG_UC.condition,
|
|
521
|
+
Literal(oa.condition)))
|
|
522
|
+
|
|
523
|
+
if user_context.delegation:
|
|
524
|
+
delegation = BNode()
|
|
525
|
+
g.add((ctx, TG_UC.hasDelegation, delegation))
|
|
526
|
+
if user_context.delegation.delegator_id:
|
|
527
|
+
g.add((delegation, TG_UC.delegatorId,
|
|
528
|
+
URIRef(user_context.delegation.delegator_id)))
|
|
529
|
+
if user_context.delegation.scope:
|
|
530
|
+
g.add((delegation, TG_UC.scope,
|
|
531
|
+
Literal(user_context.delegation.scope)))
|
|
532
|
+
|
|
533
|
+
return g
|
|
534
|
+
|
|
535
|
+
# -----------------------------------------------------------------
|
|
536
|
+
# Policy evaluation
|
|
537
|
+
# -----------------------------------------------------------------
|
|
538
|
+
|
|
539
|
+
async def _evaluate_node(self, node_iri, collection, context_graph):
|
|
540
|
+
"""Evaluate a node against all policies in precedence order.
|
|
541
|
+
|
|
542
|
+
Returns a PolicyEvaluation if a policy triggers, or None if
|
|
543
|
+
the node is allowed.
|
|
544
|
+
"""
|
|
545
|
+
hydrated = await self._hydrate_node(node_iri, collection)
|
|
546
|
+
|
|
547
|
+
eval_graph = Graph()
|
|
548
|
+
|
|
549
|
+
for t in hydrated:
|
|
550
|
+
eval_graph.add(self._schema_triple_to_rdflib(t))
|
|
551
|
+
|
|
552
|
+
for s, p, o in context_graph:
|
|
553
|
+
eval_graph.add((s, p, o))
|
|
554
|
+
|
|
555
|
+
node_uri = URIRef(node_iri)
|
|
556
|
+
|
|
557
|
+
for policy in self._policies:
|
|
558
|
+
for prefix, ns in policy.target_prefixes.items():
|
|
559
|
+
eval_graph.bind(prefix, Namespace(ns))
|
|
560
|
+
|
|
561
|
+
if not self._run_sparql_target(policy, node_uri, eval_graph):
|
|
562
|
+
continue
|
|
563
|
+
|
|
564
|
+
result = self._run_sparql_rule(
|
|
565
|
+
policy, node_uri, eval_graph,
|
|
566
|
+
)
|
|
567
|
+
if result:
|
|
568
|
+
return PolicyEvaluation(
|
|
569
|
+
node_iri=node_iri,
|
|
570
|
+
policy_uri=policy.uri,
|
|
571
|
+
policy_label=policy.label,
|
|
572
|
+
determination=result["determination"],
|
|
573
|
+
blocks=result["blocks"],
|
|
574
|
+
reason=result["reason"],
|
|
575
|
+
)
|
|
576
|
+
|
|
577
|
+
return None
|
|
578
|
+
|
|
579
|
+
def _run_sparql_target(self, policy, node_uri, eval_graph):
|
|
580
|
+
"""Run a policy's SPARQL SELECT and check if the node matches."""
|
|
581
|
+
prefix_header = self._build_prefix_header(policy.target_prefixes)
|
|
582
|
+
full_query = f"{prefix_header}\n{policy.sparql_select}"
|
|
583
|
+
|
|
584
|
+
try:
|
|
585
|
+
compiled = self._sparql_cache.prepare(full_query)
|
|
586
|
+
results = list(eval_graph.query(compiled))
|
|
587
|
+
for row in results:
|
|
588
|
+
if row[0] == node_uri:
|
|
589
|
+
return True
|
|
590
|
+
except Exception as e:
|
|
591
|
+
logger.error(
|
|
592
|
+
f"SPARQL target error in policy '{policy.label}': {e}",
|
|
593
|
+
exc_info=True,
|
|
594
|
+
)
|
|
595
|
+
return False
|
|
596
|
+
|
|
597
|
+
def _run_sparql_rule(self, policy, node_uri, eval_graph):
|
|
598
|
+
"""Run a policy's CONSTRUCT rule and parse the ValidationResult.
|
|
599
|
+
|
|
600
|
+
Returns a dict with determination (IRI), blocks (bool),
|
|
601
|
+
and reason (str), or None if the CONSTRUCT produced no result.
|
|
602
|
+
"""
|
|
603
|
+
all_prefixes = {**policy.target_prefixes, **policy.construct_prefixes}
|
|
604
|
+
prefix_header = self._build_prefix_header(all_prefixes)
|
|
605
|
+
|
|
606
|
+
for prefix, ns in all_prefixes.items():
|
|
607
|
+
eval_graph.bind(prefix, Namespace(ns))
|
|
608
|
+
|
|
609
|
+
construct_query = policy.sparql_construct.replace("$this", f"<{node_uri}>")
|
|
610
|
+
full_query = f"{prefix_header}\n{construct_query}"
|
|
611
|
+
|
|
612
|
+
try:
|
|
613
|
+
result_graph = eval_graph.query(full_query).graph
|
|
614
|
+
except Exception as e:
|
|
615
|
+
logger.error(
|
|
616
|
+
f"SPARQL rule error in policy '{policy.label}': {e}",
|
|
617
|
+
exc_info=True,
|
|
618
|
+
)
|
|
619
|
+
return None
|
|
620
|
+
|
|
621
|
+
for result_node in result_graph.subjects(RDF.type, SH.ValidationResult):
|
|
622
|
+
determination = str(policy.uri)
|
|
623
|
+
blocks = True
|
|
624
|
+
reason = ""
|
|
625
|
+
|
|
626
|
+
for sev in result_graph.objects(result_node, SH.resultSeverity):
|
|
627
|
+
determination = str(sev)
|
|
628
|
+
|
|
629
|
+
for msg in result_graph.objects(result_node, SH.resultMessage):
|
|
630
|
+
reason = str(msg)
|
|
631
|
+
|
|
632
|
+
for b in result_graph.objects(result_node, TG_POL.blocks):
|
|
633
|
+
if hasattr(b, 'toPython'):
|
|
634
|
+
blocks = b.toPython()
|
|
635
|
+
else:
|
|
636
|
+
blocks = str(b).lower() not in ("false", "0")
|
|
637
|
+
|
|
638
|
+
return {
|
|
639
|
+
"determination": determination,
|
|
640
|
+
"blocks": blocks,
|
|
641
|
+
"reason": reason,
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
return None
|
|
645
|
+
|
|
646
|
+
def _schema_triple_to_rdflib(self, t):
|
|
647
|
+
"""Convert a schema Triple to an rdflib (s, p, o) tuple."""
|
|
648
|
+
s = self._term_to_rdflib(t.s)
|
|
649
|
+
p = self._term_to_rdflib(t.p)
|
|
650
|
+
o = self._term_to_rdflib(t.o)
|
|
651
|
+
return (s, p, o)
|
|
652
|
+
|
|
653
|
+
def _term_to_rdflib(self, term):
|
|
654
|
+
"""Convert a schema Term to an rdflib term."""
|
|
655
|
+
if term is None:
|
|
656
|
+
return None
|
|
657
|
+
if term.type == IRI:
|
|
658
|
+
return URIRef(term.iri)
|
|
659
|
+
if term.type == LITERAL:
|
|
660
|
+
return Literal(term.value)
|
|
661
|
+
return Literal(str(term.value or term.iri))
|