Skip to content

Commit

Permalink
fix test_mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Treesarj committed Mar 13, 2024
1 parent a27fbcd commit 6520494
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tests/strategies/test_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,20 @@ def test_mapping_with_prefixes() -> None:
prefixes={
"f": "http://onto-ns.com/meta/0.1/Forces#",
"e": "http://onto-ns.com/meta/0.1/Energy#",
"map": str(MAP), # __FIXME__: prefixes should accept a Namespace
"emmo": str(EMMO),
},
triples=[
("f:forces", "map:mapsTo", "emmo:Force"),
("e:energy", "map:mapsTo", "emmo:PotentialEnergy"),
(FORCES.forces, MAP.mapsTo, EMMO.Force),
(ENERGY.energy, MAP.mapsTo, EMMO.PotentialEnergy),
],
)

mapper = DLiteMappingStrategy(config)
session = mapper.initialize()
session.update(mapper.get())

coll = get_collection(session)
collection = get_collection(session)

relations = set(coll.get_relations())
assert len(list(coll.get_relations())) == len(relations)
relations = set(collection.get_relations())
assert len(list(collection.get_relations())) == len(relations)
assert (FORCES.forces, MAP.mapsTo, EMMO.Force) in relations
assert (ENERGY.energy, MAP.mapsTo, EMMO.PotentialEnergy) in relations

0 comments on commit 6520494

Please sign in to comment.