1
PCS Suggestions and Requests / Re: Change the parent of a resource via PCS OSLC
« on: June 27, 2023, 03:28:46 pm »
I tried the following to post to `<protocol>://<server>/<model_name>/oslc/am/pu/resource/`
```xml
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:oslc_am="http://open-services.net/ns/am#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:ss="http://www.sparxsystems.com.au/oslc_am#">
<oslc_am:Resource>
<!--Required Property-->
<dcterms:identifier>el_{5FE6EEBA-20C4-4fae-804E-6076C72C7D32}</dcterms:identifier>
<ss:useridentifier>{C3EE2FC5-D661-4886-BA90-E805B41C521C}</ss:useridentifier>
<!--Updateable Properties-->
<ss:parentresourceidentifier>pk_{9A699728-DB95-4126-A142-DE084597EE82}</ss:parentresourceidentifier>
</oslc_am:Resource>
</rdf:RDF>
```
but got 400 response:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:oslc="http://open-services.net/ns/core#">
<oslc:Error>
<oslc:statusCode>400</oslc:statusCode>
<oslc:message>Invalid property 'ss:parentresourceidentifier'</oslc:message>
</oslc:Error>
</rdf:RDF>
```
Other updateable properties such as `dcterms:title` can be updated as expected.
Is there a workaround for changing the parent?
```xml
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:oslc_am="http://open-services.net/ns/am#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:ss="http://www.sparxsystems.com.au/oslc_am#">
<oslc_am:Resource>
<!--Required Property-->
<dcterms:identifier>el_{5FE6EEBA-20C4-4fae-804E-6076C72C7D32}</dcterms:identifier>
<ss:useridentifier>{C3EE2FC5-D661-4886-BA90-E805B41C521C}</ss:useridentifier>
<!--Updateable Properties-->
<ss:parentresourceidentifier>pk_{9A699728-DB95-4126-A142-DE084597EE82}</ss:parentresourceidentifier>
</oslc_am:Resource>
</rdf:RDF>
```
but got 400 response:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:oslc="http://open-services.net/ns/core#">
<oslc:Error>
<oslc:statusCode>400</oslc:statusCode>
<oslc:message>Invalid property 'ss:parentresourceidentifier'</oslc:message>
</oslc:Error>
</rdf:RDF>
```
Other updateable properties such as `dcterms:title` can be updated as expected.
Is there a workaround for changing the parent?