Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug runt synformpivot #1470

Merged
merged 2 commits into from Dec 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions synapse/lib/ast.py
Expand Up @@ -1396,8 +1396,7 @@ async def run(self, runt, genr):

refsvalu = node.get(refsname)
if refsvalu is not None:
pivo = await runt.snap.getNodeByNdef((refsform, refsvalu))
if pivo is not None:
async for pivo in runt.snap.getNodesBy(refsform, refsvalu):
yield pivo, path.fork(pivo)

for refsname, refsform in refs.get('array'):
Expand Down
5 changes: 5 additions & 0 deletions synapse/tests/test_model_syn.py
Expand Up @@ -196,6 +196,11 @@ async def delExtModelConfigs(cortex):
# form is a prop, two universal properties (+2 test univ) and two model secondary properties.
self.true(len(nodes) >= 7)

# implicit pivot works as well
nodes = await core.nodes('syn:prop:form=test:comp -> syn:form | uniq')
self.len(1, nodes)
self.eq(nodes[0].ndef, ('syn:form', 'test:comp'))

# Go from a syn:type to a syn:form to a syn:prop with a filter
q = 'syn:type:subof=comp +syn:type:doc~=".*fake.*" -> syn:form:type -> syn:prop:form'
nodes = await core.eval(q).list()
Expand Down