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