I was successfully creating RDF Views in Virtuoso,but there are some problem
when I queried from Java,problem about some spatial function (but It work
when I query from virtuoso sparql end point)
public class IntersectsExample {
> public static void main(String[] args) {
// TODO Auto-generated method stub
String url;
if(args.length==0)
url="jdbc:virtuoso://localhost:1111";
else url = args[0];
VirtGraph graph = new VirtGraph("http://shanghai.com#",url,"dba","dba");
System.out.println(" define graph.getCount():= " + graph.getCount());
String qry = "prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> "+
"prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> " +
"prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n "+
"select ?label ?lat ?long <bif:st_distance>(?geo,?geo_x) as ?distance "+
"where {"+
"?x rdfs:label ?label_x."+
"?x geo:geometry ?geo_x. "+
"filter regex(?label_x,\"Clybaun\",\"i\"). "+
"?y rdfs:label ?label. "+
"?y geo:geometry ?geo;geo:lat ?lat;geo:long ?long "+
"filter (<bif:st_intersects>(?geo,?geo_x,20))." +
"} order by ?lat";
Query sparql = QueryFactory.create(qry);
VirtuosoQueryExecution vqe = VirtuosoQueryExecutionFactory.create(sparql,
graph);
ResultSet results = vqe.execSelect();
ResultSetFormatter.out(System.out, results, sparql);
}
}
The error is: *Exception in thread "main"
com.hp.hpl.jena.query.QueryParseException: Encountered " <IRIref>
"<bif:st_distance> "" at line 2, column 27.*
Anybody know what error is this?how could I fix it?