Skip to content

Commit

Permalink
Merge pull request #174 from Ontotext-AD/GDB-4246-rdfstar
Browse files Browse the repository at this point in the history
GDB-4248 Extend YASR table view to render SPARQL* Tuple results
  • Loading branch information
desislava-hristova-ontotext authored Mar 6, 2020
2 parents b6583ac + e1e1c15 commit 0bb8e35
Show file tree
Hide file tree
Showing 11 changed files with 1,481 additions and 343 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "graphdb-workbench",
"version": "1.2.3-TR1",
"version": "1.3.0-TR1",
"description": "The web application for GraphDB APIs",
"scripts": {
"build": "webpack --config=webpack.config.prod.js",
Expand Down Expand Up @@ -34,7 +34,7 @@
"url": "https://github.com/Ontotext-AD/graphdb-workbench/issues"
},
"versions": {
"graphdb": "9.1.0-RC4"
"graphdb": "9.2.0-TR9"
},
"homepage": "https://github.com/Ontotext-AD/graphdb-workbench#readme",
"devDependencies": {
Expand Down
31 changes: 29 additions & 2 deletions src/css/yasr.custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,42 @@
}

.yasr .uri-cell {
display: inline;
word-break: normal !important;
word-wrap: normal !important;
}

.yasr .yasr_results .uri-cell .share-result {
.yasr .triple-cell {
display: inline;
}

.yasr table.dataTable td div.triple-cell {
padding: 0px;
}
.yasr table.dataTable td div.triple-cell .triple-link {
color: #708;
}

.yasr .triple-list {
list-style-type:none;
margin-bottom: 0;
padding: 0px 20px;
}

.yasr .triple-list .uri-cell,
.yasr .triple-list .literal-cell{
padding: 0px;
}


.yasr .yasr_results .uri-cell .share-result,
.yasr .yasr_results .triple-cell .share-result{
display: none;
}

.yasr .yasr_results td:hover .uri-cell > .share-result {
.yasr .yasr_results .uri-cell:hover > .share-result,
.yasr .yasr_results .triple-link-end:hover + .share-result,
.yasr .yasr_results .share-result:hover {
display: inline;
position: absolute;
padding-top: 3px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ function queryEditorDirective($timeout, $location, toastr, $cookies, $repositori
cursorHeight: 1.0,
sparql: {
showQueryButton: false,
acceptHeaderGraph: "application/rdf+json,*/*;q=0.9"
acceptHeaderGraph: "application/rdf+json,*/*;q=0.9",
acceptHeaderSelect: "application/x-sparqlstar-results+json,*/*;q=0.9"
},
// We provide a wrapper for executeQuery so we have to redefine those here
extraKeys: {
Expand Down
4 changes: 2 additions & 2 deletions src/js/angular/export/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ exportCtrl.controller('ExportCtrl',

/// <summary>Fill the hidden form and submit it to start download document.</summary>
$scope.exportRepo = function (format, contextID) {
if (format.type === 'application/rdf+xml' || format.type === 'text/plain' || format.type === 'text/turtle' || format.type === 'text/rdf+n3') {
if (format.type === 'application/rdf+xml' || format.type === 'text/plain' || format.type === 'text/turtle' || format.type === 'application/x-turtlestar' || format.type === 'text/rdf+n3') {
ModalService.openSimpleModal({
title: 'Warning',
message: 'This format does not support graphs.<br>Graph information will not be available in the export.',
Expand Down Expand Up @@ -194,7 +194,7 @@ exportCtrl.controller('ExportCtrl',
$scope.downloadExport(downloadUrl, format);
};

if (format.type === 'application/rdf+xml' || format.type === 'text/plain' || format.type === 'text/turtle' || format.type === 'text/rdf+n3') {
if (format.type === 'application/rdf+xml' || format.type === 'text/plain' || format.type === 'text/turtle' || format.type === 'application/x-turtlestar' || format.type === 'text/rdf+n3') {
ModalService.openSimpleModal({
title: 'Warning',
message: 'This format does not support graphs.<br>Graph information will not be available in the export.',
Expand Down
6 changes: 4 additions & 2 deletions src/js/angular/import/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ importCtrl.controller('CommonCtrl', ['$scope', '$http', 'toastr', '$interval', '

$scope.getAppData();

$scope.fileFormats = ['ttl', 'rdf', 'rj', 'n3', 'nt', 'nq', 'trig', 'trix', 'brf', 'owl', 'jsonld'];
$scope.fileFormats = ['ttl', 'ttls', 'rdf', 'rj', 'n3', 'nt', 'nq', 'trig', 'trigs', 'trix', 'brf', 'owl', 'jsonld'];

{
const gzs = _.map($scope.fileFormats, function (f) {
Expand Down Expand Up @@ -663,8 +663,10 @@ importCtrl.controller('TextCtrl', ['$scope', '$modalInstance', 'text', 'format',
{name: 'N-Triples', type: 'text/plain'},
{name: 'N-Quads', type: 'text/x-nquads'},
{name: 'Turtle', type: 'text/turtle'},
{name: 'Turtle*', type: 'application/x-turtlestar'},
{name: 'TriX', type: 'application/trix'},
{name: 'TriG', type: 'application/x-trig'}
{name: 'TriG', type: 'application/x-trig'},
{name: 'TriG*', type: 'application/x-trigstar'},
];

$scope.rdfText = text;
Expand Down
4 changes: 4 additions & 0 deletions src/js/angular/import/templates/urlImport.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,14 @@ <h4 class="modal-title">Import RDF data from URL</h4>
class="dropdown-item">N-Quads</a></li>
<li><a ng-click="importFormat = {name: 'Turtle', type: 'text/turtle'}"
class="dropdown-item">Turtle</a></li>
<li><a ng-click="importFormat = {name: 'Turtle*', type: 'application/x-turtlestar'}"
class="dropdown-item">Turtle*</a></li>
<li><a ng-click="importFormat = {name: 'TriX', type: 'application/trix'}"
class="dropdown-item">TriX</a></li>
<li><a ng-click="importFormat = {name: 'TriG', type: 'application/x-trig'}"
class="dropdown-item">TriG</a></li>
<li><a ng-click="importFormat = {name: 'TriG*', type: 'application/x-trigstar'}"
class="dropdown-item">TriG*</a></li>
<li><a ng-click="importFormat = {name: 'BinaryRDF', type: 'application/x-binary-rdf'}"
class="dropdown-item">BinaryRDF</a></li>
</ul>
Expand Down
2 changes: 2 additions & 0 deletions src/js/angular/utils/file-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ angular.module('graphdb.workbench.utils.filetypes', [])
{name: 'N-Triples', type: 'text/plain', extension: '.nt'},
{name: 'N-Quads', type: 'text/x-nquads', extension: '.nq'},
{name: 'Turtle', type: 'text/turtle', extension: '.ttl'},
{name: 'Turtle*', type: 'application/x-turtlestar', extension: '.ttls'},
{name: 'TriX', type: 'application/trix', extension: '.trix'},
{name: 'TriG', type: 'application/x-trig', extension: '.trig'},
{name: 'TriG*', type: 'application/x-trigstar', extension: '.trigs'},
{name: 'Binary RDF', type: 'application/x-binary-rdf', extension: '.brf'}
]);
Loading

0 comments on commit 0bb8e35

Please sign in to comment.