Duplicate Entity Keys ===================== .. code-block:: http /api/repositories/{repository}/entities/{entity}/keys/:keyID/duplicates .. csv-table:: :header: Parameter, Type, Purpose :widths: 20, 20, 60 :stub-columns: 1 repository, string, the name of the :doc:`repository` entity, int, The ID of the entity to view keyID, string, The ID for the key Show All ~~~~~~~~~ .. http:get:: /api/repositories/(string:repository)/entities/(int:entityID)/keys/(string:keyID)/duplicates :synopsis: Lists duplicate values in the corresponding key of an entity Lists duplicate values in the corresponding key of an :doc:`entity` .. code-block:: http GET /api/repositories/jupiter/entities/1/keys/1_17/duplicates HTTP/1.1 Accept: application/json .. csv-table:: :header: Response Code, Reason :widths: 25, 75 200, No error 500, Server error The response will be a :doc:`standard-response`, with a list of duplicate values in the corresponding key of the :doc:`entity`. The ``columns`` array will contain the list of columns for each data row. .. csv-table:: :header: Human Name, Column Name, Description :widths: 25, 25, 50 "Duplicate Rows", "contradiction.COUNT", "Number of rows with this value" "Key", "Key", "Key Attribute Value" data row will contain the list of discovered duplicate keys of the corresponding :doc:`entity`: .. code-block:: json "rows": [ { "dataRow": [ "3", "333" ] }, { "dataRow": [ "2", "111" ] } ] } If there are no duplicate values for the corresponding key in the :doc:`entity`, ``rows`` will be an empty string. Show Some ~~~~~~~~~~ .. http:post:: /api/repositories/(string:repository)/entities/(int:entityID)/keys/(string:keyID)/duplicates :synopsis: Lists duplicate values in the corresponding key of an entity Lists duplicate values in the corresponding key of an :doc:`entity` that match various criteria .. code-block:: http POST /api/repositories/jupiter/entities/1/keys/1_17/duplicates HTTP/1.1 Accept: application/json { "command": "get", "options": { "pageSize": "2", "pageStart": "1" } } .. csv-table:: :header: Response Code, Reason :widths: 25, 75 200, No error 400, Invalid command or option 500, Server error The request requires a :doc:`standard-request` packet. Available commands are: The response will be a :doc:`standard-response`, with a list of duplicate keys for the corresponding key of the :doc:`entity`. Export ~~~~~~~ Some or all of the rows may be exported as a scheduled task. .. code-block:: http POST /api/repositories/jupiter/entities/1/keys/1_17/duplicates HTTP/1.1 Content-Type: application/json { "command": "export", "data": { "filename": "filename.csv", "filetype": "csv", "encoding": "utf-8" }, "options": { "where": "'Duplicate Rows' = 1" } } .. csv-table:: :header: Response Code, Reason :widths: 25, 75 200, No error 400, Invalid data passed with request 500, Server error The request packet must contain the ``command`` and ``data`` elements. The ``options`` element is not required, but may specify the columns to export, and/or the rows to filter. The following table shows which fields are required in the ``data`` element: .. csv-table:: :header: Field, Required :widths: 20, 10 filename, Y filetype, N encoding, N If ``filetype`` is not specified, it defaults to csv. If ``encoding`` is not specified, it defaults to the server native encoding. The response will contain the URL of the scheduled task and the link to download the exported file. .. code-block:: json { "job": "/api/repositories/jupiter/scheduler/1", "file": "/api/repositories/jupiter/download/filename.csv" }