Skip to content
This repository was archived by the owner on Apr 22, 2022. It is now read-only.

Commit 4751451

Browse files
committed
small changes config and README
1 parent c79c578 commit 4751451

File tree

4 files changed

+65
-71
lines changed

4 files changed

+65
-71
lines changed

README.md

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,40 @@ The GeoKnow Generator provides workbench that integrates of tools developed with
44

55
## Install
66

7-
* __From Debian package__: The GeoKnow Generator UI is available as a debuian package, to install follow [these](http://stack.linkeddata.org/documentation/installation-of-a-local-generator-demonstrator/) instructions.
8-
9-
* __Form source__: You can use `maven pacakge` to package the souces in a war file and deploy it on a servlet container.
7+
* __From Debian package__: The GeoKnow Generator UI is available as a debuian package, to install follow [these](http://stack.linkeddata.org/documentation/installation-of-a-local-generator-demonstrator/) instructions. This is a preconfigured application that assumes that a triple store is installed in the localhost.
8+
* __Form source__: Follow the configuration instructiobs below, and use `maven pacakge` to package the souces in a war file and deploy it on a servlet container.
109

1110
These option will not install any integrated component from the stack and you require to install each one. You can choose to use again Debian packages following [these](http://stack.linkeddata.org/documentation/installation-of-a-local-generator-demonstrator/) instructions, or manually visiting each developer's component installation guides.
1211

1312
## Configuration
1413

15-
### Application configuration
16-
17-
1. Make a copy of the `src/main/resources/framework-configuration-template.ttl` to `src/main/resources/framework-configuration.ttl` and provide the ***REMOVED*** data.
14+
### Requirements
1815

19-
2. Have a clean triple store and make sure to have a user create in the lds:StorageService, the lds:SecuredSPARQLEndPointService user will be automatically created
2016

21-
3. Make a copy of the `src/main/webapp/WEB-INF/web-template.xml` to `src/main/webapp/WEB-INF/web.xml` and provide the ***REMOVED*** data.
17+
* Have a clean triple store and make sure to have a superuser created.
2218

19+
### Application configuration
2320

24-
Note that the endpoint has to support [UPDATE](http://www.w3.org/TR/2013/REC-sparql11-update-20130321/) service and [Graph Store HTTP Protocol](http://www.w3.org/TR/2013/REC-sparql11-http-rdf-update-20130321/)
25-
21+
1. Open the `src/main/resources/framework-configuration.ttl` and provide endpoints, users and password information in the lds:StorageService element. The lds:SecuredSPARQLEndPointService user will be automatically created in the setup.
2622

27-
## Optional Extra Configutation
23+
2. Open the `src/main/resources/framework-components.ttl` and make sure URLs for alll stack components are accurate.
2824

29-
Depending on the components you use in the Generator some extra configurations may be required.
25+
2. Edit `src/main/webapp/WEB-INF/web.xml` and provide the ***REMOVED*** data.
3026

31-
### Using Virtuoso Endpoint
3227

33-
If you have a Virtuoso Endpoint, you can configure the following:
28+
Note that the endpoint has to support [UPDATE](http://www.w3.org/TR/2013/REC-sparql11-update-20130321/) service and [Graph Store HTTP Protocol](http://www.w3.org/TR/2013/REC-sparql11-http-rdf-update-20130321/)
29+
30+
### Application setup
3431

35-
1. Enable SPARQL Update on a Virtuoso SPARQL by excecuting the following lines in the isql utility:
32+
To initalize the application the user is only required to navigate to the URL where the application has being deployed and a setup page will be shown. The application requires a system file (e.g. `/etc/generator/`) with write privileges for creating a init file that will be used as a flag for setting the system up.
3633

37-
$ isql-vt
38-
GRANT SPARQL_UPDATE TO "SPARQL"
39-
GRANT EXECUTE ON DB.DBA.L_O_LOOK TO "SPARQL"
34+
### Virtuoso Endpoint
4035

41-
2. [Enable CORS for Virtuoso](http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/VirtTipsAndTricksCORsEnableSPARQLURLs) SPARQL endpoint.
36+
Currently ontly Virtuoso store is supported and it has being tested in version 7.1. The Generator makes use of Virtuoso users management to allow the creation of private graphs and allow them to grant access to to specific users.
4237

43-
### Authentication configuration
38+
## Optional Extra Configutation
4439

40+
Depending on the components you use in the Generator some extra configurations may be required.
4541

4642

4743
### Using OntoWiki-Virtuoso

src/main/webapp/js/app.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,16 @@ app.config(function($routeSegmentProvider, $routeProvider)
174174
.up()
175175

176176
.segment('account', {
177-
templateUrl:'js/account/account.html' })
177+
templateUrl:'js/account/account.html',
178+
resolve: {
179+
settings: function (ConfigurationService) {
180+
return ConfigurationService.getSettings();
181+
}
182+
}})
178183
.within()
179184
.segment('preferences', {
180-
templateUrl: 'js/account/preferences/preferences.html' })
185+
templateUrl: 'js/account/preferences/preferences.html'
186+
})
181187
.up()
182188
.segment('system-setup', {
183189
templateUrl: 'system-setup.html',

src/main/webapp/js/services/config.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,14 @@ angular.module("app.configuration", [])
3535
var FRAMEWORK_URI;
3636
var FLAG_PATH;
3737
var NS;
38-
var DEFAULT_SETTINGS_GRAPH_URI;
39-
var GROUPS_GRAPH_URI;
38+
var DEFAULT_SETTINGS_GRAPH;
39+
var GROUPS_GRAPH;
4040
var FRAMEWORK_ONTOLOGY_NS;
4141
var ACCOUNTS_GRAPH;
4242

4343
var AUTH_ENDPOINT;
4444
var PUBLIC_ENDPOINT;
45-
var SETTINGS_GRAPH_URI;
46-
var GRAPH;
45+
var SETTINGS_GRAPH;
4746

4847
// a variable to lookup by prefix
4948
var prefixes;
@@ -179,26 +178,27 @@ angular.module("app.configuration", [])
179178

180179
var getDefaultSettingsGraph = function()
181180
{
182-
return DEFAULT_SETTINGS_GRAPH_URI;
181+
return DEFAULT_SETTINGS_GRAPH;
183182
};
184183

185-
var setDefaultSettingsGraph = function(default_settings_graph_uri)
184+
var setDefaultSettingsGraph = function(default_settings_graph)
186185
{
187-
DEFAULT_SETTINGS_GRAPH_URI = default_settings_graph_uri;
186+
DEFAULT_SETTINGS_GRAPH = default_settings_graph;
188187
};
189188

190-
var getGraph = function()
189+
var getSettingsGraph = function()
191190
{
192-
return SETTINGS_GRAPH_URI;
191+
return SETTINGS_GRAPH;
193192
};
194193

195-
var setGraph = function(uri) {
196-
SETTINGS_GRAPH_URI = uri;
197-
GRAPH = "<" + SETTINGS_GRAPH_URI + ">";
194+
var setSettingsGraph = function(uri) {
195+
SETTINGS_GRAPH = uri;
196+
// update settings with new graph
197+
read();
198198
};
199199

200200
var restoreDefault = function() {
201-
return setGraph(DEFAULT_SETTINGS_GRAPH_URI);
201+
return setSettingsGraph(DEFAULT_SETTINGS_GRAPH);
202202
};
203203

204204
var getSettings = function()
@@ -290,18 +290,18 @@ angular.module("app.configuration", [])
290290
};
291291

292292

293-
var read = function(graph)
293+
var read = function()
294294
{
295295
var deferred = $q.defer();
296296
var requestData = {
297297
format: "application/sparql-results+json",
298-
query: "SELECT * FROM <" + graph + ">"+ EOL
298+
query: "SELECT * FROM <" + SETTINGS_GRAPH + ">"+ EOL
299299
+ "WHERE { ?s ?p ?o }" + EOL
300300
+ "ORDER BY ?s ?p ?o",
301301
mode: "settings"
302302
};
303303

304-
console.log("readSettings from " + graph);
304+
console.log("readSettings from " + SETTINGS_GRAPH);
305305

306306
$http.post("RdfStoreProxy", $.param(requestData)).then(function (response) {
307307
settings = parseSparqlResults(response.data);
@@ -348,9 +348,9 @@ angular.module("app.configuration", [])
348348
var requestData = {
349349
format: "application/sparql-results+json",
350350
query: PREFIXES
351-
+ "DROP SILENT GRAPH " + GRAPH + EOL
352-
+ "CREATE SILENT GRAPH " + GRAPH + EOL
353-
+ "INSERT INTO " + GRAPH + EOL
351+
+ "DROP SILENT GRAPH <" + SETTINGS_GRAPH + ">" + EOL
352+
+ "CREATE SILENT GRAPH <" + SETTINGS_GRAPH + ">" + EOL
353+
+ "INSERT INTO <" + SETTINGS_GRAPH + ">" + EOL
354354
+ "{" + EOL
355355
+ data
356356
+ "}",
@@ -371,15 +371,15 @@ angular.module("app.configuration", [])
371371
};
372372

373373
var getGroupsGraph = function() {
374-
return GROUPS_GRAPH_URI;
374+
return GROUPS_GRAPH;
375375
};
376376

377-
var setGroupsGraph = function(groups_graph_uri) {
378-
GROUPS_GRAPH_URI = groups_graph_uri;
377+
var setGroupsGraph = function(groups_graph) {
378+
GROUPS_GRAPH = groups_graph;
379379
};
380380

381-
var setGroupsGraph = function(groups_graph_uri) {
382-
GROUPS_GRAPH_URI = groups_graph_uri;
381+
var setGroupsGraph = function(groups_graph) {
382+
GROUPS_GRAPH = groups_graph;
383383
};
384384

385385
var getFrameworkOntologyNS = function() {
@@ -411,8 +411,6 @@ angular.module("app.configuration", [])
411411
setAuthEndpoint : setAuthEndpoint,
412412
getDefaultSettingsGraph : getDefaultSettingsGraph,
413413
setDefaultSettingsGraph : setDefaultSettingsGraph,
414-
getGraph : getGraph,
415-
setGraph : setGraph,
416414
getGroupsGraph : getGroupsGraph,
417415
setGroupsGraph : setGroupsGraph,
418416
getFrameworkUri : getFrameworkUri,
@@ -422,6 +420,8 @@ angular.module("app.configuration", [])
422420
getAccountsGraph : getAccountsGraph,
423421
setAccountsGraph : setAccountsGraph,
424422
restoreDefault : restoreDefault,
423+
setSettingsGraph : setSettingsGraph,
424+
getSettingsGraph : getSettingsGraph,
425425
getSettings : getSettings,
426426
select : select,
427427
write : write,

src/main/webapp/js/services/configuration-service.js

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ module.factory('ConfigurationService', function ($q, AccountService, Config, $ht
77
var SettingsService = {
88
getSettings : function(){
99
var defer = $q.defer();
10-
if(Config.getGraph() == undefined){
10+
if(Config.getSettingsGraph() == undefined){
1111
$http.get("rest/config").then(
1212
function (response) {
1313
Config.setFrameworkUri(response.data.frameworkUri);
1414
Config.setNS(response.data.ns);
1515
Config.setDefaultSettingsGraph(response.data.defaultSettingsGraphUri);
16-
Config.setGraph(response.data.defaultSettingsGraphUri);
16+
Config.setSettingsGraph(response.data.defaultSettingsGraphUri);
1717
Config.setGroupsGraph(response.data.groupsGraphUri);
1818
Config.setFrameworkOntologyNS(response.data.frameworkOntologyNs);
1919
Config.setAccountsGraph(response.data.accountsGraph);
@@ -22,22 +22,23 @@ module.factory('ConfigurationService', function ($q, AccountService, Config, $ht
2222
Config.setFlagPath(response.data.flagPath);
2323
Config.namespaces[Config.getNS()] = ":";
2424
Config.buildPrefixesString();
25-
console.log("Settings Graph:" + Config.getGraph());
26-
Config.read(Config.getGraph()).then(function(settings){
27-
console.log("settings");
28-
console.log(settings);
25+
Config.read().then(function(settings){
26+
var currentAccount = angular.copy(AccountService.getAccount());
27+
console.log("user:" +currentAccount.user);
28+
// Try to get here the user's settings graph
2929
defer.resolve(settings);
3030
});
31+
3132
}, function(response){
3233
var message = ServerErrorResponse.getMessage(response.status);
3334
flash.error = message;
3435
})
3536
} else{
36-
if( AccountService.isLogged() ){
37-
console.log("get the settings graph of the user");
38-
console.log(AccountService.getAccountURI());
39-
}
40-
defer.resolve(Config.getSettings);
37+
// if( AccountService.isLogged() ){
38+
// console.log("get the settings graph of the user");
39+
// console.log(AccountService.getAccountURI());
40+
// }
41+
defer.resolve(Config.getSettings());
4142
}
4243
return defer.promise;
4344
},
@@ -59,19 +60,10 @@ module.factory('ConfigurationService', function ($q, AccountService, Config, $ht
5960
},
6061

6162
getSPARQLEndpoint: function () {
62-
// var settings = Config.getSettings();
63-
// console.log(Config.getFrameworkUri());
64-
// console.log(settings);
65-
// var endpoint = settings[Config.getFrameworkUri()]["gkg:authEndpoint"][0];
66-
// var endpointUrl = settings[endpoint]["lds:serviceUrl"][0];
6763
return Config.getAuthEndpoint();
6864
},
6965

7066
getPublicSPARQLEndpoint: function () {
71-
// var settings = Config.getSettings();
72-
// var endpoint = settings[Config.getFrameworkUri()]["gkg:publicEndpoint"][0];
73-
// var endpointUrl = settings[endpoint]["lds:serviceUrl"][0];
74-
// return endpointUrl;
7567
return Config.getEndpoint();
7668
},
7769

@@ -96,15 +88,15 @@ module.factory('ConfigurationService', function ($q, AccountService, Config, $ht
9688
},
9789

9890
getDefaultSettingsGraph: function () {
99-
return Config.getGraph();
91+
return Config.getDefaultSettingsGraph();
10092
},
10193

10294
getSettingsGraph: function () {
103-
return Config.getGraph();
95+
return Config.getSettingsGraph();
10496
},
10597

10698
setSettingsGraph: function (uri) {
107-
Config.setGraph(uri);
99+
Config.setSettingsGraph(uri);
108100
},
109101

110102
restoreDefaultSettingsGraph: function () {

0 commit comments

Comments
 (0)