@@ -100,8 +100,10 @@ public void setUp(FrameworkConfiguration config, boolean reset) throws Exception
100100 userManager .createUser (config .getAuthSparqlUser (), config .getAuthSparqlPassword ());
101101 userManager .setDefaultRdfPermissions (config .getAuthSparqlUser (), 3 );
102102 userManager .grantRole (config .getAuthSparqlUser (), "SPARQL_UPDATE" );
103+ userManager .grantLOLook (config .getAuthSparqlUser ());
103104 try {
104105 userManager .grantRole ("SPARQL" , "SPARQL_UPDATE" );
106+ userManager .grantLOLook ("SPARQL" );
105107 } catch (Exception e ) {
106108 //role is already granted
107109 e .printStackTrace ();
@@ -134,6 +136,26 @@ public void setUp(FrameworkConfiguration config, boolean reset) throws Exception
134136 settingsModel .add (componentsModel );
135137 settingsModel .add (ontologyModel );
136138
139+ // add to settings virtuoso component without users/passwords
140+ queryString = "PREFIX foaf:<http://xmlns.com/foaf/0.1/> "
141+ + "PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> "
142+ + "PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> "
143+ + "PREFIX lds:<http://stack.linkeddata.org/ldis-schema/>" + " CONSTRUCT { <"
144+ + config .getFrameworkUri () + "> ?p ?o . " + "<" + config .getFrameworkUri ()
145+ + "> lds:integrates ?component ."
146+ + "?component rdfs:label ?label . ?component rdf:type ?type . "
147+ + "?component lds:providesService ?service . ?service rdf:type ?servicetype ."
148+ + "?service lds:serviceUrl ?serviceUrl .} " + " WHERE { <"
149+ + config .getFrameworkUri () + "> ?p ?o ." + "<" + config .getFrameworkUri ()
150+ + "> lds:integrates ?component ."
151+ + "?component rdfs:label ?label . ?component rdf:type ?type . "
152+ + "?component lds:providesService ?service . ?service rdf:type ?servicetype ."
153+ + "?service lds:serviceUrl ?serviceUrl .}" ;
154+ QueryExecution qexec = QueryExecutionFactory .create (queryString , configurationModel );
155+ Model triples = qexec .execConstruct ();
156+ settingsModel .add (triples );
157+ qexec .close ();
158+
137159 // write the initial settings model (default settings for new users)
138160 ByteArrayOutputStream os = new ByteArrayOutputStream ();
139161 settingsModel .write (os , "N-TRIPLES" );
@@ -161,7 +183,7 @@ public void setUp(FrameworkConfiguration config, boolean reset) throws Exception
161183 + " PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX lds: <http://stack.linkeddata.org/ldis-schema/> "
162184 + " SELECT ?accountName ?password ?mailto ?role WHERE { ?account rdf:type gkg:Account . ?account foaf:accountName ?accountName . "
163185 + " ?account lds:password ?password . ?account foaf:mbox ?mailto . ?account gkg:Role ?role . } " ;
164- QueryExecution qexec = QueryExecutionFactory .create (query , configurationModel );
186+ qexec = QueryExecutionFactory .create (query , configurationModel );
165187 ResultSet results = qexec .execSelect ();
166188 while (results .hasNext ()) {
167189 QuerySolution soln = results .next ();
0 commit comments