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] - incorrect logic in OmlSearch.findInstancesRelatedTo #103

Open
2 tasks
NicolasRouquette opened this issue Dec 8, 2022 · 2 comments
Open
2 tasks

Comments

@NicolasRouquette
Copy link
Member

Description

A clear and concise description of what the bug is.

The implementation does not conform to the documented intent.

Steps to Reproduce

Steps to reproduce the behavior:

If instead of using https://github.com/NicolasRouquette/computational-hypergraph/blob/270fb0820df8a2d7da82ec0cbfeaaac11c2d888b/viewpoint/src/edu/caltech/ch/OmlServices.java#L149-L161, the logic where to use OmlSearch.findInstancesRelatedTo, then the diagrams would have the incorrect contents.

Expected Behavior

A clear and concise description of what should be the expected behavior.

Additional Context

Enter any other details such as dependencies, environment, examples, etc.

Relevant screenshots

If applicable, add screenshots to help illustrate the issue.

Correct contents for nested1 diagram:

image

Correct contents for xt diagram:

image

@melaasar
Copy link
Member

melaasar commented Feb 23, 2023

I agree the OmlSearch.findInstancesRelatedTo(NamedInstance target, Relation relation) should match the forward (not the reverse) relation of the relation instances' types.

However, I wonder if we have the following description:

ci component1 : mission:Component [
   mission:performs function1
]
ci function2 : mission:Function [
   mission:isPerformedBy component1
]
ri perform1 : mission:Performs [
   from component1
   to function3
]

Currently, a call to OmlSearch.findInstancesRelatedTo(function1, performs) would return component1, a call to OmlSearch.findInstancesRelatedTo(function3, performs) would return component1, where a call to OmlSearch.findInstancesRelatedTo(function2, performs) would return no component. Is this expected?

Conversely, a call to OmlSearch.findInstancesRelatedTo(component1, isPerformedBy) would return function2 only. Should it also return function1 and function3?

More generally:

  • Should the API search include relation instances only for a forward relation? or also for a reverse relation?
  • Should the API search for links of the inverse relation (if any) as well as links of the given relation?
  • Should the API search for links and relation instances of more specific (sub) relations?

@melaasar
Copy link
Member

melaasar commented Mar 22, 2023

@NicolasRouquette I fixed the API to match the forward relation.

However, would appreciate your input on the comment above.

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

No branches or pull requests

2 participants