High Availability Questions

Hello @markmegerian can you please guide me on these

  1. I have a Model vertex and I set a attribute name params in Model Vertex and there type is MAP key contains string and value also contains string

    model_id: "1"
    model_name: "Merchandise Promotion & Recommendation"
    params: {“marketing factor”: “high”, “merchandising factor”: “True”, inventory count: “0”}

    1st priority: I want to set up the values of Mixture of Int and string
                   params: {"marketing factor": "high", "merchandising factor": "True", inventory count: 
                  0}
               In this Inventory count i want to pass in INT format and all remaining are in string.
    
    2nd priority I want to give the values in this style:  
               params: [
                           {
                              "marketing factor": "high",
                              "htmlType": "textBox",
                              "dropDownItems":  [{
                                       "label": "Total Spend",
                                       "value": "total_spend"
                                  },
                                  {
                                       "label": "Total Customers",
                                       "value": "total_customers"
                                  }
                                  ] 
                           }]
    
  2. I am doing like this in my GSQL
    CREATE QUERY runmodel(STRING modelName) FOR GRAPH clientA_analytics {
    start = {Model.*}
    get_last_id = select s from start:s ORDER BY s.model_id DESC LIMIT 1
    new_id = get_last_id + 1
    INSERT INTO Model (PRIMARY_ID, model_name)
    VALUES (new_id, modelName)

    How can we make new object with an (auto increment ID unique reference)
    in this GSQL ?

  3. I already created INTERPRETED query in backend , when I want to moderate the conditions (add or remove) on a certain criteria of my Front end application, when Front end trigger the API , I created or Add or remove the conditions according to the user chose the criteria, for this way interpret query is better works
    and 2nd terminology we have to create the Query in the TigerGraph Studio and call in our backend in this way
    tiger.call_installed_query(“test_checks”, {})

    is there anykind of performance issue if we are following the 2nd terminology way
    I mean if we run the query in interpret mode from our backend is this will take a lesser time as compare to tiger.call_installed_query(“test_checks”, {}) in backend or vice versa?

I noticed that these are all getting created as Uncategorized. I added the category of GSQL so that you will have a better chance of having people see this in the GSQL forum.

1 Like

Many thanks! @markmegerian

@pkr2 As to your very first question - you can choose a STRING attribute, and for the times where it must be an INT, use the built in functions to_string( ) and str_to_int( ) to go both directions for conversions. I do this all the time. If you want to always enforce strong typing, then one alternative is to have something like 2 attributes, valueText of type STRING and valueInt of type INT and just populate either one based on the parameter.

1 Like