Maximo Integration

 View Only
  • 1.  OSLC JSON Rest oslc.select question for Panda DataFrames

    Posted Sat April 23, 2022 07:21 AM
    Hello,

    I am working on a project in which we are using Python Panda DataFrames,

    I am doing a simple HTTP Get using location object structure e.g.

    <host>maximo/api/os/lbl_ds_locations?lean=1&oslc.select=location,lo1,parent,description,disabled,lo4,lo5,lo6,lo14,lbl_structure_type,lbl_structure_detail,lbl_changedate&oslc.where=gisparam1="B"

    The json payload contains the desired results. However it does not display the data in the same order as I specified in "oslc.select".  For example it shows something like :

    "member": [
            {
                "lo4""H",
                "parent""H",
                "_rowstamp""1861359227",
                "lbl_structure_type""O",
                "lo6""4",
                "lo5""H",
                "lochierarchy_collectionref""https://maximofac.dev.lbl.gov/maximo/api/os/lbl_ds_locations/_MDYyRi9GQUM-/lochierloconly",
                "description""Storage container",
                "disabled"false,
                "location""062F",
                "href""https://maximofac.dev.lbl.gov/maximo/api/os/lbl_ds_locations/_XXXXXXX",
                "lo1""062F"
            },
       
    1) Is there any argument that will render the results in the same order as I specified in "oslc.select" For example, location,lo1,parent,description,... and so on

    2) Is it possible to suppress   "lochierarchy_collectionref" element? 









    ------------------------------
    Pankaj Bhide
    Computer Systems Engineer
    Berkeley National Laboratory
    Berkeley CA
    ------------------------------


  • 2.  RE: OSLC JSON Rest oslc.select question for Panda DataFrames

    Posted Mon April 25, 2022 11:38 AM
    I don't think we provide a way to control the order of the attributes. Normally position isn't important in JSON. Is it needed for DataFrame? If so that would potentially be worth requesting.

    As for the second, add a query parameter of ignorecollectionref=1. That will suppress those from appearing in the body. If you want to suppress the href and/or rowstamp then add the ignorekeyref=1 & ignorers=1 query parameters. Those will remove those from the payload as well.

    ------------------------------
    Steven Shull
    ------------------------------



  • 3.  RE: OSLC JSON Rest oslc.select question for Panda DataFrames

    Posted Mon April 25, 2022 12:23 PM
    Fantastic and thanks Steve. The param  ignorers=1  will help us. The issue was the "merge" command of the pandas dataframe was creating unnecessary extra columns which we had to get rid of. As you said, the ordering of columns is not an issue when we serialize the dataframe using json. 





  • 4.  RE: OSLC JSON Rest oslc.select question for Panda DataFrames

    Posted Mon April 25, 2022 08:46 PM
    Hello Steve,

    Sorry to bother you. The ignorecollectionref worked. However suppressing rowstamp with ignorers=1 is not working. Any clue?

    image.png





  • 5.  RE: OSLC JSON Rest oslc.select question for Panda DataFrames

    Posted Tue April 26, 2022 08:16 AM
    It looks like you did it correctly. My guess is you're on 7.6.1.1 because we added this after 7.6.1.1 was released and changes like this typically are not something that gets put into an IFIX. If you're on 7.6.1.2 and seeing issues let me know.

    ------------------------------
    Steven Shull
    ------------------------------



  • 6.  RE: OSLC JSON Rest oslc.select question for Panda DataFrames

    Posted Tue April 26, 2022 08:26 AM
    Yes, we just applied the latest ifix-19 on 7.6.1.1. So we need to wait until 7.6.1.2..... Thanks again.