mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-23 04:01:02 +02:00
Tests
This commit is contained in:
parent
325deb2694
commit
f7bf56e690
1 changed files with 6 additions and 6 deletions
|
|
@ -11,7 +11,7 @@ from unittest.mock import AsyncMock, Mock, patch, MagicMock
|
||||||
from unittest.mock import call
|
from unittest.mock import call
|
||||||
|
|
||||||
from trustgraph.cores.knowledge import KnowledgeManager
|
from trustgraph.cores.knowledge import KnowledgeManager
|
||||||
from trustgraph.schema import KnowledgeResponse, Triples, GraphEmbeddings, Metadata, Triple, Value, EntityEmbeddings
|
from trustgraph.schema import KnowledgeResponse, Triples, GraphEmbeddings, Metadata, Triple, Term, EntityEmbeddings, IRI, LITERAL
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|
@ -71,15 +71,15 @@ def sample_triples():
|
||||||
return Triples(
|
return Triples(
|
||||||
metadata=Metadata(
|
metadata=Metadata(
|
||||||
id="test-doc-id",
|
id="test-doc-id",
|
||||||
user="test-user",
|
user="test-user",
|
||||||
collection="default", # This should be overridden
|
collection="default", # This should be overridden
|
||||||
metadata=[]
|
metadata=[]
|
||||||
),
|
),
|
||||||
triples=[
|
triples=[
|
||||||
Triple(
|
Triple(
|
||||||
s=Value(value="http://example.org/john", is_uri=True),
|
s=Term(type=IRI, iri="http://example.org/john"),
|
||||||
p=Value(value="http://example.org/name", is_uri=True),
|
p=Term(type=IRI, iri="http://example.org/name"),
|
||||||
o=Value(value="John Smith", is_uri=False)
|
o=Term(type=LITERAL, value="John Smith")
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
@ -97,7 +97,7 @@ def sample_graph_embeddings():
|
||||||
),
|
),
|
||||||
entities=[
|
entities=[
|
||||||
EntityEmbeddings(
|
EntityEmbeddings(
|
||||||
entity=Value(value="http://example.org/john", is_uri=True),
|
entity=Term(type=IRI, iri="http://example.org/john"),
|
||||||
vectors=[[0.1, 0.2, 0.3]]
|
vectors=[[0.1, 0.2, 0.3]]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue