mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-17 09:11:03 +02:00
Change loaders to use new API
This commit is contained in:
parent
483f761e15
commit
6b478e9cc9
2 changed files with 18 additions and 4 deletions
|
|
@ -14,7 +14,7 @@ import time
|
|||
import uuid
|
||||
|
||||
from trustgraph.schema import Document, document_ingest_queue
|
||||
from trustgraph.schema import Metadata
|
||||
from trustgraph.schema import Metadata, Triple, Value
|
||||
from trustgraph.log_level import LogLevel
|
||||
from trustgraph.knowledge import hash, to_uri
|
||||
from trustgraph.knowledge import PREF_PUBEV, PREF_DOC, PREF_ORG
|
||||
|
|
@ -79,7 +79,14 @@ class Loader:
|
|||
r = Document(
|
||||
metadata=Metadata(
|
||||
id=id,
|
||||
metadata=triples,
|
||||
metadata=[
|
||||
Triple(
|
||||
s=Value(value=t["s"]["v"], is_uri=t["s"]["e"]),
|
||||
p=Value(value=t["p"]["v"], is_uri=t["p"]["e"]),
|
||||
o=Value(value=t["o"]["v"], is_uri=t["o"]["e"])
|
||||
)
|
||||
for t in triples
|
||||
],
|
||||
user=self.user,
|
||||
collection=self.collection,
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue