mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-15 08:12:10 +02:00
Structured data 2 (#645)
* Structured data refactor - multi-index tables, remove need for manual mods to the Cassandra tables * Tech spec updated to track implementation
This commit is contained in:
parent
5ffad92345
commit
1809c1f56d
87 changed files with 5233 additions and 3235 deletions
|
|
@ -573,19 +573,19 @@ def _process_data_pipeline(input_file, descriptor_file, user, collection, sample
|
|||
return output_records, descriptor
|
||||
|
||||
|
||||
def _send_to_trustgraph(objects, api_url, flow, batch_size=1000, token=None):
|
||||
def _send_to_trustgraph(rows, api_url, flow, batch_size=1000, token=None):
|
||||
"""Send ExtractedObject records to TrustGraph using Python API"""
|
||||
from trustgraph.api import Api
|
||||
|
||||
try:
|
||||
total_records = len(objects)
|
||||
total_records = len(rows)
|
||||
logger.info(f"Importing {total_records} records to TrustGraph...")
|
||||
|
||||
# Use Python API bulk import
|
||||
api = Api(api_url, token=token)
|
||||
bulk = api.bulk()
|
||||
|
||||
bulk.import_objects(flow=flow, objects=iter(objects))
|
||||
bulk.import_rows(flow=flow, rows=iter(rows))
|
||||
|
||||
logger.info(f"Successfully imported {total_records} records to TrustGraph")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue