Search code examples
classgraphdata-modelinggraph-databasesmetamodel

How can I define a node class, which extends another node class, in the metamodel of Soley Studio?


Any Soley Studio users?
I started to define the metamodel for my graph. I want to define two node classes (ProdFunction and ProdPart), which both extend another node class (ArchitectureRelated).

But everytime I check for errors or build the solution it gives me this error:

"ArchitectureRelated" is a error type but a node type is expected

I tried different names for the class but it did not change. Are there special keywords to define a "node type"? The code for my node meta model is:

node class ProdFunction extends ArchitectureRelated{
mode:string;
name:string;
}

node class ProdPart extends ArchitectureRelated{
name:string;
partnumber:int;
hierLevel:int;
}

Solution

  • In the metamodel you can only extend defined classes. Therefore you have to define ArchitectureRelated as a node class. From my understanding you do not want to create instances of this class? So I defined it as an abstract class.

    Also remember that the highest superclass has to extend IdentifiableNode, IdentifiableDirectedEdge or IdentifiableUndirectedEdge.

    I would recommend you to use your superclass ArchitectureRelated for the attribute name:string; and let it inherit to the classes ProdFunction and ProdPart.

    abstract node class ArchitectureRelated extends IdentifiableNode{
    name:string;
    }
    
    node class ProdFunction extends ArchitectureRelated{
    mode:string;
    }
    
    node class ProdPart extends ArchitectureRelated{
    partnumber:int;
    hierLevel:int;
    }
    

    You can find more about defining a metamodel here: Soley Help Center (Metamodel)