TRIRIGA

 View Only

How to update a complex/compound OSLC attribute using REST API

  • 1.  How to update a complex/compound OSLC attribute using REST API

    Posted Thu July 06, 2023 11:29 AM

    Hello,

    I am trying to update an array property of an OSLC resource using the REST API; But I have having no luck.  Given the OSLC type below, I can successfully update the literal (first level) attributes, such as dcterms:description & dcterms:title using a PUT.  But how do I update/add a resource to the spi:triAssociatedAssignedPeople array?  A PUT or POST with a newly defined array in the body of the message does not work.

    {
        "prefixes": {
            "spi_wm": "http://jazz.net/ns/ism/smarter_physical_infrastructure/work#",
            "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
            "dcterms": "http://purl.org/dc/terms/",
            "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
            "spi": "http://jazz.net/ns/ism/smarter_physical_infrastructure#",
            "oslc": "http://open-services.net/ns/core#"
        },
        "rdfs:member": [
            {
                "spi:triCurrencyUO": "US Dollars",
                "spi_wm:schedfinish": "2023-06-26T12:49:41.688-07:00",
                "spi:triAssociatedAssignedPeople": [
                    {
                        "rdf:resource": "https://108discovery.ecifmsaas.net/oslc/so/triPersonResourceRS/15364645"
                    }
                ],
                "spi:action": "https://108discovery.ecifmsaas.net/oslc/system/action/triWorkTaskRS/15363683",
                "spi:triTaskTypeCL": "Move",
                "spi_wm:schedstart": "2023-06-26T12:49:41.688-07:00",
                "dcterms:title": "jcWorkTask1",
                "spi_wm:status": "Draft",
                "spi_wm:wopriority": null,
                "rdf:about": "https://108discovery.ecifmsaas.net/oslc/so/triWorkTaskRS/15363683",
                "spi:triCreatedSY": "2023-06-26T12:49:41.688-07:00",
                "dcterms:identifier": "15363683",
                "spi:triUserMessageTX": null,
                "dcterms:description": "Update using PATCH2",
                "spi:triModifiedSY": "2023-07-05T09:56:19.100-07:00",
                "oslc:shortTitle": "1037315"
            }
        ],
        "rdf:type": [
            {
                "rdf:resource": "http://www.w3.org/2000/01/rdf-schema#Container"
            }
        ],
        "rdf:about": "https://108discovery.ecifmsaas.net/oslc/spq"
    }



    ------------------------------
    James Combs
    ------------------------------