| <!DOCTYPE html> |
| <!-- |
| | Generated by Apache Maven Doxia at 2017-03-16 |
| | Rendered using Apache Maven Fluido Skin 1.3.0 |
| --> |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| <head> |
| <meta charset="UTF-8" /> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| <meta name="Date-Revision-yyyymmdd" content="20170316" /> |
| <meta http-equiv="Content-Language" content="en" /> |
| <title>Apache Atlas – Search</title> |
| <link rel="stylesheet" href="./css/apache-maven-fluido-1.3.0.min.css" /> |
| <link rel="stylesheet" href="./css/site.css" /> |
| <link rel="stylesheet" href="./css/print.css" media="print" /> |
| |
| |
| <script type="text/javascript" src="./js/apache-maven-fluido-1.3.0.min.js"></script> |
| |
| |
| |
| <script type="text/javascript">$( document ).ready( function() { $( '.carousel' ).carousel( { interval: 3500 } ) } );</script> |
| |
| </head> |
| <body class="topBarEnabled"> |
| |
| |
| |
| |
| |
| <div id="topbar" class="navbar navbar-fixed-top "> |
| <div class="navbar-inner"> |
| <div class="container" style="width: 68%;"><div class="nav-collapse"> |
| |
| |
| <ul class="nav"> |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown">Atlas <b class="caret"></b></a> |
| <ul class="dropdown-menu"> |
| |
| <li> <a href="index.html" title="About">About</a> |
| </li> |
| |
| <li> <a href="https://cwiki.apache.org/confluence/display/ATLAS" title="Wiki">Wiki</a> |
| </li> |
| |
| <li> <a href="https://cwiki.apache.org/confluence/display/ATLAS" title="News">News</a> |
| </li> |
| |
| <li> <a href="https://git-wip-us.apache.org/repos/asf/incubator-atlas.git" title="Git">Git</a> |
| </li> |
| |
| <li> <a href="https://issues.apache.org/jira/browse/ATLAS" title="Jira">Jira</a> |
| </li> |
| |
| <li> <a href="https://cwiki.apache.org/confluence/display/ATLAS/PoweredBy" title="Powered by">Powered by</a> |
| </li> |
| |
| <li> <a href="http://blogs.apache.org/atlas/" title="Blog">Blog</a> |
| </li> |
| </ul> |
| </li> |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown">Project Information <b class="caret"></b></a> |
| <ul class="dropdown-menu"> |
| |
| <li> <a href="project-info.html" title="Summary">Summary</a> |
| </li> |
| |
| <li> <a href="mail-lists.html" title="Mailing Lists">Mailing Lists</a> |
| </li> |
| |
| <li> <a href="http://webchat.freenode.net?channels=apacheatlas&uio=d4" title="IRC">IRC</a> |
| </li> |
| |
| <li> <a href="team-list.html" title="Team">Team</a> |
| </li> |
| |
| <li> <a href="issue-tracking.html" title="Issue Tracking">Issue Tracking</a> |
| </li> |
| |
| <li> <a href="source-repository.html" title="Source Repository">Source Repository</a> |
| </li> |
| |
| <li> <a href="license.html" title="License">License</a> |
| </li> |
| </ul> |
| </li> |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown">Releases <b class="caret"></b></a> |
| <ul class="dropdown-menu"> |
| |
| <li> <a href="http://www.apache.org/dyn/closer.cgi/incubator/atlas/0.8.0-incubating/" title="0.8-incubating">0.8-incubating</a> |
| </li> |
| |
| <li> <a href="http://archive.apache.org/dist/incubator/atlas/0.7.1-incubating/" title="0.7.1-incubating">0.7.1-incubating</a> |
| </li> |
| |
| <li> <a href="http://archive.apache.org/dist/incubator/atlas/0.7.0-incubating/" title="0.7-incubating">0.7-incubating</a> |
| </li> |
| |
| <li> <a href="http://archive.apache.org/dist/incubator/atlas/0.6.0-incubating/" title="0.6-incubating">0.6-incubating</a> |
| </li> |
| |
| <li> <a href="http://archive.apache.org/dist/incubator/atlas/0.5.0-incubating/" title="0.5-incubating">0.5-incubating</a> |
| </li> |
| </ul> |
| </li> |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown">Documentation <b class="caret"></b></a> |
| <ul class="dropdown-menu"> |
| <li><a href="../index.html" title="latest">latest</a></li> |
| <li><a href="../0.8.0-incubating/index.html" title="0.8-incubating">0.8-incubating</a></li> |
| <li><a href="../0.7.1-incubating/index.html" title="0.7.1-incubating">0.7.1-incubating</a></li> |
| <li><a href="../0.7.0-incubating/index.html" title="0.7-incubating">0.7-incubating</a></li> |
| <li><a href="../0.6.0-incubating/index.html" title="0.6-incubating">0.6-incubating</a></li> |
| <li><a href="../0.5.0-incubating/index.html" title="0.5-incubating">0.5-incubating</a></li> |
| </ul> |
| </li> |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown">ASF <b class="caret"></b></a> |
| <ul class="dropdown-menu"> |
| |
| <li> <a href="http://www.apache.org/foundation/how-it-works.html" title="How Apache Works">How Apache Works</a> |
| </li> |
| |
| <li> <a href="http://www.apache.org/foundation/" title="Foundation">Foundation</a> |
| </li> |
| |
| <li> <a href="http://www.apache.org/foundation/sponsorship.html" title="Sponsoring Apache">Sponsoring Apache</a> |
| </li> |
| |
| <li> <a href="http://www.apache.org/foundation/thanks.html" title="Thanks">Thanks</a> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| |
| <form id="search-form" action="http://www.google.com/search" method="get" class="navbar-search pull-right" > |
| |
| <input value="http://atlas.incubator.apache.org" name="sitesearch" type="hidden"/> |
| <input class="search-query" name="q" id="query" type="text" /> |
| </form> |
| <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=search-form"></script> |
| |
| |
| |
| |
| |
| <iframe src="http://www.facebook.com/plugins/like.php?href=http://atlas.incubator.apache.org/atlas-docs&send=false&layout=button_count&show-faces=false&action=like&colorscheme=dark" |
| scrolling="no" frameborder="0" |
| style="border:none; width:80px; height:20px; margin-top: 10px;" class="pull-right" ></iframe> |
| |
| <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> |
| |
| <ul class="nav pull-right"><li style="margin-top: 10px;"> |
| |
| <div class="g-plusone" data-href="http://atlas.incubator.apache.org/atlas-docs" data-size="medium" width="60px" align="right" ></div> |
| |
| </li></ul> |
| |
| |
| </div> |
| |
| </div> |
| </div> |
| </div> |
| |
| <div class="container"> |
| <div id="banner"> |
| <div class="pull-left"> |
| <a href=".." id="bannerLeft"> |
| <img src="images/atlas-logo.png" alt="Apache Atlas" width="200px" height="45px"/> |
| </a> |
| </div> |
| <div class="pull-right"> <a href="http://incubator.apache.org" id="bannerRight"> |
| <img src="images/apache-incubator-logo.png" alt="Apache Incubator"/> |
| </a> |
| </div> |
| <div class="clear"><hr/></div> |
| </div> |
| |
| <div id="breadcrumbs"> |
| <ul class="breadcrumb"> |
| |
| |
| <li class=""> |
| <a href="http://www.apache.org" class="externalLink" title="Apache"> |
| Apache</a> |
| </li> |
| <li class="divider ">/</li> |
| <li class=""> |
| <a href="index.html" title="Atlas"> |
| Atlas</a> |
| </li> |
| <li class="divider ">/</li> |
| <li class="">Search</li> |
| |
| |
| |
| <li id="publishDate" class="pull-right">Last Published: 2017-03-16</li> <li class="divider pull-right">|</li> |
| <li id="projectVersion" class="pull-right">Version: 0.8-incubating</li> |
| |
| </ul> |
| </div> |
| |
| |
| |
| <div id="bodyColumn" > |
| |
| <div class="section"> |
| <h2><a name="Search"></a>Search</h2> |
| <p>Atlas exposes search over the metadata in two ways:</p> |
| <ul> |
| <li>Search using DSL</li> |
| <li>Full-text search</li></ul></div> |
| <div class="section"> |
| <h3><a name="Search_DSL_Grammar"></a>Search DSL Grammar</h3> |
| <p>The DSL exposes an SQL like query language for searching the metadata based on the type system. The grammar for the DSL is below.</p> |
| <div class="source"> |
| <pre> |
| queryWithPath: query ~ opt(WITHPATH) |
| |
| query: querySrc ~ opt(loopExpression) ~ opt(groupByExpr) ~ opt(selectClause) ~ opt(orderby) ~ opt(limitOffset) |
| |
| querySrc: rep1sep(singleQrySrc, opt(COMMA)) |
| |
| singleQrySrc = FROM ~ fromSrc ~ opt(WHERE) ~ opt(expr ^? notIdExpression) | |
| WHERE ~ (expr ^? notIdExpression) | |
| expr ^? notIdExpression | |
| fromSrc ~ opt(WHERE) ~ opt(expr ^? notIdExpression) |
| |
| fromSrc: identifier ~ AS ~ alias | identifier |
| |
| groupByExpr = GROUPBY ~ (LPAREN ~> rep1sep(selectExpression, COMMA) <~ RPAREN) |
| |
| orderby: ORDERBY ~ expr ~ opt (sortOrder) |
| |
| limitOffset: LIMIT ~ lmt ~ opt (offset) |
| |
| offset: OFFSET ~ offsetValue |
| |
| sortOrder = ASC | DESC |
| |
| loopExpression: LOOP ~ (LPAREN ~> query <~ RPAREN) ~ opt(intConstant <~ TIMES) ~ opt(AS ~> alias) |
| |
| selectClause: SELECT ~ rep1sep(selectExpression, COMMA) |
| |
| countClause = COUNT ~ LPAREN ~ RPAREN |
| |
| maxClause = MAX ~ (LPAREN ~> expr <~ RPAREN) |
| |
| minClause = MIN ~ (LPAREN ~> expr <~ RPAREN) |
| |
| sumClause = SUM ~ (LPAREN ~> expr <~ RPAREN) |
| |
| selectExpression: expr ~ opt(AS ~> alias) |
| |
| expr: compE ~ opt(rep(exprRight)) |
| |
| exprRight: (AND | OR) ~ compE |
| |
| compE: |
| arithE ~ (LT | LTE | EQ | NEQ | GT | GTE) ~ arithE | |
| arithE ~ (ISA | IS) ~ ident | |
| arithE ~ HAS ~ ident | |
| arithE | countClause | maxClause | minClause | sumClause |
| |
| arithE: multiE ~ opt(rep(arithERight)) |
| |
| arithERight: (PLUS | MINUS) ~ multiE |
| |
| multiE: atomE ~ opt(rep(multiERight)) |
| |
| multiERight: (STAR | DIV) ~ atomE |
| |
| atomE: literal | identifier | LPAREN ~> expr <~ RPAREN |
| |
| identifier: rep1sep(ident, DOT) |
| |
| alias: ident | stringLit |
| |
| literal: booleanConstant | |
| intConstant | |
| longConstant | |
| floatConstant | |
| doubleConstant | |
| stringLit |
| |
| </pre></div> |
| <p>Grammar language: {noformat} opt(a) => a is optional ~ => a combinator. 'a ~ b' means a followed by b rep => zero or more rep1sep => one or more, separated by second arg. {noformat}</p> |
| <p>Language Notes:</p> |
| <ul> |
| <li>A <b>SingleQuery</b> expression can be used to search for entities of a <i>Trait</i> or <i>Class</i>.</li></ul>Entities can be filtered based on a 'Where Clause' and Entity Attributes can be retrieved based on a 'Select Clause'. |
| <ul> |
| <li>An Entity Graph can be traversed/joined by combining one or more SingleQueries.</li> |
| <li>An attempt is made to make the expressions look SQL like by accepting keywords "SELECT",</li></ul>"FROM", and "WHERE"; but these are optional and users can simply think in terms of Entity Graph Traversals. |
| <ul> |
| <li>The transitive closure of an Entity relationship can be expressed via the <i>Loop</i> expression. A</li></ul><i>Loop</i> expression can be any traversal (recursively a query) that represents a <i>Path</i> that ends in an Entity of the same <i>Type</i> as the starting Entity. |
| <ul> |
| <li>The <i>WithPath</i> clause can be used with transitive closure queries to retrieve the Path that</li></ul>connects the two related Entities. (We also provide a higher level interface for Closure Queries see scaladoc for 'org.apache.atlas.query.ClosureQuery') |
| <ul> |
| <li>GROUPBY is optional. Group by can be specified with aggregate methods like max, min, sum and count. When group by is specified aggregated results are returned based on the method specified in select clause. Select expression is mandatory with group by expression.</li> |
| <li>ORDERBY is optional. When order by clause is specified, case insensitive sorting is done based on the column specified.</li></ul>For sorting in descending order specify 'DESC' after order by clause. If no order by is specified, then no default sorting is applied. |
| <ul> |
| <li>LIMIT is optional. It limits the maximum number of objects to be fetched starting from specified optional offset. If no offset is specified count starts from beginning.</li> |
| <li>There are couple of Predicate functions different from SQL: |
| <ul> |
| <li><i>is</i> or <i>isa</i>can be used to filter Entities that have a particular Trait.</li> |
| <li><i>has</i> can be used to filter Entities that have a value for a particular Attribute.</li></ul></li> |
| <li>Any identifiers or constants with special characters(space,$,",{,}) should be enclosed within backquote (`)</li></ul></div> |
| <div class="section"> |
| <h4><a name="DSL_Examples"></a>DSL Examples</h4> |
| <p>For the model, Asset - attributes name, owner, description DB - supertype Asset - attributes clusterName, parameters, comment Column - extends Asset - attributes type, comment Table - supertype Asset - db, columns, parameters, comment Traits - PII, Log Data</p> |
| <p>DSL queries: * from DB</p> |
| <ul> |
| <li>DB where name="Reporting" select name, owner</li> |
| <li>DB where name="Reporting" select name, owner orderby name</li> |
| <li>DB where name="Reporting" select name limit 10</li> |
| <li>DB where name="Reporting" select name, owner limit 10 offset 0</li> |
| <li>DB where name="Reporting" select name, owner orderby name limit 10 offset 5</li> |
| <li>DB where name="Reporting" select name, owner orderby name desc limit 10 offset 5</li> |
| <li>DB has name</li> |
| <li>DB is JdbcAccess</li> |
| <li>Column where Column isa PII</li> |
| <li>Table where name="sales_fact", columns</li> |
| <li>Table where name="sales_fact", columns as column select column.name, column.dataType, column.comment</li> |
| <li>DB groupby(owner) select owner, count()</li> |
| <li>DB groupby(owner) select owner, max(name)</li> |
| <li>DB groupby(owner) select owner, min(name)</li> |
| <li>from Person select count() as 'count', max(Person.age) as 'max', min(Person.age)</li> |
| <li>`Log Data`</li></ul></div> |
| <div class="section"> |
| <h3><a name="Full-text_Search"></a>Full-text Search</h3> |
| <p>Atlas also exposes a lucene style full-text search capability.</p></div> |
| </div> |
| </div> |
| |
| <hr/> |
| |
| <footer> |
| <div class="container"> |
| <div class="row span12">Copyright © 2015-2017 |
| <a href="http://www.apache.org">Apache Software Foundation</a>. |
| All Rights Reserved. |
| |
| </div> |
| |
| |
| <p id="poweredBy" class="pull-right"> |
| <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"> |
| <img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /> |
| </a> |
| </p> |
| |
| </div> |
| </footer> |
| </body> |
| </html> |