blob: 5734e13ef81448089e27b45b58185c6e7f503e31 [file] [log] [blame]
{"version":3,"sources":["/home/madhan/Apache/git/atlas/docs/target/src/documents/Search/SearchRelationship.md","/home/madhan/Apache/git/atlas/docs/target/theme/components/shared/Img/index.js","/home/madhan/Apache/git/atlas/docs/target/theme/styles/styled-colors.js"],"names":["layoutProps","MDXContent","components","props","mdxType","wrapLines","language","style","theme","parentName","src","height","width","isMDXComponent","Img","baseUrl","useConfig","boxShadow","WebkitBoxShadow","MozBoxShadow","dark","hljs","color"],"mappings":"koBAYMA,EAAc,GAIL,SAASC,EAAW,GAG/B,IAFFC,EAAU,EAAVA,WACGC,EAAK,iBAER,OAAO,cALS,UAKC,iBAAKH,EAAiBG,EAAK,CAAED,WAAYA,EAAYE,QAAQ,cAE5E,oBACE,GAAM,uBAAqB,uBAE7B,wJACA,wgBACA,8XACA,6NACA,iJACA,cAAC,IAAiB,CAACC,WAAW,EAAMC,SAAS,OAAOC,MAAOC,IAAYJ,QAAQ,qBAAmB,iTAYlG,uBAAG,wBAAQK,WAAW,KAAG,sBAC5B,cAAC,IAAiB,CAACJ,WAAW,EAAMC,SAAS,OAAOC,MAAOC,IAAYJ,QAAQ,qBAAmB,8pBAW/F,+GACA,uBAAG,wBAAQK,WAAW,KAAG,6CACzB,+EAA4D,oBAAIA,WAAW,KAAG,aAAmB,yCACjG,wBACE,oBAAIA,WAAW,MAAK,oBAAIA,WAAW,MAAI,QAAc,YAAa,oBAAIA,WAAW,MAAI,UACrF,oBAAIA,WAAW,MAAK,oBAAIA,WAAW,MAAI,QAAc,cAAe,oBAAIA,WAAW,MAAI,UACvF,oBAAIA,WAAW,MAAK,oBAAIA,WAAW,MAAI,QAAc,YAAa,oBAAIA,WAAW,MAAI,cACrF,oBAAIA,WAAW,MAAK,oBAAIA,WAAW,MAAI,SAAe,aAAc,oBAAIA,WAAW,MAAI,eAEzF,kFACA,cAAC,IAAG,CAACC,IAAG,8CAAiDC,OAAO,MAAMC,MAAM,MAAMR,QAAQ,QAC1F,4LAEA,0GACA,6MACA,uBAAG,wBAAQK,WAAW,KAAG,oDACzB,cAAC,IAAiB,CAACJ,WAAW,EAAMC,SAAS,OAAOC,MAAOC,IAAYJ,QAAQ,qBAAmB,ykBAuBlG,uBAAG,wBAAQK,WAAW,KAAG,sCACzB,yDACA,uBAAG,wBAAQA,WAAW,KAAG,iBACzB,cAAC,IAAiB,CAACJ,WAAW,EAAMC,SAAS,QAAQC,MAAOC,IAAYJ,QAAQ,qBAAmB,ktBA4BtG,gMAEDH,EAAWY,gBAAiB,G,sEC9H5B,+EAuCeC,IAnBHX,IACX,MAAM,IAAEO,EAAG,MAAEE,EAAK,OAAED,GAAWR,GACzB,QAAEY,GAAYC,sBAMpB,OACC,2BACC,uBAC6BT,MART,CACtBU,UAAW,6FACIC,gBAAiB,4FACjBC,aAAc,6FAM1BT,IAAM,GAAEK,IAAUL,IAClBC,OAAS,IAAEA,GAAU,QACrBC,MAAQ,IAAEA,GAAS,a,+DClCvB,iFAqBAQ,IAAKC,KAAKC,MAAQ,UACHF,MAAI","file":"static/js/documents-search-search-relationship.1d764e51.js","sourcesContent":["\nimport React from 'react'\nimport { mdx } from '@mdx-js/react'\n\n/* @jsxRuntime classic */\n/* @jsx mdx */\nimport themen from 'theme/styles/styled-colors';\nimport * as theme from 'react-syntax-highlighter/dist/esm/styles/hljs';\nimport SyntaxHighlighter from 'react-syntax-highlighter';\nimport Img from 'theme/components/shared/Img'\n\n\nconst layoutProps = {\n \n};\nconst MDXLayout = \"wrapper\"\nexport default function MDXContent({\n components,\n ...props\n}) {\n return <MDXLayout {...layoutProps} {...props} components={components} mdxType=\"MDXLayout\">\n\n <h1 {...{\n \"id\": \"relationship-search\"\n }}>{`Relationship Search`}</h1>\n <p>{`Apache Atlas is a metadata governance tool that features the ability to search for pre-defined entities of the defined model.`}</p>\n <p>{`We are able to search for these entities by specifying generic attributes (such as ‘name’, ‘qualified name’, ‘description’ etc), entity type definition specific attributes (attributes unique to certain entities such as ‘cluster name’ for hdfs_path type entities) and also on parameters like classifications applied, sub-types of entities and deleted entities. However these results only return entities which fulfil the parameters of the search queries.`}</p>\n <p>{`A relationship, which also follows a similar structure to an entity, describes various metadata between two entity end-points. For example, let us assume that in the case of a relationship between hive_table and hive_db, the relationship type name is called hive_table_db and it can have its own metadata which can be added as an attributes to this model.`}</p>\n <p>{`The Relationship search allows you to get the metadata between two entity model, by querying using relationship type name, and it also has support for filtering on the relationship attribute(s).`}</p>\n <p>{`The entire query structure can be represented using the following JSON structure (called RelationshipSearchParameters)`}</p>\n <SyntaxHighlighter wrapLines={true} language=\"json\" style={theme.dark} mdxType=\"SyntaxHighlighter\">\n {`{\n \"relationshipName\": \"hive_table_db\",\n \"excludeDeletedEntities\": true,\n \"offset\": 0,\n \"limit\": 25,\n \"relationshipFilters\": { },\n \"sortBy\": \"table_name\",\n \"sortOrder\": ASCENDING,\n \"marker\": \"*\"\n}`}\n </SyntaxHighlighter>\n <p><strong parentName=\"p\">{`Field description`}</strong></p>\n <SyntaxHighlighter wrapLines={true} language=\"json\" style={theme.dark} mdxType=\"SyntaxHighlighter\">\n {`relationshipName: the type of relationship to look for\nexcludeDeletedEntities: should the search exclude deleted entities? (default: true)\noffset: starting offset of the result set (useful for pagination)\nlimit: max number of results to fetch\nrelationshipFilters: relationship attribute filter(s)\nsortBy: attribute to which results are sorted by\nsortOrder: sorting order of results\nmarker: add either offset or marker, value of marker for first page will be '*'\n and value of nextMarker: in the response will be input of marker for subsequent pages`}\n </SyntaxHighlighter>\n <p>{`Attribute based filtering can be done on multiple attributes with AND/OR conditions.`}</p>\n <p><strong parentName=\"p\">{`Real time example of Relationship Search`}</strong></p>\n <p>{`Consider use-case of social media based application '`}<em parentName=\"p\">{`Instagram`}</em>{`' and its basic functionalities like:`}</p>\n <ul>\n <li parentName=\"ul\"><em parentName=\"li\">{`User`}</em>{` creates `}<em parentName=\"li\">{`Posts`}</em></li>\n <li parentName=\"ul\"><em parentName=\"li\">{`User`}</em>{` reacts to `}<em parentName=\"li\">{`Posts`}</em></li>\n <li parentName=\"ul\"><em parentName=\"li\">{`User`}</em>{` creates `}<em parentName=\"li\">{`Highlight`}</em></li>\n <li parentName=\"ul\"><em parentName=\"li\">{`Posts`}</em>{` added in `}<em parentName=\"li\">{`Highlight`}</em></li>\n </ul>\n <p>{`Below is the Metadata Model highlighting above use-case`}</p>\n <Img src={`/images/twiki/relationship_search_model.png`} height=\"500\" width=\"840\" mdxType=\"Img\" />\n <p>{`Example:\nConsider a user Ajay, who had uploaded his celebratory Diwali photo as a post. Users like Divya, Rahul and many others reacted with a like to his post.`}</p>\n <p>{`Now the user Ajay wants to find out the number of 'like' reactions to his post.`}</p>\n <p>{`For his search, he will focus on 'user_post' relationship type and filter those with attributes where reactions have 'like' in them and in which the post name has 'Diwali' in it.`}</p>\n <p><strong parentName=\"p\">{`Example of filtering (for user_post attributes)`}</strong></p>\n <SyntaxHighlighter wrapLines={true} language=\"json\" style={theme.dark} mdxType=\"SyntaxHighlighter\">\n {` {\n \"relationshipName\": \"user_post\",\n \"excludeDeletedEntities\": true,\n \"offset\": 0,\n \"limit\": 25,\n \"relationshipFilters\": {\n \"condition\": \"AND\",\n \"criterion\": [\n {\n \"attributeName\": \"reaction\",\n \"operator\": \"eq\",\n \"attributeValue\": \"like\"\n },\n {\n \"attributeName\": \"post_name\",\n \"operator\": \"contains\",\n \"attributeValue\": \"Diwali\"\n }\n ]\n }\n }`}\n </SyntaxHighlighter>\n <p><strong parentName=\"p\">{`Supported operators for filtering`}</strong></p>\n <p>{`Same operators as basic search`}</p>\n <p><strong parentName=\"p\">{`CURL Samples`}</strong></p>\n <SyntaxHighlighter wrapLines={true} language=\"shell\" style={theme.dark} mdxType=\"SyntaxHighlighter\">\n {`curl -sivk -g\n -u <user>:<password>\n -X POST\n -d '{\n \"relationshipName\": \"user_post\",\n \"excludeDeletedEntities\": true,\n \"offset\": 0,\n \"limit\": 25,\n \"relationshipFilters\": {\n \"condition\": \"AND\",\n \"criterion\": [\n {\n \"attributeName\": \"reaction\",\n \"operator\": \"eq\",\n \"attributeValue\": \"like\"\n },\n {\n \"attributeName\": \"post_name\",\n \"operator\": \"contains\",\n \"attributeValue\": \"Diwali\"\n }\n ]\n }\n }'\n <protocol>://<atlas_host>:<atlas_port>/api/atlas/v2/search/relations`}\n </SyntaxHighlighter>\n </MDXLayout>;\n}\n;\nMDXContent.isMDXComponent = true;","/**\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as React from \"react\";\nimport { useConfig } from \"../../../../docz-lib/docz/dist\";\nconst Img = props => {\n\tconst { src, width, height } = props;\n\tconst { baseUrl } = useConfig();\n const styles = {\n\tboxShadow: \"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)\",\n WebkitBoxShadow: \"0 2px 2px 0 rgba(0,0,0,0.14) 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)\",\n MozBoxShadow: \"0 2px 2px 0 rgba(0,0,0,0.14) 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)\"\n }\n\treturn (\n\t\t<div>\n\t\t\t<img\n style={styles}\n\t\t\t\tsrc={`${baseUrl}${src}`}\n\t\t\t\theight={`${height || \"auto\"}`}\n\t\t\t\twidth={`${width || \"100%\"}`}\n\t\t\t/>\n\t\t</div>\n\t);\n};\nexport default Img;\n","/**\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { dark } from \"react-syntax-highlighter/dist/esm/styles/hljs\";\n\n//dark[\"powershell\"][\"color\"] = \"#37bb9b\";\ndark.hljs.color = \"#37bb9b\";\nexport default dark;"],"sourceRoot":""}