Feature/flow api 3 (#358)

* Working mux socket

* Change API to incorporate flow

* Add Flow ID to all relevant CLIs, not completely implemented

* Change tg-processor-state to use API gateway

* Updated all CLIs

* New tg-show-flow-state command

* tg-show-flow-state shows classes too
This commit is contained in:
cybermaggedon 2025-05-03 10:39:53 +01:00 committed by GitHub
parent a70ae9793a
commit 3b8b9ea866
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 800 additions and 986 deletions

View file

@ -17,14 +17,14 @@ default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/')
default_user = 'trustgraph'
default_collection = 'default'
def show_graph(url, user, collection):
def show_graph(url, flow_id, user, collection):
api = Api(url)
rows = api.triples_query(
rows = api.flow(flow_id).triples_query(
s=None, p=None, o=None,
user=user, collection=collection,
limit=10_000)
# user=user, collection=collection,
g = rdflib.Graph()
@ -69,6 +69,12 @@ def main():
help=f'API URL (default: {default_url})',
)
parser.add_argument(
'-f', '--flow-id',
default="0000",
help=f'Flow ID (default: 0000)'
)
parser.add_argument(
'-U', '--user',
default=default_user,
@ -86,9 +92,10 @@ def main():
try:
show_graph(
url=args.api_url,
user=args.user,
collection=args.collection
url = args.api_url,
flow_id = args.flow_id,
user = args.user,
collection = args.collection,
)
except Exception as e: