Removing an OSLC link is very similar to creating one. You simply PUT back the resource representation without the OSLC link triples. First get the resource representation, and ETag for the resource. Then remove the link triples. It is good form to remove all the reified statement triples as well, however DM will effectively remove the link if you just remove the main triple whose subject is the resource URI (e.g. not the link description).
This example removes the link created in another example
.
Request:
Headers
GET https://example.com:9435/dm/models/30 HTTP/1.1
Accept: application/rdf+xml
OSLC-Core-Version: 2.0
Response:
Headers
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
ETag: 709f7c0b529f51d93d19872004cfddb9
Location: https://example.com:9435/dm/models/30
OSLC-Core-Version: 2.0
Last-Modified: Thu, 27 Sep 2012 13:39:46 GMT
Content-Type: application/rdf+xml
Content-Length: 3564
Date: Thu, 27 Sep 2012 13:39:45 GMT
<?xml version="1.0" encoding="UTF-8"?> <rdf:RDF xmlns:acp="http://jazz.net/ns/acp#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dmcore="http://jazz.net/ns/dm/core#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:j.0="http://jazz.net/xmlns/rmps/index/1.0/" xmlns:j.1="http://jazz.net/ns/dm/diagram#" xmlns:j.2="http://jazz.net/ns/dm/linktypes#" xmlns:jfs="http://jazz.net/xmlns/foundation/1.0/" xmlns:oslc="http://open-services.net/ns/core#" xmlns:oslc_am="http://open-services.net/ns/am#" xmlns:oslc_rm2="http://open-services.net/ns/rm#Requirement" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:rsa_uml="http://jazz.net/ns/dm/rsa/uml#"> <rdf:Description rdf:nodeID="A0"> <rdf:subject rdf:resource="https://example.com:9435/dm/models/30"/> <rdf:predicate rdf:resource="http://jazz.net/ns/dm/linktypes#derives"/> <rdf:object rdf:resource="https://example.com:9435/rm/resources/_I1rUwfddEeGawIUDtsNoKw"/> <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement"/> <dcterms:description>Mandatory set of requirements.</dcterms:description> </rdf:Description> <rdf:Description rdf:about="https://example.com:9435/dm/models/30"> <rdf:type rdf:resource="http://jazz.net/ns/dm/diagram#Diagram"/> <oslc:serviceProvider rdf:resource="https://example.com:9435/dm/oslc_am/_ATqQYvddEeGIbrXzZZZ7PA"/> <j.2:derives rdf:resource="https://example.com:9435/rm/resources/_I1rUwfddEeGawIUDtsNoKw"/> <acp:accessControl rdf:resource="https://example.com:9435/dm/acp/project/_ATqQYvddEeGIbrXzZZZ7PA"/> <dcterms:title>JKE Overview</dcterms:title> <dcterms:identifier>30</dcterms:identifier> <dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2012-09-05T13:33:32.810Z</dcterms:created> <dcterms:contributor rdf:resource="https://example.com:9435/jts/users/dm_user"/> <dcterms:creator rdf:resource="https://example.com:9435/jts/users/dm_user"/> <j.2:elaborates rdf:resource="https://example.com:9435/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/79"/> <dcterms:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2012-09-05T13:33:51.013Z</dcterms:modified> <rdf:type rdf:resource="http://open-services.net/ns/am#Resource"/> <j.2:derives rdf:resource="https://example.com:9435/rm/resources/_J_-kuvddEeGawIUDtsNoKw"/> </rdf:Description> <rdf:Description rdf:nodeID="A1"> <rdf:subject rdf:resource="https://example.com:9435/dm/models/30"/> <rdf:predicate rdf:resource="http://jazz.net/ns/dm/linktypes#derives"/> <rdf:object rdf:resource="https://example.com:9435/rm/resources/_J_-kuvddEeGawIUDtsNoKw"/> <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement"/> <dcterms:description>Additional requirements, prioritized.</dcterms:description> </rdf:Description> <rdf:Description rdf:nodeID="A2"> <rdf:subject rdf:resource="https://example.com:9435/dm/models/30"/> <rdf:predicate rdf:resource="http://jazz.net/ns/dm/linktypes#elaborates"/> <rdf:object rdf:resource="https://example.com:9435/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/79"/> <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement"/> <dcterms:description>A sample description on a link.</dcterms:description> </rdf:Description> </rdf:RDF>
The ETag value is passed in with the If-Match header, and the body does not contain any of the triples that contribute to the link. The service provider responds with a 200 OK if the update was successful.
Request:
Headers
PUT https://example.com:9435/dm/models/30 HTTP/1.1
Accept: application/rdf+xml
OSLC-Core-Version: 2.0
If-Match: 709f7c0b529f51d93d19872004cfddb9
<?xml version="1.0" encoding="UTF-8"?> <rdf:RDF xmlns:acp="http://jazz.net/ns/acp#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dmcore="http://jazz.net/ns/dm/core#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:j.0="http://jazz.net/xmlns/rmps/index/1.0/" xmlns:j.1="http://jazz.net/ns/dm/diagram#" xmlns:j.2="http://jazz.net/ns/dm/linktypes#" xmlns:jfs="http://jazz.net/xmlns/foundation/1.0/" xmlns:oslc="http://open-services.net/ns/core#" xmlns:oslc_am="http://open-services.net/ns/am#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:rsa_uml="http://jazz.net/ns/dm/rsa/uml#"> <rdf:Description rdf:nodeID="A0"> <rdf:subject rdf:resource="https://example.com:9435/dm/models/30"/> <rdf:predicate rdf:resource="http://jazz.net/ns/dm/linktypes#derives"/> <rdf:object rdf:resource="https://example.com:9435/rm/resources/_I1rUwfddEeGawIUDtsNoKw"/> <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement"/> <dcterms:description>Mandatory set of requirements.</dcterms:description> </rdf:Description> <rdf:Description rdf:nodeID="A1"> <rdf:subject rdf:resource="https://example.com:9435/dm/models/30"/> <rdf:predicate rdf:resource="http://jazz.net/ns/dm/linktypes#derives"/> <rdf:object rdf:resource="https://example.com:9435/rm/resources/_J_-kuvddEeGawIUDtsNoKw"/> <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement"/> <dcterms:description>Additional requirements, prioritized.</dcterms:description> </rdf:Description> <rdf:Description rdf:about="https://example.com:9435/dm/models/30"> <rdf:type rdf:resource="http://jazz.net/ns/dm/diagram#Diagram"/> <oslc:serviceProvider rdf:resource="https://example.com:9435/dm/oslc_am/_ATqQYvddEeGIbrXzZZZ7PA"/> <j.2:derives rdf:resource="https://example.com:9435/rm/resources/_I1rUwfddEeGawIUDtsNoKw"/> <acp:accessControl rdf:resource="https://example.com:9435/dm/acp/project/_ATqQYvddEeGIbrXzZZZ7PA"/> <dcterms:title>JKE Overview</dcterms:title> <dcterms:identifier>30</dcterms:identifier> <dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2012-09-05T13:33:32.810Z</dcterms:created> <dcterms:contributor rdf:resource="https://example.com:9435/jts/users/dm_user"/> <dcterms:creator rdf:resource="https://example.com:9435/jts/users/dm_user"/> <dcterms:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2012-09-05T13:33:51.013Z</dcterms:modified> <rdf:type rdf:resource="http://open-services.net/ns/am#Resource"/> <j.2:derives rdf:resource="https://example.com:9435/rm/resources/_J_-kuvddEeGawIUDtsNoKw"/> </rdf:Description> </rdf:RDF>Response:
Headers
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
ETag: cb2a8a1627e745fa978f92d8e5f936ff
OSLC-Core-Version: 2.0
Content-Length: 0
Date: Thu, 27 Sep 2012 13:39:52 GMT