mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-17 01:01:03 +02:00
Fix GE load
This commit is contained in:
parent
f0c86a58cb
commit
9225ff7c79
3 changed files with 22 additions and 7 deletions
|
|
@ -51,8 +51,13 @@ async def load_ge(running, queue, url):
|
||||||
"user": msg["m"]["u"],
|
"user": msg["m"]["u"],
|
||||||
"collection": msg["m"]["c"],
|
"collection": msg["m"]["c"],
|
||||||
},
|
},
|
||||||
"vectors": msg["v"],
|
"entities": [
|
||||||
"entity": msg["e"],
|
{
|
||||||
|
"entity": ent["e"],
|
||||||
|
"vectors": ent["v"],
|
||||||
|
}
|
||||||
|
for ent in msg["e"]
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
|
|
@ -57,8 +57,13 @@ async def fetch_ge(running, queue, user, collection, url):
|
||||||
"u": data["metadata"]["user"],
|
"u": data["metadata"]["user"],
|
||||||
"c": data["metadata"]["collection"],
|
"c": data["metadata"]["collection"],
|
||||||
},
|
},
|
||||||
"v": data["vectors"],
|
"e": [
|
||||||
"e": data["entity"],
|
{
|
||||||
|
"e": ent["entity"],
|
||||||
|
"v": ent["vectors"],
|
||||||
|
}
|
||||||
|
for ent in data["entities"]
|
||||||
|
]
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
if msg.type == aiohttp.WSMsgType.ERROR:
|
if msg.type == aiohttp.WSMsgType.ERROR:
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import uuid
|
||||||
from aiohttp import WSMsgType
|
from aiohttp import WSMsgType
|
||||||
|
|
||||||
from .. schema import Metadata
|
from .. schema import Metadata
|
||||||
from .. schema import GraphEmbeddings
|
from .. schema import GraphEmbeddings, EntityEmbeddings
|
||||||
from .. schema import graph_embeddings_store_queue
|
from .. schema import graph_embeddings_store_queue
|
||||||
|
|
||||||
from . publisher import Publisher
|
from . publisher import Publisher
|
||||||
|
|
@ -50,8 +50,13 @@ class GraphEmbeddingsLoadEndpoint(SocketEndpoint):
|
||||||
user=data["metadata"]["user"],
|
user=data["metadata"]["user"],
|
||||||
collection=data["metadata"]["collection"],
|
collection=data["metadata"]["collection"],
|
||||||
),
|
),
|
||||||
entity=to_value(data["entity"]),
|
entities=[
|
||||||
vectors=data["vectors"],
|
EntityEmbeddings(
|
||||||
|
entity=to_value(ent["entity"]),
|
||||||
|
vectors=ent["vectors"],
|
||||||
|
)
|
||||||
|
for ent in data["entities"]
|
||||||
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
self.publisher.send(None, elt)
|
self.publisher.send(None, elt)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue