0

I use the code below for get hasLongitude and hasLatitude from yago with java use virtuoso but I don't receive anything :(( Is there any problem in this code??

VirtGraph set = new VirtGraph ("jdbc:virtuoso://localhost:1111", "dba", "dba"); 
        Query sparql = QueryFactory.create("PREFIX yago: <http://yago-knowledge.org/resource/> " + 
             "SELECT DISTINCT ?long ?lat " + 
             " FROM <http://yago-knowledge.org/resource> " + 
             " WHERE {" + 
             " yago:London yago:hasLatitude ?long. " + 
             " yago:London yago:hasLongitude ?lat. " + 
             " }"); 
        VirtuosoQueryExecution vqe = VirtuosoQueryExecutionFactory.create (sparql, set); 
        ResultSet results = vqe.execSelect();
        while (results.hasNext()) { 
             QuerySolution rs = results.nextSolution(); 
             RDFNode s = rs.get("long"); 
             RDFNode p = rs.get("lat"); 
             System.out.println(" { " + s + " " + p + " . }"); }
eddie
  • 1,252
  • 3
  • 15
  • 20
  • From AKSW (not enough rep to comment) : Please give some details *Which data have you loaded? Is the namespace correct? Does it work on another endpoint?* – Serge Ballesta Apr 18 '15 at 21:05
  • I import : - yagoGeonamesClasses - yagoGeonamesClassIds - yagoGeonamesData - yagoGeonamesEntityIds - yagoGeonamesGlosses - yagoGeonamesOnlyData --When i try this query in lSPARQL Execution on localhost,i recieve a list of : long and lat – Thanh Nguyen Apr 19 '15 at 11:56

0 Answers0