To create a new comment on a resource, you must POST a comment XML document.

The XML document is namespace aware, and uses the default namespace http://jazz.net/xmlns/rmps/comments/1.0/. The other namespaces used are rdf and dcterms. The root element is Comment. The following are the child elements.

ElementDescription
dc:titleThe title, or subject of the comment in plain text. Required.
target-resourceThe reference to the model element this is a comment for. The URI is the rdf:resource attribute of the element. Required.
target-revisionThe stream URI (version) of the resource that this is a comment on. Required.
in-reply-toIf this is a reply to another comment this element's rdf:resource attribute holds the URI of the comment this is a reply to.
target-rangeNot used. (should be removed)
contentOne of the contents of this comment. Content can be plain text or a svg resource that is overlayed on diagram resources. This element must have the rdf:parseType value of "Resource". There are two child elements expected; <dc:format> with a value of text/plain or image/svg+xml, and <body> whose text content is either the text of the comment or the SVG of the graphical overlay. The SVG content should be properly encoded to parse properly (see example).

Request:

POST https://rory:9444/dm/comments
<?xml version="1.0" encoding="UTF-8"?>
<comment xmlns="http://jazz.net/xmlns/rmps/comments/1.0/"
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/terms/"
	xmlns:rmps="https://www.ibm.com/rmps" rdf:about="">
	<dc:title>RE: a comment</dc:title>
	<target-resource rdf:resource="https://rory:9444/dm/models/22" />
	<target-revision>https://rory:9444/dm/streams/7</target-revision>
	<in-reply-to rdf:resource="https://rory:9444/dm/comments/_OTBjEMRsEeGtE_hscTgR5g" />
	<target-range rdf:parseType="Literal">
	</target-range>
	<content rdf:parseType="Resource">
		<dc:format>text/plain</dc:format>
		<body>This is a sample comment response</body>
	</content>
	<content rdf:parseType="Resource">
		<dc:format>image/svg+xml</dc:format>
		<body>&lt;?xml version='1.0'?&gt;&lt;svg
			xmlns=&quot;http://www.w3.org/2000/svg&quot; width='87' height='50'
			viewBox='201.88333129882812 112.63333129882812 87 50'&gt;&lt;g
			transform = &quot;translate(0,0)&quot;&gt;&lt;g&gt;&lt;rect
			x='206.88333129882812' y='117.63333129882812' width='77' height='40'
			style='stroke-width:2;stroke:#DC143C;stroke-opacity:1;fill:#FFFFFF;fill-opacity:0;stroke-dasharray:none'/&gt;&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;
		</body>
	</content>
</comment>

Response:

201 Created
ETag: "_hEE1AcRxEeGNdK5r7R1T8w"
Location: https://rory:9444/dm/comments/_hDNSUMRxEeGNdK5r7R1T8w