Skip to main content

rbp_server/analysis/
query.rs

1use clap::Parser;
2
3#[derive(Parser)]
4#[command(author, version, about, long_about = None)]
5pub enum Query {
6    #[command(
7        about = "Find the abstractions of any given observation",
8        alias = "abs"
9    )]
10    Abstraction {
11        #[arg(required = true)]
12        target: String,
13    },
14    #[command(
15        about = "Find the distance between two targets (obs~obs or abs~abs)",
16        alias = "dst"
17    )]
18    Distance {
19        #[arg(required = true)]
20        target1: String,
21        #[arg(required = true)]
22        target2: String,
23    },
24    #[command(
25        about = "Find observations belonging to the same cluster of any given observation or abstraction",
26        alias = "sim"
27    )]
28    Similar {
29        #[arg(required = true)]
30        target: String,
31    },
32    #[command(
33        about = "Find abstractions in the neighborhood of any given observation or abstraction",
34        alias = "nbr"
35    )]
36    Nearby {
37        #[arg(required = true)]
38        target: String,
39    },
40    #[command(
41        about = "Find the equity of any given observation or abstraction",
42        alias = "eqt"
43    )]
44    Equity {
45        #[arg(required = true)]
46        target: String,
47    },
48    #[command(
49        about = "Find the population of any given observation or abstraction",
50        alias = "pop"
51    )]
52    Population {
53        #[arg(required = true)]
54        target: String,
55    },
56    #[command(
57        about = "Find the histogram of any given observation or abstraction",
58        alias = "hst"
59    )]
60    Composition {
61        #[arg(required = true)]
62        target: String,
63    },
64    #[command(about = "Convert an integer to a Path representation", alias = "pth")]
65    Path {
66        #[arg(required = true)]
67        value: i64,
68    },
69    #[command(about = "Convert an integer to an Edge representation", alias = "edg")]
70    Edge {
71        #[arg(required = true)]
72        value: u8,
73    },
74    #[command(
75        about = "Convert an integer to an Abstraction representation",
76        alias = "abi"
77    )]
78    AbsFromInt {
79        #[arg(required = true)]
80        value: i16,
81    },
82    #[command(
83        about = "Convert an integer to an Observation representation",
84        alias = "obi"
85    )]
86    ObsFromInt {
87        #[arg(required = true)]
88        value: i64,
89    },
90    #[command(
91        about = "Convert an integer to an Isomorphism representation",
92        alias = "iso"
93    )]
94    Isomorphism {
95        #[arg(required = true)]
96        value: i64,
97    },
98}