mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-23 12:11:02 +02:00
Processing schema
This commit is contained in:
parent
4efb23e5da
commit
949924dc8a
2 changed files with 36 additions and 10 deletions
|
|
@ -203,19 +203,16 @@ class Librarian:
|
||||||
)
|
)
|
||||||
|
|
||||||
async def list_processing(self, request):
|
async def list_processing(self, request):
|
||||||
raise RuntimeError("Not implemented")
|
|
||||||
|
|
||||||
async def list(self, user, collection):
|
procs = await self.table_store.list_processing(request.user)
|
||||||
|
|
||||||
raise RuntimeError("Not implemented")
|
print(procs)
|
||||||
|
|
||||||
info = self.table_store.list(user, collection)
|
|
||||||
|
|
||||||
print(">>", info)
|
|
||||||
|
|
||||||
return LibrarianResponse(
|
return LibrarianResponse(
|
||||||
error = None,
|
error = None,
|
||||||
document = None,
|
document_metadata = None,
|
||||||
info = info,
|
content = None,
|
||||||
|
document_metadatas = None,
|
||||||
|
processing_metadatas = procs,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,7 @@ class TableStore:
|
||||||
WHERE user = ?
|
WHERE user = ?
|
||||||
""")
|
""")
|
||||||
|
|
||||||
self.list_document_by_collection_stmt = self.cassandra.prepare("""
|
self.list_document_by_tag_stmt = self.cassandra.prepare("""
|
||||||
SELECT
|
SELECT
|
||||||
id, time, kind, title, comments, metadata, tags, object_id
|
id, time, kind, title, comments, metadata, tags, object_id
|
||||||
FROM document
|
FROM document
|
||||||
|
|
@ -219,6 +219,35 @@ class TableStore:
|
||||||
ALLOW FILTERING
|
ALLOW FILTERING
|
||||||
""")
|
""")
|
||||||
|
|
||||||
|
self.insert_processing_stmt = self.cassandra.prepare("""
|
||||||
|
INSERT INTO processing
|
||||||
|
(
|
||||||
|
id, document_id, time,
|
||||||
|
flow, user, collection,
|
||||||
|
tags,
|
||||||
|
)
|
||||||
|
VALUES (?, ?, ?, ?, ?, ?, ?)
|
||||||
|
""")
|
||||||
|
|
||||||
|
self.delete_processing_stmt = self.cassandra.prepare("""
|
||||||
|
DELETE FROM processing
|
||||||
|
WHERE user = ? AND id = ?
|
||||||
|
""")
|
||||||
|
|
||||||
|
self.test_processing_exists_stmt = self.cassandra.prepare("""
|
||||||
|
SELECT id
|
||||||
|
FROM processing
|
||||||
|
WHERE user = ? AND id = ?
|
||||||
|
LIMIT 1
|
||||||
|
""")
|
||||||
|
|
||||||
|
self.list_processing_stmt = self.cassandra.prepare("""
|
||||||
|
SELECT
|
||||||
|
id, document_id, time, flow, collection, tags
|
||||||
|
FROM processing
|
||||||
|
WHERE user = ?
|
||||||
|
""")
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
self.insert_triples_stmt = self.cassandra.prepare("""
|
self.insert_triples_stmt = self.cassandra.prepare("""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue