0

I have an Atlas Type Definition that has an attribute of another Type Definition. I can create Entities but once the Entity is created, if I added the Entity Attribute to the Entity, I cannot edit or delete the Entity.

Example TypeDefs:

{
  "entityDefs": [
    {
      "category": "ENTITY",
      "name": "mydef_book",
      "description": "An Entity representing a Book",
      "attributeDefs": [
        {
          "name": "id",
          "typeName": "string",
          "isOptional": false,
          "cardinality": "SINGLE",
          "valuesMinCount": 1,
          "valuesMaxCount": 1,
          "isUnique": true,
          "isIndexable": true,
          "includeInNotification": false,
          "searchWeight": -1
        },
        {
          "name": "book.name",
          "typeName": "string",
          "isOptional": false,
          "cardinality": "SINGLE",
          "valuesMinCount": 1,
          "valuesMaxCount": 1,
          "isUnique": false,
          "isIndexable": true,
          "includeInNotification": false,
          "searchWeight": -1
        },
        {
          "name": "book.author",
          "typeName": "mydef_author",
          "isOptional": true,
          "cardinality": "SINGLE",
          "valuesMinCount": 0,
          "valuesMaxCount": 1,
          "isUnique": false,
          "isIndexable": false,
          "includeInNotification": false,
          "searchWeight": -1
        }
      ],
      "superTypes": ["DataSet"]
    },
    {
      "category": "ENTITY",
      "name": "mydef_author",
      "description": "An Entity representing an author",
      "attributeDefs": [
        {
          "name": "id",
          "typeName": "string",
          "isOptional": false,
          "cardinality": "SINGLE",
          "valuesMinCount": 1,
          "valuesMaxCount": 1,
          "isUnique": true,
          "isIndexable": true,
          "includeInNotification": false,
          "searchWeight": -1
        },
        {
          "name": "author.fname",
          "typeName": "string",
          "isOptional": false,
          "cardinality": "SINGLE",
          "valuesMinCount": 1,
          "valuesMaxCount": 1,
          "isUnique": false,
          "isIndexable": true,
          "includeInNotification": false,
          "searchWeight": -1
        },
        {
          "name": "author.lname",
          "typeName": "string",
          "isOptional": false,
          "cardinality": "SINGLE",
          "valuesMinCount": 1,
          "valuesMaxCount": 1,
          "isUnique": false,
          "isIndexable": true,
          "includeInNotification": false,
          "searchWeight": -1
        }
      ],
      "superTypes": ["DataSet"]
    }   
  ]
} 

I can create Author Entity like this:

{
    "entities":[
        {
                "typeName": "mydef_author",
                "attributes": {
                    "id": "fd38e7c8-7255-4c0b-a531-7f3eb13c21bc",
                    "name": "Mike_Myers",
                    "qualifiedName": "Mike_Myers@mydef_author",
                    "author.fname": "Mike",
                    "author.lname": "Myers"
                }
            }
    ] 
}

With the Atlas GUID created when Author is created, I then create the Book entity:

{
    "entities":[       
             {
                "typeName": "mydef_book",
                "attributes": {
                    "id": "1a052051-4791-4a28-894c-be9fea5fab2b",
                    "name": "Halloween",
                    "qualifiedName": "Halloween@mydef_book",
                    "book.name": "Halloween",
                    "book.author": {
                        "guid":  "ATLAS_GUID_FROM_AUTHOR"                     
                    }
                }
            }
    ] 
}

Now, if I try to delete the Book Entity I created, using the Atlas ID of the Book Entity:

Delete: http://localhost:21000/api/atlas/v2/entity/guid/63739d9e-a83c-4f11-9c6f-31a9ffdeab0e

I get an error that says:

{
    "errorCode": "ATLAS-404-00-001",
    "errorMessage": "Given typename book was invalid"
}

This also happens if I try to Update the Book Entity. If I don't include the Author Entity in the Book Entity creation, I can delete/edit just fine. So, how do I Edit/Delete the Entity?

Olaf Kock
  • 46,930
  • 8
  • 59
  • 90
jason
  • 3,821
  • 10
  • 63
  • 120

0 Answers0