Skip to content

Commit

Permalink
Ignore qnode/qedge constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickkwang committed Sep 20, 2021
1 parent 8468ea4 commit b6c3566
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion reasoner_transpiler/matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def __init__(self, node_id, node, **kwargs):
props.update(
(key, value)
for key, value in node.items()
if key not in ("name", "is_set")
if key not in ("name", "is_set", "constraints")
)

self.prop_string = "{" + ", ".join([
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name="reasoner-transpiler",
version="1.10.0",
version="1.10.1",
author="Patrick Wang",
author_email="[email protected]",
url="https://github.com/ranking-agent/reasoner-transpiler",
Expand Down
15 changes: 15 additions & 0 deletions tests/test_props.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,18 @@ def test_publications(database):
"attribute_type_id": "EDAM:data_0971",
"value": ["xxx"],
}


def test_constraints(database):
"""Test querying with 'constraints' property."""
qgraph = {
"nodes": {
"n0": {
"categories": "biolink:Gene",
"constraints": [],
},
},
"edges": {},
}
output = list(database.run(get_query(qgraph)))[0]
assert len(output["results"]) == 3

0 comments on commit b6c3566

Please sign in to comment.