- URL:
- https://<kgserver_replicas>/create
- Methods:
POST- Version Introduced:
- 12.1
Description
The create operation creates a replica definition based on a knowledge graph service. The operation returns a replica that clients can download and persist in a local database. The sync feature must be enabled in order to execute the create operation. The owner of the knowledge graph service and administrators of the ArcGIS Enterprise organization can enable the sync feature by using the update operation.
Any user can create a replica of a knowledge graph service. However, the portal user type, in combination with the capabilities of the knowledge graph service, determine the types of replicas that can be created. The following table provides the various combinations of portal user type and knowledge graph service capabilities, and the resulting replicas that can be created.
| Service Capability | Portal User Type | Replica SyncDirection Types |
|---|---|---|
|
|
|
|
|
|
|
|
|
The difference between the replicas created by different user types allows owners and administrators to sync edits and manage data while providing read-only access to other users. Owners of a knowledge graph service and administrative clients can create a replica of a knowledge graph service regardless of the knowledge graph service capabilities. The user who executes the create operation is assigned ownership of the replica. Users can view, synchronize and unregister replicas they own.
Request parameters
| Parameter | Details |
|---|---|
(Optional) | The name of the replica on the server. The replica name is unique per knowledge graph service. If not specified, a replica name will be assigned and returned in the |
(Optional) | The replica_id is a unique identifier for the replica. If not specified, a new replica_id will be generated. |
(Required) | Defines how a new replica will be created. The values: |
(Required) | Defines the direction of synchronization of edits allowed for the replica. The If the knowledge graph service does not have the value: |
(Required) | The format of the replica data returned in the response. The only supported format is |
(Optional) | If true, the request is processed as an asynchronous job, and a URL is returned that a client can visit to check the status of the job. The default is Values: |
| The response format. The default format is Values: |
Example usage
The following is a sample request URL used to access the create operation for a knowledge graph service named Field:
https
The below example POST parameters use the replica to specify the entity and relationship types that will be added to the replica.
{
"createReplicaRequest": {
"replicaFilters": {
"staticDefinition": {
"entityTypes": [
{
"entityTypeReplicaDefinition": {
"typeName": "Person"
}
},
{
"entityTypeReplicaDefinition": {
"typeName": "Company"
}
}
],
"relationshipTypes": [
{
"relationshipTypeReplicaDefinition": {
"typeName": "WORKS_AT"
}
}
]
}
},
"syncDirection": "BIDIRECTIONAL",
"dataFormat": "PBF"
}
}Example Response syntax
{"createReplicaResult": {
"replicaDataUrl": <url>
"replicaId": <bytes>,
"syncDate": <int64>, // milliseconds since epoch
"replicaName": <string>,
"syncDirection": BIDIRECTIONAL | UPLOAD | DOWNLOAD
"replicaDataFormat": PBF
}
}Example Response example
{"createReplicaResult": {
"replicaDataUrl": "https://organization.example.com/<context>/rest/directories/arcgisoutput/Hosted/FieldService_KnowledgeGraphServer/_ags_kgs_151bced0-903e-4c56-a8ea-a7d5171d1457.zip",
"replicaId": {5481F8D0-E519-46D8-9227-EEBEB551FE6E},
"syncDate": 1775078735036,
"replicaName": "KGS_33299f84-713e-4634-968d-a9174e1f02c2",
"syncDirection": BIDIRECTIONAL
"replicaDataFormat": PBF
}
}Requests and responses
This operation can be performed by sending a PBF-formatted request and receiving a PBF-formatted response. The status of the operation can be queried using a PBF-formatted request. Details of the request and response parameters are provided in the appropriate .proto files.
PBF Request
Create a PBF-formatted request to perform this operation based on the Create file.
PBF Response
When executing this operation asynchronously, create a PBF-formatted response to query the status of the operation based on the Async file.
Once the operation is complete, download the replica using the replica in the PBF-formatted response based on the Create file.