Use spaces instead of tabs
This commit is contained in:
parent
8445045290
commit
506abd85c0
|
@ -71,22 +71,18 @@ public class App {
|
||||||
printResource(infModel, "NintendoConsole");
|
printResource(infModel, "NintendoConsole");
|
||||||
|
|
||||||
// Let's define a bunch of queries
|
// Let's define a bunch of queries
|
||||||
Query queryReleaseYear = QueryFactory.create("PREFIX : <" + Generator.OWN_URI + ">" + "SELECT ?console\n"
|
Query queryReleaseYear = QueryFactory.create("PREFIX : <" + Generator.OWN_URI + ">" + "SELECT ?console\n" + "WHERE {\n"
|
||||||
+ "WHERE {\n" + " ?console :madeBy :Nintendo .\n" + " ?console :releaseYear ?releaseYear . \n"
|
+ " ?console :madeBy :Nintendo .\n" + " ?console :releaseYear ?releaseYear . \n" + " FILTER(?releaseYear > 2015)\n" + "}");
|
||||||
+ " FILTER(?releaseYear > 2015)\n" + "}");
|
|
||||||
|
|
||||||
Query queryNintendoConsoles = QueryFactory
|
Query queryNintendoConsoles = QueryFactory.create("PREFIX : <" + Generator.OWN_URI + ">" + "PREFIX rdf: <" + Generator.RDF_URI + ">"
|
||||||
.create("PREFIX : <" + Generator.OWN_URI + ">" + "PREFIX rdf: <" + Generator.RDF_URI + ">"
|
|
||||||
+ "SELECT ?console\n" + "WHERE {\n" + " ?console rdf:type :NintendoConsole .\n" + "}");
|
+ "SELECT ?console\n" + "WHERE {\n" + " ?console rdf:type :NintendoConsole .\n" + "}");
|
||||||
|
|
||||||
Query queryCEOForConsole = QueryFactory.create("PREFIX : <" + Generator.OWN_URI + ">" + "PREFIX rdf: <"
|
Query queryCEOForConsole = QueryFactory.create("PREFIX : <" + Generator.OWN_URI + ">" + "PREFIX rdf: <" + Generator.RDF_URI + ">" + "PREFIX rdfs: <"
|
||||||
+ Generator.RDF_URI + ">" + "PREFIX rdfs: <" + Generator.RDFS_URI + ">" + "PREFIX foaf: <"
|
+ Generator.RDFS_URI + ">" + "PREFIX foaf: <" + Generator.FOAF_URI + ">" + "CONSTRUCT {\n" + " ?ceo :isRelatedToConsole ?console .\n" + "}\n"
|
||||||
+ Generator.FOAF_URI + ">" + "CONSTRUCT {\n" + " ?ceo :isRelatedToConsole ?console .\n" + "}\n"
|
+ "WHERE {\n" + " ?console rdf:type :GameConsole .\n" + " ?console :madeBy ?org .\n" + " ?org :ceo ?ceo .\n"
|
||||||
+ "WHERE {\n" + " ?console rdf:type :GameConsole .\n" + " ?console :madeBy ?org .\n"
|
+ " ?ceo rdf:type foaf:Person .\n" + "}\n" + "");
|
||||||
+ " ?org :ceo ?ceo .\n" + " ?ceo rdf:type foaf:Person .\n" + "}\n" + "");
|
|
||||||
|
|
||||||
Query queryAll = QueryFactory
|
Query queryAll = QueryFactory.create("PREFIX : <" + Generator.OWN_URI + ">" + " " + " SELECT ?s ?p ?p WHERE {" + "?s ?p ?o .}");
|
||||||
.create("PREFIX : <" + Generator.OWN_URI + ">" + " " + " SELECT ?s ?p ?p WHERE {" + "?s ?p ?o .}");
|
|
||||||
|
|
||||||
// Let's execute one query and print its results
|
// Let's execute one query and print its results
|
||||||
QueryExecution queryExecLocalConsoles = QueryExecutionFactory.create(queryAll, infModel);
|
QueryExecution queryExecLocalConsoles = QueryExecutionFactory.create(queryAll, infModel);
|
||||||
|
@ -99,12 +95,10 @@ public class App {
|
||||||
|
|
||||||
// Let's do more
|
// Let's do more
|
||||||
QueryExecution queryExecLocalReleaseDate = QueryExecutionFactory.create(queryCEOForConsole, infModel);
|
QueryExecution queryExecLocalReleaseDate = QueryExecutionFactory.create(queryCEOForConsole, infModel);
|
||||||
QueryExecution queryExecRemoteReleaseDate = QueryExecutionFactory.sparqlService(SPARQL_ENDPOINT,
|
QueryExecution queryExecRemoteReleaseDate = QueryExecutionFactory.sparqlService(SPARQL_ENDPOINT, queryReleaseYear);
|
||||||
queryReleaseYear);
|
|
||||||
|
|
||||||
QueryExecution queryExecLocalCEOtoConsole = QueryExecutionFactory.create(queryCEOForConsole, infModel);
|
QueryExecution queryExecLocalCEOtoConsole = QueryExecutionFactory.create(queryCEOForConsole, infModel);
|
||||||
QueryExecution queryExecRemoteCEOtoConsole = QueryExecutionFactory.sparqlService(SPARQL_ENDPOINT,
|
QueryExecution queryExecRemoteCEOtoConsole = QueryExecutionFactory.sparqlService(SPARQL_ENDPOINT, queryCEOForConsole);
|
||||||
queryCEOForConsole);
|
|
||||||
|
|
||||||
System.out.println(">> Doing local release date query");
|
System.out.println(">> Doing local release date query");
|
||||||
printQueryResult(queryExecLocalReleaseDate);
|
printQueryResult(queryExecLocalReleaseDate);
|
||||||
|
|
Loading…
Reference in New Issue