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"]} |
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:[email protected]> ;
vcard:EMAIL <mailto:[email protected]> ]
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 |
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:[email protected]> ;
vcard:EMAIL <mailto:[email protected]> ]
Quads:
@prefix vcard: <http://www.w3.org/2006/vcard/ns#> .
<http://example.org/Individuals/JohnSmith>
<cmwell://meta/sys#markDelete> [
vcard:EMAIL <mailto:[email protected]> <http://mySubGraph>;
vcard:EMAIL <mailto:[email protected]> <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.