Class DataCatalogRunner

java.lang.Object
neqsim.mcp.runners.DataCatalogRunner

public final class DataCatalogRunner extends Object
Read-only data catalog runner that exposes NeqSim databases as browsable resources.

Provides structured access to the component database, design standards tables, thermodynamic property data, and material properties without running simulations. Agents can discover available data before deciding what tools to invoke.

Version:
1.0
Author:
Even Solbraa
  • Field Details

    • GSON

      private static final com.google.gson.Gson GSON
  • Constructor Details

    • DataCatalogRunner

      private DataCatalogRunner()
      Private constructor — all methods are static.
  • Method Details

    • run

      public static String run(String json)
      Main entry point for data catalog operations.
      Parameters:
      json - JSON with action and parameters
      Returns:
      JSON with results
    • listComponentFamilies

      public static String listComponentFamilies()
      Lists all available component families (categories) in the component database.
      Returns:
      JSON with component families and count
    • getComponentProperties

      public static String getComponentProperties(String componentName)
      Gets full thermodynamic properties for a component from the database.
      Parameters:
      componentName - the component name
      Returns:
      JSON with all available properties
    • listDesignStandards

      public static String listDesignStandards()
      Lists all available design standards in the standards index.
      Returns:
      JSON with all standards, their scope, and data file references
    • queryStandard

      public static String queryStandard(String standardCode, String equipmentType)
      Queries a specific standards table for parameters applicable to an equipment type.
      Parameters:
      standardCode - the standard code (e.g., "ASME-VIII-Div1")
      equipmentType - the equipment type to filter by (optional)
      Returns:
      JSON with standard parameters
    • listMaterials

      public static String listMaterials(String materialType)
      Lists available material properties (pipe materials, plate materials, casing, etc.).
      Parameters:
      materialType - the material category: pipe, plate, casing, compressor, heatExchanger
      Returns:
      JSON with material grades and their properties
    • listEOSModels

      public static String listEOSModels()
      Lists all available equation of state models with descriptions and applicability.
      Returns:
      JSON with EOS models catalog
    • listDataTables

      public static String listDataTables()
      Lists available data tables in both thermodynamic and design databases.
      Returns:
      JSON with table names and descriptions
    • mapStandardToTable

      private static String mapStandardToTable(String standardCode)
      Maps a standard code prefix to a database table name.
      Parameters:
      standardCode - the standard code
      Returns:
      the table name, or null if unknown
    • sanitize

      private static String sanitize(String input)
      Sanitizes a string for safe SQL use (basic defense against injection).
      Parameters:
      input - the input string
      Returns:
      sanitized string
    • addEOS

      private static void addEOS(com.google.gson.JsonArray models, String code, String fullName, String description, String applicability, String year)
      Adds an EOS model entry to the models array.
      Parameters:
      models - the array to add to
      code - the short code
      fullName - the full name
      description - the description
      applicability - when to use this model
      year - the year introduced
    • addTable

      private static void addTable(com.google.gson.JsonArray tables, String name, String description)
      Adds a table description entry.
      Parameters:
      tables - the array to add to
      name - the table name
      description - the description