### createExampleConfigPanel Static Method in UsageTab Source: https://gmark.docs.roanh.dev/index-all Creates a panel containing an example configuration. This is a utility method for displaying usage examples in the client interface. ```java dev.roanh.gmark.client.UsageTab.createExampleConfigPanel(String title) ``` -------------------------------- ### ExampleTab Constructor for dev.roanh.gmark.client Source: https://gmark.docs.roanh.dev/index-all Constructs a new example tab. This tab demonstrates important structures within the gMark framework. ```Java ExampleTab() - Constructor for class dev.roanh.gmark.client.ExampleTab Constructs a new example tab. ``` -------------------------------- ### WorkloadClient Command Line Usage (Example) Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/cli/client/WorkloadClient Demonstrates how to use the WorkloadClient from the command line, specifying configuration file, workload type, output path, and force flag. ```bash gmark workload -c ./config.xml -s sql -o ./output -f ``` -------------------------------- ### PathSegment Start Selectivity Type Source: https://gmark.docs.roanh.dev/index-all Defines the starting selectivity type for a given path segment in a graph traversal. This is relevant for query optimization and analysis. ```Java start - Variable in class dev.roanh.gmark.data.PathSegment The starting selectivity type of this path segment. ``` -------------------------------- ### Get Workloads Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/gen/workload/Configuration Retrieves a list of all workloads configured for generation. ```APIDOC ## Get Workloads ### Description Gets all the workloads in this configuration. ### Method GET ### Endpoint /configuration/workloads ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json null ``` ### Response #### Success Response (200) - **workloads** (List[Workload]) - A list of workload objects. #### Response Example ```json { "workloads": [ { "id": 1, "name": "Workload A", ... }, { "id": 2, "name": "Workload B", ... } ] } ``` ``` -------------------------------- ### ExampleTab Class Definition Source: https://gmark.docs.roanh.dev/serialized-form Defines the ExampleTab class, a JPanel likely used for displaying examples within the gmark client. ```java class ExampleTab extends JPanel implements Serializable serialVersionUID: 8727642118457294081L ``` -------------------------------- ### Get Workload Type Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/gen/workload/rpq/WorkloadRPQ Gets the type of this workload. This method is specified by the `Workload` class and returns the specific type of the workload. ```java public WorkloadType getType() ``` -------------------------------- ### Get Conjunct Generator Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/gen/workload/rpq/WorkloadRPQ Gets a generator responsible for creating conjuncts that align with this workload's configuration. This method is specified by the `Workload` class. ```java public ConjunctGenerator getConjunctGenerator() ``` -------------------------------- ### Get Size of EdgeGraphData Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/util/graph/specific/EdgeGraphData Abstract method to get the length of the shortest path represented by this EdgeGraphData object. Implementations will provide the specific path length. ```java public abstract int size() ``` -------------------------------- ### createHelpPanel Static Method in UsageTab Source: https://gmark.docs.roanh.dev/index-all Constructs a command-line client (CLI) help panel for the given client. This method assists in generating user-friendly help documentation within the application. ```java dev.roanh.gmark.client.UsageTab.createHelpPanel(CommandLineClient client) ``` -------------------------------- ### Get Max Selectivity Graph Length Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/gen/workload/rpq/WorkloadRPQ Gets the maximum length of paths required in the selectivity graph for generating queries according to this workload. This is specified by the `Workload` class. ```java public int getMaxSelectivityGraphLength() ``` -------------------------------- ### Query Construction and Utility Methods - Java Source: https://gmark.docs.roanh.dev/index-all Provides methods for constructing `CQ` objects from graphs and for creating selectivity types. It also includes a method to prompt the user for a configuration file, facilitating workload management. ```Java dev.roanh.gmark.lang.cq.CQ.of(UniqueGraph) dev.roanh.gmark.data.SelectivityType.of(Type, SelectivityClass) dev.roanh.gmark.client.QueryTab.openWorkload() ``` -------------------------------- ### CommandLineClient - Constructor Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/cli/CommandLineClient Information about the constructor for the CommandLineClient class. ```APIDOC ## CommandLineClient Constructor ### Constructor Summary - **CommandLineClient(String name, org.apache.commons.cli.Option... args)** - Constructs a new command line client. ### Constructor Details #### CommandLineClient `protected CommandLineClient(String name, org.apache.commons.cli.Option... args)` Constructs a new command line client. **Parameters:** - `name` (String) - The name of this client. - `args` (org.apache.commons.cli.Option...) - The options accepted by this client. ``` -------------------------------- ### Get Arity from OperationType Enum Source: https://gmark.docs.roanh.dev/index-all Gets the arity (number of operands) for a given OperationType in the Abstract Syntax Tree (AST). This is essential for understanding and processing operations. ```Java getArity() - Method in enum class dev.roanh.gmark.ast.OperationType Gets the arity of this operator, that is, the number of arguments or operands it takes. ``` -------------------------------- ### CommandLineClient - Methods Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/cli/CommandLineClient Details about the methods available in the CommandLineClient class. ```APIDOC ## CommandLineClient Methods ### Method Summary - **getHelpFooter()** (String) - Returns the help footer for this client. - **getName()** (String) - Gets the display name of this client. - **getOptions()** (org.apache.commons.cli.Options) - Gets the arguments accepted by this client. - **handleInput(String[] args)** (void) - Handles the given CLI input with this client. - **handleInput(org.apache.commons.cli.CommandLine cli)** (void) - Handles received command line input with this client. - **printHelp()** (void) - Prints the help text for this client to standard out. - **printHelp(PrintWriter out)** (void) - Prints the help text for this client to the given writer. ### Method Details #### getHelpFooter `public String getHelpFooter()` The help footer to show at the end of the help text for this client. **Returns:** - (String) The help footer for this client. #### getName `public String getName()` Gets the display name of this client. **Returns:** - (String) The name of this client. #### getOptions `public org.apache.commons.cli.Options getOptions()` Gets the arguments accepted by this client. **Returns:** - (org.apache.commons.cli.Options) The argument for this client. #### handleInput `public void handleInput(String[] args)` Handles the given CLI input with this client. **Parameters:** - `args` (String[]) - The CLI input. #### handleInput `protected abstract void handleInput(org.apache.commons.cli.CommandLine cli) throws InputException` Handles received command line input with this client. **Parameters:** - `cli` (org.apache.commons.cli.CommandLine) - The input that was received. **Throws:** - `InputException` - When the provided CLI input contains issues. #### printHelp `public void printHelp()` Prints the help text for this client to standard out. **See Also:** - `printHelp(PrintWriter)` #### printHelp `public void printHelp(PrintWriter out)` Prints the help text for this client to the given writer. **Parameters:** - `out` (PrintWriter) - The writer to write to. **See Also:** - `printHelp()` ### Methods inherited from class java.lang.Object `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait ``` -------------------------------- ### Javadoc Search Examples Source: https://gmark.docs.roanh.dev/help-doc Demonstrates various search query patterns for finding API elements in Javadoc. These examples showcase matching by full name, camelCase abbreviations, and multiple search terms. ```java /// "j.l.obj" matches "java.lang.Object" /// "InpStr" matches "java.io.InputStream" /// "math exact long" matches "java.lang.Math.absExact(long)" ``` -------------------------------- ### WorkloadClient Method: handleConfigurationInput (Java) Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/cli/client/WorkloadClient Handles input specifically when a complete configuration file is provided to the WorkloadClient. ```java private void handleConfigurationInput(org.apache.commons.cli.CommandLine cli) ``` -------------------------------- ### GraphMark Main Method (Java) Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/client/GraphMark The `main` method serves as the entry point for the GraphMark application. It determines whether to launch the graphical user interface (GUI) or the command-line interface (CLI) based on the presence of command-line arguments. If arguments are provided, it initiates the CLI mode; otherwise, it launches the GUI. ```java public static void main(String[] args) Launches the gMark GUI if not command line arguments are passed. Otherwise switches over to the CLI version of gMark. Parameters: `args` - Command line arguments, if present then gMark will switch to command line mode. ``` -------------------------------- ### QueryShape Enum Constants Examples Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/gen/shape/QueryShape Demonstrates the structure of different query shapes (CHAIN, STAR, CYCLE, STARCHAIN) using example conjuncts and variables. These constants define how query clauses are related. ```Java CHAIN: (?x0,?x1),(?x1,?x2),(?x2,?x3) STAR: (?x0,?x1),(?x0,?x2),(?x0,?x3) CYCLE: (?x0,?x1),(?x1,?x2),(?x0,?x3),(?x3,?x2) STARCHAIN: (?x0,?x1),(?x0,?x2),(?x0,?x3),(?x3,?x4),(?x4,?x5),(?x4,?x6) ``` -------------------------------- ### WorkloadRPQ Constructor Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/gen/workload/rpq/WorkloadRPQ Constructs a new RPQ workload from a given configuration element and graph schema. It initializes the workload with parameters from the provided `elem` and `schema`. ```java public WorkloadRPQ(Element elem, Schema schema) ``` -------------------------------- ### generateConjunct Method - Java Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/gen/workload/rpq/ConjunctGeneratorRPQ Generates a single conjunct using the given selectivity graph and with the start of the conjunct being the given start selectivity type and the end of the conjunct the given end selectivity type. This method is essential for creating individual components of an RPQ. ```Java public Conjunct generateConjunct(SelectivityGraph gSel, SelectivityType start, SelectivityType end, Variable source, Variable target, boolean star) throws GenerationException { // Implementation details for generating a conjunct based on the provided parameters. // This would involve using gSel, start, end, source, target, and star to construct a Conjunct object. // For example: // return new Conjunct(start, end, source, target, star, gSel); throw new UnsupportedOperationException("generateConjunct not yet implemented"); } ``` -------------------------------- ### WorkloadRPQ Constructor and Methods (Java) Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/gen/workload/rpq/WorkloadRPQ This snippet shows the constructor for WorkloadRPQ and key methods for getting and setting parameters like maximum disjuncts, maximum length, minimum disjuncts, and minimum length. It also includes a method to validate the workload configuration. ```java public class WorkloadRPQ extends Workload { private int maxDisjuncts; private int maxLength; private int minDisjuncts; private int minLength; WorkloadRPQ(Element elem, Schema schema) { // Constructs a new RPQ workload from the given configuration element and graph schema. } public ConjunctGenerator getConjunctGenerator() { // Gets a generator for generating conjuncts according to this workload configuration. } public int getMaxDisjuncts() { // Gets the maximum number of disjuncts in the RPQs to generate. } public int getMaxLength() { // Gets the maximum length of the RPQs to generate. } public int getMaxSelectivityGraphLength() { // Gets the maximum length of paths needed in the selectivity graph to generate queries in accordance with this workload. } public int getMinDisjuncts() { // Gets the minimum number of disjuncts in the RPQs to generate. } public int getMinLength() { // Gets the minimum length of the RPQs to generate. } public WorkloadType getType() { // Gets the type of this workload. } public void setMaxDisjuncts(int disj) { // Sets the maximum number of disjuncts in the RPQs to generate. } public void setMaxLength(int len) { // Sets the maximum length of the RPQs to generate. } public void setMinDisjuncts(int disj) { // Sets the minimum number of disjuncts in the RPQs to generate. } public void setMinLength(int len) { // Sets the minimum length of the RPQs to generate. } public void validate() { // Validates this workload by checking that all of the arguments are valid and usable for query generation. } } ``` -------------------------------- ### getSelectivities Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/gen/workload/Workload Gets all the selectivities allowed for queries in this workload. ```APIDOC ## getSelectivities ### Description Gets all the selectivities allowed for queries in this workload. ### Method GET ### Endpoint /websites/gmark_roanh_dev/getSelectivities ### Response #### Success Response (200) - **selectivities** (Set) - All allowed query selectivities. #### Response Example { "selectivities": [ "low", "medium", "high" ] } ``` -------------------------------- ### EvalTab Constructor and UI Creation Methods Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/client/EvalTab This section details the constructor for the EvalTab class and methods responsible for creating UI panels for query input and helper buttons with special symbols. It covers the initialization of the EvalTab and the assembly of its constituent UI elements. ```java public EvalTab() Constructs a new query evaluation tab. private JPanel createQueryPanel(JButton run) Creates the query input panel. Parameters: `run` - The query run button to configure the run listener for. Returns: A panel to input a query. private JPanel createQueryEditorButtons(JTextField query) Creates a panel with all the special symbols for query input. Parameters: `query` - The query text field to insert symbols in. Returns: The constructed panel with helper buttons. ``` -------------------------------- ### getShapes Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/gen/workload/Workload Gets all the shapes allowed for queries in this workload. ```APIDOC ## getShapes ### Description Gets all the shapes allowed for queries in this workload. ### Method GET ### Endpoint /websites/gmark_roanh_dev/getShapes ### Response #### Success Response (200) - **shapes** (Set) - All allowed query shapes. #### Response Example { "shapes": [ "shape1", "shape2" ] } ``` -------------------------------- ### SimpleGraph.SimpleVertex Constructor Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/util/graph/generic/SimpleGraph Details the constructor used to create a new SimpleVertex instance. ```APIDOC ## SimpleGraph.SimpleVertex Constructor ### Description Initializes a new SimpleVertex with the provided data. ### Constructor - **SimpleVertex(T data)** - Constructs a new vertex with the given data. ``` -------------------------------- ### Get Vertices Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/lang/cpq/QueryGraphCPQ Retrieves the set of all vertices that are part of this query graph. ```Java public Set getVertices() ``` -------------------------------- ### CQ Constructor API Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/lang/cq/CQ Provides constructors for creating new CQ instances, either empty or with initial variables and formulae. ```APIDOC ## CQ Constructors ### `private CQ()` **Description**: Constructs a new empty CQ. **Method**: CONSTRUCTOR **Endpoint**: N/A ### `protected CQ(Set variables, List formulae)` **Description**: Constructs a new CQ with the given set of variables and formulae. **Parameters**: - `variables` (Set) - Required - The variables that appear in the CQ. - `formulae` (List) - Required - The formulae corresponding to graph edges. **Method**: CONSTRUCTOR **Endpoint**: N/A ``` -------------------------------- ### Get Edges Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/lang/cpq/QueryGraphCPQ Retrieves the set of all edges that constitute this query graph. ```Java public Set getEdges() ``` -------------------------------- ### Java CommandLineClient Method Details: printHelp Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/cli/CommandLineClient Documents the 'printHelp' methods for the CommandLineClient. One method prints help to standard output, while an overloaded version allows printing to a specified PrintWriter, facilitating flexible help message display. ```java public void printHelp() // Prints the help text for this client to standard out. // See Also: // printHelp(PrintWriter) public void printHelp(PrintWriter out) // Prints the help text for this client to the given writer. // Parameters: // out - The writer to write to. // See Also: // printHelp() ``` -------------------------------- ### Get Target Vertex Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/lang/cpq/QueryGraphCPQ Retrieves the target vertex of this query graph. ```Java public QueryGraphCPQ.Vertex getTargetVertex() ``` -------------------------------- ### Get Source Vertex Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/lang/cpq/QueryGraphCPQ Retrieves the source vertex of this query graph. ```Java public QueryGraphCPQ.Vertex getSourceVertex() ``` -------------------------------- ### OutputSQL Interface Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/output/OutputSQL Documentation for the OutputSQL interface and its methods toSQL and writeSQL. ```APIDOC ## OutputSQL Interface ### Description Interface for components that can be converted to an SQL query representing them. ### Methods #### `toSQL()` ##### Description Converts this object to an SQL query. ##### Method default String ##### Endpoint N/A (Interface Method) ##### Response * **String** - An SQL query representing this object. ##### Response Example ```json { "query": "SELECT * FROM example_table" } ``` #### `writeSQL(IndentWriter writer)` ##### Description Writes the SQL representation of this object to the given writer. ##### Method void ##### Endpoint N/A (Interface Method) ##### Parameters * **writer** (IndentWriter) - Required - The writer to write to. ##### Request Example N/A (Method modifies writer directly) ##### Response * **void** - This method does not return a value but writes to the provided writer. ##### Response Example N/A (Method modifies writer directly) ``` -------------------------------- ### QueryTab Constructor and Methods Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/client/QueryTab This snippet details the constructor and key methods of the QueryTab class. The constructor initializes the tab, while methods like `genWorkload`, `openWorkload`, and `saveWorkload` handle the core functionalities of query generation, opening workload configurations, and saving generated queries, respectively. These methods operate within the context of the JPanel. ```java public class QueryTab extends JPanel { // ... (fields omitted for brevity) /** * Constructs a new query tab. */ public QueryTab() { // Constructor implementation } /** * Generates a set queries for the given workload. * @param wl The workload to generate queries for. */ private void genWorkload(Workload wl) { // Method implementation } /** * Prompts the user for a gMark configuration file to open. */ private void openWorkload() { // Method implementation } /** * Saves the most recently generated workload by prompting the user for a folder to save to. */ private void saveWorkload() { // Method implementation } // ... (inherited methods omitted for brevity) } ``` -------------------------------- ### getMaxArity Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/gen/workload/Workload Gets the maximum arity allowed for queries in this workload. ```APIDOC ## getMaxArity ### Description Gets the maximum arity allowed for queries in this workload. ### Method GET ### Endpoint /websites/gmark_roanh_dev/getMaxArity ### Response #### Success Response (200) - **maxArity** (integer) - The maximum arity. #### Response Example { "maxArity": 10 } ``` -------------------------------- ### Java CommandLineClient Constructor Details Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/cli/CommandLineClient Details the protected constructor for the CommandLineClient. It is used to initialize a new command-line client instance with a given name and an array of command-line options. ```java protected CommandLineClient(String name, org.apache.commons.cli.Option... args) // Constructs a new command line client. // Parameters: // name - The name of this client. // args - The options accepted by this client. ``` -------------------------------- ### getMinArity Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/gen/workload/Workload Gets the minimum arity allowed for queries in this workload. ```APIDOC ## getMinArity ### Description Gets the minimum arity allowed for queries in this workload. ### Method GET ### Endpoint /websites/gmark_roanh_dev/getMinArity ### Response #### Success Response (200) - **minArity** (integer) - The minimum arity. #### Response Example { "minArity": 2 } ``` -------------------------------- ### Configuration Constructor Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/gen/workload/Configuration Constructs a new gMark configuration with specified graph sizes, schema, and workloads. ```APIDOC ## Configuration Constructor ### Description Constructs a new gMark configuration. ### Method CONSTRUCTOR ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "sizes": [100, 200], "schema": { ... }, "workloads": [ { ... } ] } ``` ### Response #### Success Response (200) Returns a new Configuration object. #### Response Example ```json { "configuration": { ... } } ``` ``` -------------------------------- ### getSize Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/gen/workload/Workload Gets the total number of queries that should be generated for this workload. ```APIDOC ## getSize ### Description Gets the total number of queries that should be generated for this workload. ### Method GET ### Endpoint /websites/gmark_roanh_dev/getSize ### Response #### Success Response (200) - **size** (integer) - The total number of queries for this workload. #### Response Example { "size": 100 } ``` -------------------------------- ### PathQuery Constructor and Factory Methods (Java) Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/eval/PathQuery This snippet shows the primary constructor for the PathQuery class and several static factory methods (`of`) that allow for the creation of PathQuery instances with varying source and target vertex configurations (free or bound). ```java public PathQuery(Optional source, ReachabilityQueryLanguageSyntax query, Optional target) public static final PathQuery of(ReachabilityQueryLanguageSyntax query) public static final PathQuery of(ReachabilityQueryLanguageSyntax query, int target) public static final PathQuery of(int source, ReachabilityQueryLanguageSyntax query) public static final PathQuery of(int source, ReachabilityQueryLanguageSyntax query, int target) ``` -------------------------------- ### Get Type Alias (Java) Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/type/schema/Type Retrieves the textual alias name for this type. ```java public String getAlias() Gets the textual alias name for this type. Returns: The alias for this type. ``` -------------------------------- ### Constructing and Parsing CQ Instances in Java Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/lang/cq/CQ This snippet demonstrates various ways to construct and parse CQ instances in Java. It includes creating empty CQs, CQs from sets of variables and lists of atoms, CQs from unique graphs, and parsing from string representations with optional labels. It also shows parsing from an Abstract Syntax Tree. ```java CQ cq1 = new CQ(); CQ cq2 = CQ.empty(); Set variables = new HashSet<>(); List formulae = new ArrayList<>(); CQ cq3 = new CQ(variables, formulae); UniqueGraph graph = new UniqueGraph<>(); CQ cq4 = CQ.of(graph); String queryStr = "some_query"; CQ cq5 = CQ.parse(queryStr); List labels = new ArrayList<>(); CQ cq6 = CQ.parse(queryStr, labels); QueryTree ast = new QueryTree(); CQ cq7 = CQ.parse(ast); ``` -------------------------------- ### Command Line Client Construction - Java Source: https://gmark.docs.roanh.dev/index-all Defines a generic client for handling command line input. The `CommandLineClient` constructor takes a name and a variable number of `Option` objects, allowing for flexible definition of command line arguments and their corresponding actions. ```java public CommandLineClient(String name, Option... options) { // Implementation details... } ``` -------------------------------- ### getMaxConjuncts Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/gen/workload/Workload Gets the maximum number of conjuncts allowed for queries in this workload. ```APIDOC ## getMaxConjuncts ### Description Gets the maximum number of conjuncts allowed for queries in this workload. ### Method GET ### Endpoint /websites/gmark_roanh_dev/getMaxConjuncts ### Response #### Success Response (200) - **maxConjuncts** (integer) - The maximum number of conjuncts. #### Response Example { "maxConjuncts": 5 } ``` -------------------------------- ### QuerySet Constructor and Fields Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/query/QuerySet Details on the QuerySet constructor and its fields, including the list of queries and generation time. ```APIDOC ## QuerySet Constructor and Fields ### Description Details about the constructor for `QuerySet` and its internal fields. ### Constructor #### `public QuerySet(List queries, long time)` Constructs a new query set with the given queries and generation time. **Parameters**: - `queries` (List) - Required - The queries for this query set. - `time` (long) - Required - The time in milliseconds it took to generate the queries in this query set. ### Fields #### `private final List queries` The queries stored in this query set. #### `private final long generationTime` The total time it took to generate the queries in this query set (in milliseconds). ``` -------------------------------- ### getMinConjuncts Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/gen/workload/Workload Gets the minimum number of conjuncts allowed for queries in this workload. ```APIDOC ## getMinConjuncts ### Description Gets the minimum number of conjuncts allowed for queries in this workload. ### Method GET ### Endpoint /websites/gmark_roanh_dev/getMinConjuncts ### Response #### Success Response (200) - **minConjuncts** (integer) - The minimum number of conjuncts. #### Response Example { "minConjuncts": 1 } ``` -------------------------------- ### Get Workload By ID Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/gen/workload/Configuration Retrieves a specific workload by its unique identifier. ```APIDOC ## Get Workload By ID ### Description Gets the workload with the given ID from this configuration. ### Method GET ### Endpoint /configuration/workloads/{id} ### Parameters #### Path Parameters - **id** (int) - Required - The ID of the workload to retrieve. #### Query Parameters None #### Request Body None ### Request Example ```json null ``` ### Response #### Success Response (200) - **workload** (Workload) - The workload object corresponding to the provided ID. #### Response Example ```json { "workload": { "id": 1, "name": "Specific Workload", ... } } ``` #### Error Response (404) - **message** (string) - Indicates that the workload with the given ID was not found. #### Error Response Example ```json { "message": "Workload with ID 99 not found." } ``` ``` -------------------------------- ### Get Edge Count Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/lang/cpq/QueryGraphCPQ Retrieves the total number of edges present in this query graph. ```Java public int getEdgeCount() ``` -------------------------------- ### Java UsageTab Class Definition and Constructor Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/client/UsageTab Defines the UsageTab class, which extends JPanel and is used to display command-line usage and example configurations. It includes a constructor for initializing the tab. ```java public class UsageTab extends JPanel { private static final long serialVersionUID = 1L; public UsageTab() { // Constructs a new usage tab. } } ``` -------------------------------- ### Workload Constructor and Configuration Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/gen/workload/Workload This snippet shows the constructor for the Workload class and methods to set various configuration parameters like minimum/maximum arity, conjuncts, and probabilities. It also includes methods to add or remove selectivities and query shapes. ```Java protected Workload(Element elem, Schema schema) public void setMinArity(int arity) public void setMaxArity(int arity) public void setMinConjuncts(int conj) public void setMaxConjuncts(int conj) public void addSelectivities(Selectivity... selectivities) public void removeSelectivities(Selectivity... selectivities) public void addShapes(QueryShape... shapes) ``` -------------------------------- ### Get Vertex Count Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/lang/cpq/QueryGraphCPQ Retrieves the total number of vertices present in this query graph. ```Java public int getVertexCount() ``` -------------------------------- ### CPQ Method Details Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/lang/cpq/CPQ Detailed documentation for various methods within the CPQ class, covering query graph computation, core calculation, homomorphic testing, conversion to CQ, and query language retrieval. ```APIDOC ## CPQ Method Details ### toQueryGraph (Overload 1) - **Description**: Computes and returns the query graph for this CPQ. - **Method**: `default QueryGraphCPQ toQueryGraph()` - **Returns**: The query graph for this CPQ. - **See Also**: `QueryGraphCPQ` ### computeCore - **Description**: Computes and returns the core of the query graph for this CPQ. - **Method**: `default QueryGraphCPQ computeCore()` - **Returns**: The core of this CPQ. - **See Also**: `QueryGraphCPQ`, `QueryGraphCPQ.computeCore()` ### isHomomorphicTo - **Description**: Tests if the query graph for this CPQ is homomorphic to the query graph for the given other CPQ. - **Method**: `default boolean isHomomorphicTo(CPQ other)` - **Parameters**: - `other` (CPQ) - Required - The other CPQ to test against. - **Returns**: True if this CPQ is homomorphic to the other CPQ. - **See Also**: `toQueryGraph()`, `QueryGraphCPQ.isHomomorphicTo(QueryGraphCPQ)` ### toCQ - **Description**: Converts this CPQ to an equivalent CQ query. - **Method**: `default CQ toCQ()` - **Returns**: The CQ form of this CPQ. - **See Also**: `QueryGraphCPQ.toQueryGraphCQ()` ### getQueryLanguage - **Description**: Gets the concrete query language used to define this query. - **Method**: `default QueryLanguage getQueryLanguage()` - **Specified By**: `getQueryLanguage` in interface `QueryLanguageSyntax` - **Returns**: The query language for this query. ### toQueryGraph (Overload 2) - **Description**: Computes and returns the query graph for this CPQ using the given source and target vertices for the computation. Using this version instead of `toQueryGraph()` can lead to unexpected results. - **Method**: `QueryGraphCPQ toQueryGraph(QueryGraphCPQ.Vertex source, QueryGraphCPQ.Vertex target)` - **Parameters**: - `source` (QueryGraphCPQ.Vertex) - Required - The source vertex to use. - `target` (QueryGraphCPQ.Vertex) - Required - The target vertex to use. - **Returns**: The query graph for this CPQ. - **See Also**: `QueryGraphCPQ`, `toQueryGraph()` ### getDiameter - **Description**: Returns the diameter of this CPQ. The diameter is the largest number of labels to which the join operation is applied, or the length of the largest path through the CPQ from source to target. - **Method**: `int getDiameter()` - **Returns**: The diameter of this CPQ. ### isLoop - **Description**: Tests if this CPQ is a loop, meaning its source and target are the same. This is visualized as the source and target nodes being the same in a query graph, or an intersection with identity at the highest level in its grammar form. - **Method**: `boolean isLoop()` - **Returns**: True if this CPQ is a loop. - **See Also**: `QueryGraphCPQ` ### id - **Description**: Returns the identity CPQ. - **Method**: `static CPQ id()` - **Returns**: The identity CPQ. - **See Also**: `IDENTITY` ### intersect (Overload 1) - **Description**: Returns a CPQ representing the intersection (conjunction) of the two given single edge label traversals. - **Method**: `static CPQ intersect(Predicate... predicates)` - **Parameters**: - `predicates` (Predicate[]) - Required - The labels to traverse. - **Returns**: The intersection of the given label traversals. - **Throws**: `IllegalArgumentException` - When less than 2 predicates are provided. ### intersect (Overload 2) - **Description**: Returns a CPQ representing the intersection of the given CPQs from left to right (e.g., `((q1 ∩ q2) ∩ q3)`). - **Method**: `static CPQ intersect(CPQ... cpqs)` - **Parameters**: - `cpqs` (CPQ[]) - Required - The CPQs to intersect. - **Returns**: The intersection of the given CPQs. - **Throws**: `IllegalArgumentException` - When less than 2 CPQs are provided. ### intersect (Overload 3) - **Description**: Returns a CPQ representing the intersection of the given CPQs from left to right (e.g., `((q1 ∩ q2) ∩ q3)`). Note that the given list is not copied. - **Method**: `static CPQ intersect(List cpqs)` - **Parameters**: - `cpqs` (List) - Required - The CPQs to intersect. - **Returns**: The intersection of the given CPQs. - **Throws**: `IllegalArgumentException` - When less than 2 CPQs are provided. ### concat (Overload 1) - **Description**: Returns a CPQ representing the concatenation in order of the given CPQs. - **Method**: `static CPQ concat(CPQ... cpqs)` - **Parameters**: - `cpqs` (CPQ[]) - Required - The CPQs to concatenate (in order). - **Returns**: The concatenation of the given CPQs. - **Throws**: `IllegalArgumentException` - When the given list of CPQs is empty. ### concat (Overload 2) - **Description**: Returns a CPQ representing the concatenation in order of the given CPQs. Note that the given list is not copied. - **Method**: `static CPQ concat(List cpqs)` - **Parameters**: - `cpqs` (List) - Required - The CPQs to concatenate (in order). - **Returns**: The concatenation of the given CPQs. - **Throws**: `IllegalArgumentException` - When the given list of CPQs is empty. ### label - **Description**: Creates a CPQ representing a single edge label traversal. - **Method**: `static CPQ label(Predicate label)` - **Parameters**: - `label` (Predicate) - Required - The label predicate for the traversal. ``` -------------------------------- ### Get Schema Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/gen/workload/Configuration Retrieves the graph schema used for generating graphs and queries. ```APIDOC ## Get Schema ### Description Gets the graph schema for this configuration. ### Method GET ### Endpoint /configuration/schema ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json null ``` ### Response #### Success Response (200) - **schema** (Schema) - The schema object used for graph and query generation. #### Response Example ```json { "schema": { "types": [ ... ], "predicates": [ ... ] } } ``` ``` -------------------------------- ### RangeMatrix Constructors Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/util/RangeMatrix Demonstrates the different ways to construct a RangeMatrix, including specifying dimensions and an initialization supplier. These constructors are essential for creating matrix instances with desired properties. ```java public RangeMatrix(int size) public RangeMatrix(int rows, int cols) public RangeMatrix(int size, Supplier init) public RangeMatrix(int rows, int cols, Supplier init) ``` -------------------------------- ### Select Paths by Source Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/eval/ResultGraph Selects all paths from the graph that start at a specified source node. ```APIDOC ## selectSource ### Description Selects all the paths from this graph that start at the given source node. ### Method public ResultGraph selectSource(int source) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **source** (int) - Required - The source node from which paths should be selected. ### Request Example ```json { "source": 3 } ``` ### Response #### Success Response (200) - **ResultGraph** - A copy of this graph containing only the paths that start at the specified source node. #### Response Example ```json { "resultGraph": { /* ResultGraph object */ } } ``` ``` -------------------------------- ### Converting CQ to Different Representations in Java Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/lang/cq/CQ This snippet focuses on converting a CQ instance into various other representations. It demonstrates converting the CQ to its abstract syntax tree, formal logic string, query graph, and SQL or XML formats using an IndentWriter. It also shows retrieving the operation type and query language. ```java CQ cq = CQ.empty(); // ... populate cq ... QueryTree ast = cq.toAbstractSyntaxTree(); String formalSyntax = cq.toFormalSyntax(); QueryGraphCQ queryGraph = cq.toQueryGraph(); IndentWriter writer = new IndentWriter(); cq.writeSQL(writer); cq.writeXML(writer); OperationType opType = cq.getOperationType(); QueryLanguage qLang = cq.getQueryLanguage(); String cqString = cq.toString(); ``` -------------------------------- ### Get Query Body (Java) Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/query/Query Retrieves the query body. Returns an instance of QueryBody. ```Java public QueryBody getBody() ``` -------------------------------- ### WorkloadClient Constructor (Java) Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/cli/client/WorkloadClient The private constructor for WorkloadClient, ensuring it's instantiated via its singleton instance. ```java private WorkloadClient() ``` -------------------------------- ### getID Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/gen/workload/Workload Gets the unique ID for this object. This ID uniquely identifies all objects of this type. ```APIDOC ## getID ### Description Gets the unique ID for this object. This ID uniquely identifies all objects of this type. ### Method GET ### Endpoint /websites/gmark_roanh_dev/getID ### Response #### Success Response (200) - **id** (integer) - The unique ID for this object. #### Response Example { "id": 12345 } ``` -------------------------------- ### Java UsageTab Panel Creation Methods Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/client/UsageTab Provides private static methods for creating UI panels within the UsageTab. These include methods to generate panels for example configurations, CLI help, and scrollable content. ```java private static JPanel createExampleConfigPanel(String resource) { // Creates a panel with an example configuration. return null; } private static JPanel createHelpPanel(CommandLineClient client) { // Constructs a CLI help panel for the given client. return null; } private static JPanel createScrollPanel(JComponent content) { // Creates a scroll panel containing the given component. return null; } ``` -------------------------------- ### Get Label Count in Java Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/eval/DatabaseGraph Retrieves the total number of unique labels present in the graph. ```java public int getLabelCount() { // Implementation to count the number of labels return 0; // Placeholder } ``` -------------------------------- ### CQ Constructors and Fields Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/lang/cq/CQ Details the fields and constructors for the CQ class. It includes fields for variables and formulae, and constructors for creating empty or initialized CQ instances. ```java private final Set variables private final List formulae private CQ() protected CQ(Set variables, List formulae) ``` -------------------------------- ### Get Total Edge Count in Java Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/eval/DatabaseGraph Retrieves the total number of edges in the database graph. ```java public int getEdgeCount() { // Implementation to calculate total edge count return 0; // Placeholder } ``` -------------------------------- ### Get Graph Sizes Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/gen/workload/Configuration Retrieves a list of graph sizes (node counts) to be generated by gMark. ```APIDOC ## Get Graph Sizes ### Description Gets a list of the graph sizes to generate. The graph sizes returned are in the number of nodes. ### Method GET ### Endpoint /configuration/graphSizes ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json null ``` ### Response #### Success Response (200) - **graphSizes** (List[Integer]) - A list of integers representing the number of nodes for each graph to generate. #### Response Example ```json { "graphSizes": [100, 200, 500] } ``` ``` -------------------------------- ### QuerySet Constructor and Methods - Java Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/query/QuerySet This snippet details the constructor and key methods of the QuerySet class. It includes how to create a QuerySet, access individual queries, and retrieve various statistics about the collection of queries, such as counts, arity, selectivity, and shape. ```java public class QuerySet extends Object implements OutputXML { private final long generationTime; private final List queries; public QuerySet(List queries, long time) { // Constructor implementation } public Query get(int index) { // Method implementation } public int getBinaryQueryCount() { // Method implementation } public long getGenerationTime() { // Method implementation } public int getMaxArity() { // Method implementation } public int getMaxConjuncts() { // Method implementation } public int getMinArity() { // Method implementation } public int getMinConjuncts() { // Method implementation } public List getQueries() { // Method implementation } public double getSelectivityFraction(Selectivity selectivity) { // Method implementation } public int getSelectivityTotal(Selectivity selectivity) { // Method implementation } public double getShapeFraction(QueryShape shape) { // Method implementation } public int getShapeTotal(QueryShape shape) { // Method implementation } public double getStarFraction() { // Method implementation } public int size() { // Method implementation } public void writeXML(IndentWriter writer) { // Method implementation } } ``` -------------------------------- ### RangeMatrix Constructors Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/util/RangeMatrix Provides various constructors for creating RangeMatrix instances. These include constructors for square matrices of a given size, matrices with specified dimensions, and options to initialize elements using a Supplier. ```java public RangeMatrix(int size) public RangeMatrix(int rows, int cols) public RangeMatrix(int rows, int cols, Supplier init) public RangeMatrix(int size, Supplier init) ``` -------------------------------- ### Select Identity Paths Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/eval/ResultGraph Selects all edges from the graph that start and end at the same node (zero-length identity paths). ```APIDOC ## selectIdentity ### Description Selects all the edges from this graph that start and end at the same node, i.e., all zero length identity paths. ### Method public ResultGraph selectIdentity() ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **ResultGraph** - A copy of this graph containing only the edges that started and ended at the same vertex. #### Response Example ```json { "resultGraph": { /* ResultGraph object */ } } ``` ``` -------------------------------- ### Transitive Closure (From Source) Source: https://gmark.docs.roanh.dev/dev/roanh/gmark/eval/ResultGraph Computes the transitive closure of the graph, but only for paths starting from a specified source node. ```APIDOC ## transitiveClosureFrom ### Description Computes the transitive closure of this graph, with all paths starting from the given source node. Note that the transitive closure is the smallest graph that contains the entire input graph and is also transitive. This means that binding the source node effectively means we are computing all that nodes that are reachable from the bound source node within the graph using only edges that were originally present in the graph. ### Method public ResultGraph transitiveClosureFrom(int boundSource) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **boundSource** (int) - Required - The bound source node all returned paths have to start at. ### Request Example ```json { "boundSource": 1 } ``` ### Response #### Success Response (200) - **ResultGraph** - A new graph representing the transitive closure of this result graph, where all paths start at the given source node. #### Response Example ```json { "resultGraph": { /* ResultGraph object */ } } ``` ```