| 123456789101112131415161718192021222324 |
- from app.models import AtlasAlias, AtlasEntity, AtlasIdentifier, AtlasProvenance
- from app.triple_export import entity_to_turtle
- def test_entity_to_turtle_contains_expected_triples():
- entity = AtlasEntity(
- atlas_id="atlas:mid:/m/012gx2",
- canonical_label="Joe Biden",
- entity_type="Person",
- aliases=[AtlasAlias(label="Joe Biden")],
- identifiers=[AtlasIdentifier(value="/m/012gx2", source="google", identifier_type="mid")],
- provenance=[AtlasProvenance(source="google-trends", retrieval_method="trends-resolution", confidence=0.9, retrieved_at="2026-04-03T17:33:21.651528+00:00")],
- needs_curation=False,
- )
- ttl = entity_to_turtle(entity)
- assert '@prefix atlas: <http://world.eu.org/atlas_ontology#> .' in ttl
- assert 'atlas:canonicalLabel "Joe Biden"' in ttl
- assert 'atlas:hasCanonicalType atlas:Person' in ttl
- assert 'atlas:hasIdentifier' in ttl
- assert 'atlas:needsCuration false' in ttl
- assert 'a atlas:Claim' in ttl
- assert 'atlas:claimPredicate "atlas:hasIdentifier"' in ttl
- assert 'atlas:claimStatus "active"' in ttl
|