Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Maartenvm committed Aug 18, 2015
2 parents 50840d9 + aac99b3 commit d57810b
Show file tree
Hide file tree
Showing 31 changed files with 7,631 additions and 90 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ project.exvim

/doc
/npm-debug.log

*.pyc
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ module.exports = function(grunt) {
},

ngtemplates: {
'pattyApp.templates': {
'uncertApp.templates': {
cwd: 'app/',
src: 'scripts/*/*.html',
dest: '.tmp/template.js',
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,18 @@ grunt jsdoc
```

API documentation is generated in `doc/` directory.

## Knowledge Store Authentication Workaround

The Flask app requires Python 2.7 and pip.

### Installation

cd UncertaintyVisualization
pip install -r requirements.txt

### Run the Flask app

In de `UncertaintyVisualization` directory run:

python server.py
35 changes: 35 additions & 0 deletions app/data/4M1J-3MC0-TWKJ-V1W8.xml.perspective.trig
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix time: <http://www.w3.org/TR/owl-time#> .
@prefix eso: <http://www.newsreader-project.eu/domain-ontology#> .
@prefix gaf: <http://groundedannotationframework.org/gaf#> .
@prefix nwrontology: <http://www.newsreader-project.eu/ontologies/> .
@prefix wn: <http://www.newsreader-project.eu/ontologies/wordnet3.0/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix sem: <http://semanticweb.cs.vu.nl/2009/11/sem/> .
@prefix fn: <http://www.newsreader-project.eu/ontologies/framenet/> .
@prefix nwrdata: <http://www.newsreader-project.eu/data/> .

{ <http://www.newsreader-project.eu/data/2006/10/02/4M1J-3MC0-TWKJ-V1W8.xml#pr6,rl11,rl12>
prov:wasAttributedTo <http://www.newsreader-project.eu/data/cars/entities/Harrah_%27s_Entertainment_Inc.> .

<http://www.newsreader-project.eu/data/2006/10/02/4M1J-3MC0-TWKJ-V1W8.xml#pr8,rl16,rl17>
prov:wasAttributedTo <http://dbpedia.org/resource/Private_equity> .
}

<http://www.newsreader-project.eu/data/2006/10/02/4M1J-3MC0-TWKJ-V1W8.xml#pr6,rl11,rl12> {
<http://www.newsreader-project.eu/data/2006/10/02/4M1J-3MC0-TWKJ-V1W8.xml#char=201,209>
gaf:hasAttribution <http://www.newsreader-project.eu/ontologies/value#attr=CERTAIN,NON_FUTURE,POS> .

<http://www.newsreader-project.eu/data/2006/10/02/4M1J-3MC0-TWKJ-V1W8.xml#char=212,220>
gaf:hasAttribution <http://www.newsreader-project.eu/ontologies/value#attr=CERTAIN,NON_FUTURE,POS> .

<http://www.newsreader-project.eu/data/2006/10/02/4M1J-3MC0-TWKJ-V1W8.xml#char=254,261>
gaf:hasAttribution <http://www.newsreader-project.eu/ontologies/value#attr=u,u,u> .
}

<http://www.newsreader-project.eu/data/2006/10/02/4M1J-3MC0-TWKJ-V1W8.xml#pr8,rl16,rl17> {
<http://www.newsreader-project.eu/data/2006/10/02/4M1J-3MC0-TWKJ-V1W8.xml#char=254,261>
gaf:hasAttribution <http://www.newsreader-project.eu/ontologies/value#attr=u,u,u> .
}
6,725 changes: 6,725 additions & 0 deletions app/data/ndx.csv

Large diffs are not rendered by default.

30 changes: 25 additions & 5 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<!-- build:css(.) styles/vendor.css -->
<!-- bower:css -->
<link rel="stylesheet" href="bower_components/dcjs/dc.css" />
<!-- endbower -->
<!-- endbuild -->
<!-- build:css(.tmp) styles/main.css -->
Expand All @@ -23,9 +24,20 @@
<![endif]-->

<!-- Add your site or application content here -->

<authentication-directive></authentication-directive>
<!-- <p>Nothing here yet</p> -->
<text-directive></text-directive>

<sparql-directive></sparql-directive>

<rdf-directive></rdf-directive>

<dcjs-directive></dcjs-directive>

<!-- Read RDF from file example -->


<!-- <rdf-directive></rdf-directive> -->

<!-- build:js(.) scripts/oldieshim.js -->
<!--[if lt IE 9]>
Expand All @@ -47,6 +59,10 @@
<script src="bower_components/angular-touch/angular-touch.js"></script>
<script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script>
<script src="bower_components/d3/d3.js"></script>
<script src="bower_components/n3js/n3-browser.js"></script>
<script src="bower_components/crossfilter/crossfilter.js"></script>
<script src="bower_components/dcjs/dc.js"></script>
<script src="bower_components/colorbrewer/colorbrewer.js"></script>
<!-- endbower -->
<!-- endbuild -->

Expand All @@ -57,12 +73,16 @@
<script src="scripts/authentication/authentication.service.js"></script>
<script src="scripts/authentication/authentication.controller.js"></script>
<script src="scripts/authentication/authentication.directive.js"></script>
<!-- <script src="../node_modules/sparqljs/sparql.js"></script> -->
<script src="scripts/rdf/rdf.controller.js"></script>
<script src="scripts/rdf/rdf.directive.js"></script>

<script src="scripts/sparqlservice/sparql.service.js"></script>
<script src="scripts/text/text.directive.js"></script>
<script src="scripts/text/text.controller.js"></script>
<script src="scripts/sparql/sparql.service.js"></script>
<script src="scripts/sparql/sparql.directive.js"></script>
<script src="scripts/sparql/sparql.controller.js"></script>

<script src="scripts/dcjs/dcjs.service.js"></script>
<script src="scripts/dcjs/dcjs.controller.js"></script>
<script src="scripts/dcjs/dcjs.directive.js"></script>
<!-- endbuild -->
</body>

Expand Down
64 changes: 59 additions & 5 deletions app/scripts/app.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,59 @@
// The app
/* global N3:false, dc:false, d3:false, crossfilter:false, colorbrewer:false */

(function() {
'use strict';

angular.module('uncertApp.n3', [])
.constant('N3', N3);

angular.module('uncertApp.dc', [])
.constant('dc', dc);

angular.module('uncertApp.d3', [])
.constant('d3', d3);

angular.module('uncertApp.crossfilter', [])
.constant('crossfilter', crossfilter);

angular.module('uncertApp.colorbrewer', [])
.constant('colorbrewer', colorbrewer);

// Modules dependent on d3
// angular.module('uncertApp.d3', [])
// .factory('d3Service', ['$document', '$window', '$q', '$rootScope',
// function($document, $window, $q, $rootScope) {
// var d = $q.defer(),
// d3service = {
// d3: function() {
// return d.promise;
// }
// };
//
// function onScriptLoad() {
// // Load client in the browser
// $rootScope.$apply(function() {
// d.resolve($window.d3);
// });
// }
// var scriptTag = $document[0].createElement('script');
// scriptTag.type = 'text/javascript';
// scriptTag.async = true;
// scriptTag.src = 'http://d3js.org/d3.v3.min.js';
// scriptTag.onreadystatechange = function() {
// if (this.readyState === 'complete') {
// onScriptLoad();
// }
// };
// scriptTag.onload = onScriptLoad;
//
// var s = $document[0].getElementsByTagName('body')[0];
// s.appendChild(scriptTag);
//
// return d3service;
// }
// ]);

/**
* @ngdoc overview
* @name uncertApp
Expand All @@ -20,15 +71,18 @@
'ngCookies',
'ui.bootstrap',
'uncertApp.authentication',
//'uncertApp.sparql',
'uncertApp.text'
'uncertApp.rdf',
'uncertApp.sparql',
//'uncertApp.text',
'uncertApp.dcjs'
])
.run(function() {
});
.run(function() {});


angular.module('uncertApp.templates', []);
angular.module('uncertApp.utils', ['uncertApp.templates']);
angular.module('uncertApp.authentication', ['ngCookies']);
angular.module('uncertApp.sparql', ['uncertApp.utils','uncertApp.authentication']);
angular.module('uncertApp.text', ['uncertApp.sparql', 'uncertApp.utils']);
angular.module('uncertApp.rdf', ['uncertApp.n3']);
angular.module('uncertApp.dcjs', ['uncertApp.dc', 'uncertApp.d3', 'uncertApp.crossfilter', 'uncertApp.colorbrewer']);
})();
22 changes: 12 additions & 10 deletions app/scripts/authentication/authentication.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@
// reset login status
AuthenticationService.ClearCredentials();

this.loginCallback = function(response) {
if(response.success) {
AuthenticationService.SetCredentials($scope.username, $scope.password);
$location.path('/');
this.loggedIn = true;
} else {
$scope.error = response.message;
$scope.dataLoading = false;
}
}.bind(this);

this.login = function () {
$scope.dataLoading = true;
AuthenticationService.Login($scope.username, $scope.password, function(response) {
if(response.success) {
AuthenticationService.SetCredentials($scope.username, $scope.password);
$location.path('/');
this.loggedIn = true;
} else {
$scope.error = response.message;
$scope.dataLoading = false;
}
}.bind(this));
AuthenticationService.Login($scope.username, $scope.password, this.loginCallback);
};
}

Expand Down
10 changes: 6 additions & 4 deletions app/scripts/authentication/authentication.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
'use strict';

function AuthenticationService($q, Base64, $http, $cookieStore, $rootScope) {
var deferred = $q.defer();
this.ready = deferred.promise;
this.deferred = $q.defer();
this.ready = this.deferred.promise;

$rootScope.globals = {};

this.Login = function(username, password, callback) {
/* Dummy authentication for testing, uses $timeout to simulate api call
Expand Down Expand Up @@ -42,13 +44,13 @@
$http.defaults.headers.common['Authorization'] = 'Basic ' + authdata; // jshint ignore:line
// $http.defaults.headers.common['Authorization'] = 'Basic ' + username + ':' + password; // jshint ignore:line
$cookieStore.put('globals', $rootScope.globals);
deferred.resolve();
this.deferred.resolve();
};

this.ClearCredentials = function() {
$rootScope.globals = {};
$cookieStore.remove('globals');
$http.defaults.headers.common.Authorization = 'Basic ';
$http.defaults.headers.common['Authorization'] = 'Basic '; // jshint ignore:line
};
}

Expand Down
Loading

0 comments on commit d57810b

Please sign in to comment.