Go to: Root TOC Topic TOC Previous Topic Next Topic
In some cases, an infoton may have several values for the same field name. For example, a Person infoton might have several Telephone or Email field values.
Using the #markReplace operator to delete a field will delete all of its values.
If you only want to delete a subset of a field's multiple values, while retaining the other values, there are two ways to do this:
- Use the JSON format to define values to delete.
- Use the special #markDelete indicator.
Both methods are described in the following sections.
URL: / REST verb: POST Mandatory parameters: data
Template:
curl -X POST <cm-well-host>/<cm-well-path>?data=<field name and values to delete, in JSON format>
URL example: N/A
Curl example (REST API):
curl -X DELETE '<cm-well-host>/example.org/JohnSmith?data={"name":["John","Johnnie"]}'
| Parameter | Description | Example |
|---|---|---|
| data | The field name and values to delete, in JSON format. Values are comma-separated. | {"name":["John","Johnnie"]} |
| priority | If this flag appears in an update call, that call receives priority relative to non-priority calls. To use this flag, you must also pass the X-CM-WELL-TOKEN request header, with a token that grants access to the priority feature. This feature should be used with discretion so as not to flood the priority queue. | <cm-well-host>/_in?format=ttl&priority... |
curl -X DELETE '<cm-well-host>/example.org/JohnSmith?data={"name":["John","Johnnie"]}'
{"success":true}
URL: /_in REST verb: POST Mandatory parameters: N/A
Template:
curl -X POST <cm-well-host>/_in?format=<format> <infotonURI> <cmwell://meta/sys#markDelete> [ <field name and value pairs> ]
URL example: N/A
Curl example (REST API):
curl -X POST "<cm-well-host>/_in?format=turtle" --data-binary @curlInput.txt
@prefix vcard: <http://www.w3.org/2006/vcard/ns#> .
<http://example.org/Individuals/JohnSmith>
<cmwell://meta/sys#markDelete> [
vcard:EMAIL <mailto:jane.smith@example.org> ;
vcard:EMAIL <mailto:jenny.smith@example.org> ]
| Parameter | Description | Values | Example | Reference |
|---|---|---|---|---|
| format | The format in which the triples are provided | n3, rdfxml, ntriples, nquads, turtle/ttl, trig, trix | format=n3 | CM-Well Input and Output Formats |
| priority | If this flag appears in an update call, that call receives priority relative to non-priority calls. To use this flag, you must also pass the X-CM-WELL-TOKEN request header, with a token that grants access to the priority feature. This feature should be used with discretion so as not to flood the priority queue. | None | <cm-well-host>/_in?format=ttl&priority... | Query Parameters |
curl -X POST "<cm-well-host>/_in?format=turtle" --data-binary @curlInput.txt
Triples:
@prefix vcard: <http://www.w3.org/2006/vcard/ns#> .
<http://example.org/Individuals/JohnSmith>
<cmwell://meta/sys#markDelete> [
vcard:EMAIL <mailto:jane.smith@example.org> ;
vcard:EMAIL <mailto:jenny.smith@example.org> ]
Quads:
@prefix vcard: <http://www.w3.org/2006/vcard/ns#> .
<http://example.org/Individuals/JohnSmith>
<cmwell://meta/sys#markDelete> [
vcard:EMAIL <mailto:jane.smith@example.org> <http://mySubGraph>;
vcard:EMAIL <mailto:jenny.smith@example.org> <http://mySubGraph>]
{"success":true}
- You can delete only values with specific sub-graph labels by providing the label value as the 4th value of a field quad (see Quads example above).
- If you specify a quad format (e.g. format=nquads) but provide triples data, CM-Well infers <*> as the missing quad value, and therefore will delete all specified fields that have any quad value.
- The replace-mode flag and the #markDelete indicator should not be used in the same command. If they are, replace-mode overrides #markDelete.
Delete a Single Infoton Delete Fields Replace Field Values
Go to: Root TOC Topic TOC Previous Topic Next Topic