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

Consider dependencies when adding classes to the workspace. #4

Open
leon-k-martin opened this issue Sep 4, 2024 · 2 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@leon-k-martin
Copy link
Collaborator

leon-k-martin commented Sep 4, 2024

Background

Some Methods have specific requirements/dependencies. For example, the JansenRit model requires its own coupling SigmoidalJansenRit

Goal

  • When the user adds a class to the workspace, it should automatically load the dependencies.
  • Requirements should also be listed in the Panel next to Parents and Children.

Implementation

I added the required nodes already to the class dictionary:

def ontoclass2dict(ontoclass):
    """
    Convert an OntoClass object to a JSON object
    Args:
        ontoclass: OntoClass object
    Returns:
        dict: JSON object
    """
    return {
        "id": uid2int(ontoclass.identifier),
        "iri": ontoclass.iri,
        "label": ontoclass.label.first(),
        "symbol": label2symbol(ontoclass),
        "type": ontology.get_type(ontoclass).label.first(),
        "definition": ontoclass.definition.first(),
        "collapsed": True,
        "childNodes": [],
        "childLinks": [],
        "is_a": [p.name for p in ontoclass.is_a if isinstance(p, owl.ThingClass)],
        "requires": [
            p.name for p in ontoclass.requires
        ],
    }

Would it be possible to implement a mechanism in the front-end that co-adds the corresponding classes to the workspace?

@leon-k-martin leon-k-martin added the enhancement New feature or request label Sep 4, 2024
@romina1601
Copy link
Collaborator

Yes, we can totally do this. What would be the strategy in case there is more than just one option available?

@leon-k-martin
Copy link
Collaborator Author

leon-k-martin commented Sep 6, 2024

Maybe we can highlight the edges representing dependencies so the user can choose between options if more are available. Something like in https://github.com/vasturiano/react-force-graph/blob/master/example/highlight/index.html

image

What do you say?

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

No branches or pull requests

2 participants