package selection_queries

var definitions = []Definition{
	{
		Meta: Meta{ID: "neighbors", Label: "Neighbors"},
		Run:  runNeighbors,
	},
	{
		Meta: Meta{ID: "superclasses", Label: "Superclasses"},
		Run:  runSuperclasses,
	},
	{
		Meta: Meta{ID: "subclasses", Label: "Subclasses"},
		Run:  runSubclasses,
	},
}

func List() []Meta {
	out := make([]Meta, 0, len(definitions))
	for _, d := range definitions {
		out = append(out, d.Meta)
	}
	return out
}

func Get(id string) (Definition, bool) {
	for _, d := range definitions {
		if d.Meta.ID == id {
			return d, true
		}
	}
	return Definition{}, false
}
