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

518: Add transitive-closure() function #521

Merged
merged 5 commits into from
Jun 13, 2023

Conversation

michaelhkay
Copy link
Contributor

No description provided.

<fos:example>
<fos:test use="transitive-closure-data">
<fos:expression>transitive-closure($data//person[@id=2], function{//person[@manager]=@id})/string(@id)</fos:expression>
<fos:result>("3", "4", "6")</fos:result>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the result ("3", "4", "6") contain "6"? Person 6's manager is 3, not 2.

Copy link

@joewiz joewiz May 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I think I get it. With the first iteration, we get persons who have 2 as a manager (persons 3 and 4), and with the following iteration we get all people who have 3 or 4 as a manager (person 6) - and thus the answer is 3, 4, and 6. (I'd been misreading the context for //person as $data/person[@id = 2], whereas in fact it's all of $data.)

@ndw ndw added the Revise PR has been discussed and substantive changes requested label Jun 6, 2023
@michaelhkay michaelhkay removed the Revise PR has been discussed and substantive changes requested label Jun 9, 2023
@ndw
Copy link
Contributor

ndw commented Jun 13, 2023

The CG accepted this PR at meeting 038

@ndw ndw merged commit 39c9d57 into qt4cg:master Jun 13, 2023
@michaelhkay
Copy link
Contributor Author

Closes issue #518

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants