Search code examples
sqlgraph-databasesarcadedb

In Arcadedb how do I get a list of vertex types that are subtypes to a supertype?


I need to get a list of vertex types from the database that are subtypes to a supertype.

I.e. If I have a vertex structure that goes:

View -> Type1 -> Custom_Type_1

View -> Type1 -> Custom_Type_2

View -> Type2 -> Custom_Type_3

I want to be able to query....

"Get all type names that are subtypes to 'Type1'." So that it returns Custom_Type_1 and Custom_Type_2.

Note it is the type names I want, not the actual vertices of that type. I assume there must be a database metadata somewhere that could be queried but I can't find anything in the documentation to do this.

Am learning as ever.


Solution

  • You can query the schema and ask for the types with parent type equals to Type1:

    select name from schema:types where 'Type1' IN parentTypes
    

    enter image description here