You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by "Pinal Shah (Jira)" <ji...@apache.org> on 2022/02/25 09:39:00 UTC

[jira] [Commented] (ATLAS-4557) Dsl search with non-primitive attribute

    [ https://issues.apache.org/jira/browse/ATLAS-4557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17498010#comment-17498010 ] 

Pinal Shah commented on ATLAS-4557:
-----------------------------------

Please use below typeDef for your usecase.
{code:java}
{
    "enumDefs": [{
        "name": "Role",
        "elementDefs": [{
                "ordinal": 1,
                "value": "ROLE1"
            },
            {
                "ordinal": 2,
                "value": "ROLE2"
            }
        ]
    }],
    "structDefs": [],
    "classificationDefs": [],
    "entityDefs": [{
            "name": "Contact",
            "description": "Contact test. ",
            "superTypes": [
                "Referenceable"
            ],
            "serviceType": "workflow",
            "typeVersion": "1.0",
            "attributeDefs": [{
                    "name": "name",
                    "typeName": "string",
                    "cardinality": "SINGLE",
                    "isIndexable": true,
                    "isOptional": true,
                    "isUnique": false
                },
                {
                    "name": "role",
                    "typeName": "Role",
                    "cardinality": "SINGLE",
                    "isIndexable": false,
                    "isOptional": true,
                    "isUnique": false
                }
            ]
        },
        {
            "name": "Organization",
            "description": "organization ",
            "superTypes": [
                "Referenceable"
            ],
            "serviceType": "workflow",
            "typeVersion": "1.0",
            "attributeDefs": [{
                    "name": "organizationCode",
                    "typeName": "string",
                    "cardinality": "SINGLE",
                    "isIndexable": true,
                    "isOptional": false,
                    "isUnique": false
                },
                {
                    "name": "organizationName",
                    "typeName": "string",
                    "cardinality": "SINGLE",
                    "isIndexable": true,
                    "isOptional": false,
                    "isUnique": false
                }
            ]
        }
    ],
    "relationshipDefs": [{
        "name": "organization_contacts",
        "relationshipCategory": "AGGREGATION",
        "propagateTags": "NONE",
        "endDef1": {
            "type": "Organization",
            "name": "contacts",
            "isContainer": true,
            "cardinality": "SET",
            "isLegacyAttribute": false
        },
        "endDef2": {
            "type": "Contact",
            "name": "organization",
            "isContainer": false,
            "cardinality": "SINGLE",
            "isLegacyAttribute": false
        }
    }]
} {code}

> Dsl search with non-primitive attribute
> ---------------------------------------
>
>                 Key: ATLAS-4557
>                 URL: https://issues.apache.org/jira/browse/ATLAS-4557
>             Project: Atlas
>          Issue Type: Wish
>          Components: atlas-webui
>    Affects Versions: 2.2.0
>            Reporter: Hatice Ekenek
>            Priority: Critical
>
> Hi,
> I have the following types.
> I want to list the contacts by filtering them according to the organization property. But I can't find the right method to do this. I would be glad if you help.
> dsl query example:
> Contact  where  organization.__guid = "d44532ea-c6fc-417b-8c59-f988777dd51f"
>  
> Example entity types:
> Contact Entity:
> {
>             "name": "Contact",
>             "description": "Contact test. ",
>             "superTypes": [
>                 "Referenceable"
>             ],
>             "serviceType": "workflow",
>             "typeVersion": "1.0",
>             "attributeDefs": [
>                 {
>                     "name": "name",
>                     "typeName": "string",
>                     "cardinality": "SINGLE",
>                     "isIndexable": true,
>                     "isOptional": true,
>                     "isUnique": false
>                 },
>                 {
>                     "name": "organization",
>                     "typeName": "Organization",
>                     "cardinality": "SINGLE",
>                     "isIndexable": false,
>                     "isOptional": false,
>                     "isUnique": false
>                 },
>                 {
>                     "name": "role",
>                     "typeName": "Role",
>                     "cardinality": "SINGLE",
>                     "isIndexable": false,
>                     "isOptional": true,
>                     "isUnique": false
>                 }
>             ]
>         }
>  
> Organization Entity Type:
>  
> {
>             "name": "Organization",
>             "description": "organization ",
>             "superTypes": [
>                 "Referenceable"
>             ],
>             "serviceType": "workflow",
>             "typeVersion": "1.0",
>             "attributeDefs": [
>                 {
>                     "name": "organizationCode",
>                     "typeName": "string",
>                     "cardinality": "SINGLE",
>                     "isIndexable": true,
>                     "isOptional": false,
>                     "isUnique": false
>                 },
>                 {
>                     "name": "organizationName",
>                     "typeName": "string",
>                     "cardinality": "SINGLE",
>                     "isIndexable": true,
>                     "isOptional": false,
>                     "isUnique": false
>                 }
>             ]
>         }



--
This message was sent by Atlassian Jira
(v8.20.1#820001)