UNPKG

graphdb-workbench

Version:
168 lines (156 loc) 9.65 kB
<link href="css/lib/angular-xeditable/xeditable.min.css?v=1.11.3-TR1" rel="stylesheet"> <link href="css/lib/yasqe.min.css?v=1.11.3-TR1" rel="stylesheet"/> <link href="css/new-sparql.css?v=1.11.3-TR1" rel="stylesheet"/> <link href="css/graphs-config.css?v=1.11.3-TR1" rel="stylesheet"/> <link href="css/jdbc.css?v=1.11.3-TR1" rel="stylesheet"/> <div class="container-fluid"> <h1> {{title}} <span class="btn btn-link" uib-popover-template="'js/angular/templates/titlePopoverTemplate.html'" popover-trigger="mouseenter" popover-placement="bottom-right" popover-append-to-body="true"><span class="icon-info"></span></span> </h1> <div core-errors></div> <div system-repo-warning></div> <div class="alert alert-danger" ng-show="repositoryError"> <p>The currently selected repository cannot be used for queries due to an error:</p> <p>{{repositoryError}}</p> </div> <div class="card mb-2 sql-table-config"> <div class="card-block pt-1"> <p class="lead">Table name</p> <div class="table-group table-group-lg"> <input required class="form-control sql-table-name" type="text" placeholder="SQL table name (required)" ng-model="currentQuery.name" ng-disabled="!currentQuery.isNewConfiguration" > </div> <ul class="nav nav-tabs pt-1"> <li class="nav-item"> <a ng-class="page === 1 ? 'active' : ''" ng-click="goToPage(1)" class="nav-link" href> Data query </a> </li> <li class="nav-item"> <a ng-class="page === 2 ? 'active' : ''" ng-click="goToPage(2)" class="nav-link" href> Column types </a> </li> </ul> <div ng-show="page === 2 && !currentQuery.columns.length" class="mt-2"> No columns are defined. Please start with a data query and come back to this tab to review the column definitions. </div> <div ng-show="page === 2 && currentQuery.columns.length"> <div class="form-group row pt-1"> <label class="col-xs-2 col-sm-2 col-md-2 col-form-label"><strong>Column name</strong></label> <div class="col-xs-2 col-sm-2 col-md-2"> <label class="col-form-label"><strong>SQL type</strong></label> </div> <div class="col-xs-1 col-sm-1 col-md-1" ng-if="containsColumnsWithPrecision(currentQuery.columns)"> <label class="col-form-label"><strong>Precision</strong></label> </div> <div class="col-xs-1 col-sm-1 col-md-1" ng-if="containsColumnsWithScale(currentQuery.columns)"> <label class="col-form-label"><strong>Scale</strong></label> </div> <div class="col-xs-1 col-sm-1 col-md-1"> <label class="col-form-label"><strong>Nullable</strong></label> </div> <div class="col-xs-4 col-sm-4 col-md-4" ng-if="!containsNonLiteralColumnsOnly(currentQuery.columns)"> <label class="col-form-label"><strong>Literal type or language tag for SPARQL FILTER</strong></label> </div> </div> <div ng-repeat="column in currentQuery.columns track by $index" class="form-group row pt-1"> <label class="col-xs-2 col-sm-2 col-md-2 col-form-label"> <span uib-tooltip="The column names are derived from the projection variables of the SPARQL query." tooltip-placement="top" tooltip-trigger="mouseenter"> {{column.column_name | uppercase}} </span> </label> <div class="col-xs-2 col-sm-2 col-md-2"> <select uib-tooltip="Sets the SQL type. VARCHAR's variants IRI and String are the same on the SQL side but handled differently on the SPARQL side." tooltip-placement="top" tooltip-trigger="mouseenter" class="form-control" id="sql-type" ng-model="column.column_type" ng-options="type as getTypeLabel(type) for type in sqlTypes track by type" ng-change="selectColumnType(column.column_name, '{{column.column_type}}')" ng-disabled="!canWriteActiveRepo()"></select> </div> <div class="col-xs-1 col-sm-1 col-md-1" ng-class="!hasPrecision(column.column_type) ? 'hidden' : ''" ng-if="containsColumnsWithPrecision(currentQuery.columns)"> <input uib-tooltip="Sets the precision of the SQL type. For VARCHAR it is only informational and will not be enforced in any way." tooltip-placement="top" tooltip-trigger="mouseenter" class="form-control" type="text" name="title" id="precision" ng-model="column.sql_type_precision" ng-change="setDirty()" ng-disabled="!canWriteActiveRepo()"> </div> <div class="col-xs-1 col-sm-1 col-md-1" ng-class="!hasScale(column.column_type) ? 'hidden' : ''" ng-if="containsColumnsWithScale(currentQuery.columns)"> <input uib-tooltip="Sets the scale of the SQL type, e.g. DECIMAL(10, 2)." tooltip-placement="top" tooltip-trigger="mouseenter" class="form-control" type="text" name="title" id="scale" ng-model="column.sql_type_scale" ng-change="setDirty()" ng-disabled="!canWriteActiveRepo()"> </div> <div class="col-xs-1 col-sm-1 col-md-1"> <div class="form-control b-0"> <input uib-tooltip="If unchecked the column will be defined as NOT NULL. Nullability is only informational and not enforced in any way." tooltip-placement="top" tooltip-trigger="mouseenter" type="checkbox" id="nullable" ng-model="column.nullable" ng-change="setDirty()" ng-disabled="!canWriteActiveRepo()"> </div> </div> <div class="col-xs-4 col-sm-4 col-md-4" ng-class="isLiteral(column.column_type) ? '' : 'hidden'" ng-if="!containsNonLiteralColumnsOnly(currentQuery.columns)"> <input uib-tooltip="Controls how literals are created for filtering on the SPARQL side. Leave empty for a plain literal, enter an IRI for a typed literal, or enter a language tag prefixed by @ for a language-tagged literal." tooltip-placement="top" tooltip-trigger="mouseenter" class="form-control" type="text" name="title" id="sparqlType" ng-model="column.sparql_type" ng-change="setDirty()" ng-disabled="!canWriteActiveRepo()"> </div> <div class="col-xs-1 col-sm-1 col-md-1"> <button type="button" ng-click="deleteColumn(column.column_name, $index)" class="btn btn-link delete-column-btn" uib-tooltip="Delete column" ng-if="canWriteActiveRepo()"><span class="icon-trash"></span> </button> </div> </div> </div> <div class="clearfix"> <div class="pull-right"> <button ng-if="page === 2 && canWriteActiveRepo()" class="btn btn-lg preview-btn" ng-click="getColumnsSuggestions()" uib-popover="Get columns suggestions" popover-placement="top" popover-trigger="mouseenter"> Suggest </button> </div> </div> <div class="container-fluid"> <br/> <query-editor nostorage notabs notoolbar-saved notoolbar-copy nostatus nocount norun notoolbar-inference notoolbar-same-as callback-on-change="updateDirty"> </query-editor> </div> </div> </div> <button class="btn btn-lg btn-primary save-query-btn" ng-click="save()" uib-popover="Save SQL configuration" popover-placement="top" popover-trigger="mouseenter" ng-if="canWriteActiveRepo()"> Save </button> <a ng-href="/jdbc" class="btn btn-lg btn-secondary cancel-query-btn" uib-popover="Cancel SQL configuration" popover-placement="top" popover-trigger="mouseenter" ng-if="canWriteActiveRepo()"> Cancel </a> <a ng-href="/jdbc" class="btn btn-lg btn-secondary" uib-popover="Cancel SQL configuration" popover-placement="top" popover-trigger="mouseenter" ng-if="!canWriteActiveRepo()"> Close </a> <div class="pull-right"> <button class="btn btn-lg preview-btn" ng-click="getPreview()" uib-popover="Preview SQL configuration table" popover-placement="top" popover-trigger="mouseenter"> Preview </button> </div> <br/><br/><br/> </div>