I already tried with all combinations as below:
MAPPING
FROM SQL {
SELECT * FROM public.poisviewTest
}
TO {
?subject a geo:Geometry;
# geo:asWKT "Point('{?longP ?latP}'')"^^geo:wktLiteral ;
# geo:asWKT "Point('{longP latP}'')"^^geo:wktLiteral ;
# geo:asWKT "Point(''?longP ?latP'')"^^geo:wktLiteral ;
# geo:asWKT "Point(''longP latP'')"^^geo:wktLiteral ;
# geo:asWKT "Point('longP latP')"^^geo:wktLiteral ;
# geo:asWKT "Point('?longP ?latP')"^^geo:wktLiteral ;
# geo:asWKT "Point('?longP ?latP')"^^geo:wktLiteral ;
geo:asWKT "Point(?longP ?latP)"^^geo:wktLiteral ;
} WHERE {
BIND(template("[http://example.com/v2#points/{poiid} AS ?subject))
BIND(xsd:float(?lat) AS ?latP)
BIND(xsd:float(?long) AS ?longP)
}
All of the above forms do not produce the desired results, i.e. Points with actual coordinate values.
Regarding to the usage of BIND function, I tried in different forms as below:
1. When I use the following BIND form:
MAPPING
FROM SQL {
SELECT * FROM public.poisviewTest
}
TO {
?subject a geo:Geometry;
geo:asWKT ?location.
} WHERE {
BIND(template("[http://example.com/v2#points/{poiid} AS ?subject))
BIND(xsd:float(?lat) AS ?latP)
BIND(xsd:float(?long) AS ?longP)
BIND(CONCAT("Point(", ?longP, " ", ?latP, ")")^^geo:wktLiteral as ?location)
}
I get this exception:
ERROR 2019-07-16 15:04:18,929 [stardog-user-11] com.complexible.stardog.virtual.DefaultVirtualGraphRegistry:createVirtualGraph(314): Cannot initialize virtual graph fqNearByFeatureTest
com.complexible.stardog.plan.parser.QueryParseException: Encountered " "^^" "^^ "" at line 38, column 49.
Was expecting one of:
"=" ...
"!=" ...
">" ...
"<" ...
"<=" ...
">=" ...
"||" ...
"&&" ...
"+" ...
"-" ...
"" ...
"/" ...
"as" ...
"in" ...
"not in" ...
<INTEGER_POSITIVE> ...
<INTEGER_NEGATIVE> ...
<DECIMAL_POSITIVE> ...
<DECIMAL_NEGATIVE> ...
<DOUBLE_POSITIVE> ...
<DOUBLE_NEGATIVE> ...
at com.complexible.stardog.plan.parser.QueryParserImpl.parseDatasourceMappings(QueryParserImpl.java:516) ~[stardog-6.2.2.jar:?]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsMappings.parseSms2Mappings(RdbmsMappings.java:162) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsMappings.parseOrGenerateMappings(RdbmsMappings.java:122) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsMappings.parseOrGenerateMappings(RdbmsMappings.java:107) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsMappings.parseOrGenerateMappings(RdbmsMappings.java:92) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsVirtualGraphFactory.create(RdbmsVirtualGraphFactory.java:68) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsVirtualGraphFactory.create(RdbmsVirtualGraphFactory.java:44) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry.createVirtualGraph(DefaultVirtualGraphRegistry.java:311) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry.createVirtualGraph(DefaultVirtualGraphRegistry.java:297) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry.add(DefaultVirtualGraphRegistry.java:171) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.SecuredVirtualGraphRegistry.add(SecuredVirtualGraphRegistry.java:133) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.protocols.http.server.virtual.admin.VirtualGraphHttpService.addVG(VirtualGraphHttpService.java:344) ~[stardog-virtual-protocols-http-server-6.2.2.jar:?]
at com.complexible.stardog.protocols.http.server.virtual.admin.VirtualGraphHttpService.update(VirtualGraphHttpService.java:153) ~[stardog-virtual-protocols-http-server-6.2.2.jar:?]
at com.stardog.http.server.undertow.jaxrs.ExtractRoutes.lambda$handleIt$5(ExtractRoutes.java:192) ~[stardog-protocols-http-server-6.2.2.jar:?]
at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120) [shiro-core-1.2.3.jar:1.2.3]
at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108) [shiro-core-1.2.3.jar:1.2.3]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
Caused by: com.complexible.common.rdf.query.parser.sparql.ast.ParseException: Encountered " "^^" "^^ "" at line 38, column 49.
Was expecting one of:
"=" ...
"!=" ...
">" ...
"<" ...
"<=" ...
">=" ...
"||" ...
"&&" ...
"+" ...
"-" ...
"" ...
"/" ...
"as" ...
"in" ...
"not in" ...
<INTEGER_POSITIVE> ...
<INTEGER_NEGATIVE> ...
<DECIMAL_POSITIVE> ...
<DECIMAL_NEGATIVE> ...
<DOUBLE_POSITIVE> ...
<DOUBLE_NEGATIVE> ...
at com.complexible.common.rdf.query.parser.sparql.ast.SyntaxTreeBuilder.generateParseException(SyntaxTreeBuilder.java:10389) ~[stardog-utils-rdf-6.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.SyntaxTreeBuilder.jj_consume_token(SyntaxTreeBuilder.java:10242) ~[stardog-utils-rdf-6.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.SyntaxTreeBuilder.Bind(SyntaxTreeBuilder.java:7784) ~[stardog-utils-rdf-6.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.SyntaxTreeBuilder.ScopeTerminator(SyntaxTreeBuilder.java:2889) ~[stardog-utils-rdf-6.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.SyntaxTreeBuilder.Scopes(SyntaxTreeBuilder.java:2478) ~[stardog-utils-rdf-6.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.SyntaxTreeBuilder.Scopes(SyntaxTreeBuilder.java:2534) ~[stardog-utils-rdf-6.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.SyntaxTreeBuilder.Scopes(SyntaxTreeBuilder.java:2534) ~[stardog-utils-rdf-6.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.SyntaxTreeBuilder.Scopes(SyntaxTreeBuilder.java:2534) ~[stardog-utils-rdf-6.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.SyntaxTreeBuilder.GroupGraphPattern(SyntaxTreeBuilder.java:2430) ~[stardog-utils-rdf-6.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.SyntaxTreeBuilder.WhereClause(SyntaxTreeBuilder.java:1386) ~[stardog-utils-rdf-6.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.SyntaxTreeBuilder.Mapping(SyntaxTreeBuilder.java:9362) ~[stardog-utils-rdf-6.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.SyntaxTreeBuilder.Mappings(SyntaxTreeBuilder.java:9247) ~[stardog-utils-rdf-6.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl.parseDatasourceMappings(QueryParserImpl.java:497) ~[stardog-6.2.2.jar:?]
... 18 more
ERROR 2019-07-16 15:04:18,930 [stardog-user-11] com.complexible.stardog.protocols.http.server.StardogHttpServiceLoader:accept(232): An exception was handled by the server: Encountered " "^^" "^^ "" at line 38, column 49.
Was expecting one of:
"=" ...
"!=" ...
">" ...
"<" ...
"<=" ...
">=" ...
"||" ...
"&&" ...
"+" ...
"-" ...
"*" ...
"/" ...
"as" ...
"in" ...
"not in" ...
<INTEGER_POSITIVE> ...
<INTEGER_NEGATIVE> ...
<DECIMAL_POSITIVE> ...
<DECIMAL_NEGATIVE> ...
<DOUBLE_POSITIVE> ...
<DOUBLE_NEGATIVE> ...
2. When I use the following BIND form:
MAPPING
FROM SQL {
SELECT * FROM public.poisviewTest
}
TO {
?subject a geo:Geometry;
geo:asWKT ?location.
} WHERE {
BIND(template("[http://example.com/v2#points/{poiid} AS ?subject))
BIND(xsd:float(?lat) AS ?latP)
BIND(xsd:float(?long) AS ?longP)
BIND(geo:wktLiteral(concat('Point(', STR(?longP), ' ', STR(?latP), ')' )) as ?location)
}
I get this exception:
ERROR 2019-07-16 15:02:30,412 [stardog-user-25] com.complexible.stardog.virtual.DefaultVirtualGraphRegistry:createVirtualGraph(314): Cannot initialize virtual graph fqNearByFeatureTest
com.complexible.stardog.plan.PlanException: Unrecognized function: http://www.opengis.net/ont/geosparql#wktLiteral
at com.complexible.stardog.plan.parser.QueryParserImpl.parseDatasourceMappings(QueryParserImpl.java:528) ~[stardog-6.2.2.jar:?]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsMappings.parseSms2Mappings(RdbmsMappings.java:162) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsMappings.parseOrGenerateMappings(RdbmsMappings.java:122) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsMappings.parseOrGenerateMappings(RdbmsMappings.java:107) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsMappings.parseOrGenerateMappings(RdbmsMappings.java:92) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsVirtualGraphFactory.create(RdbmsVirtualGraphFactory.java:68) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsVirtualGraphFactory.create(RdbmsVirtualGraphFactory.java:44) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry.createVirtualGraph(DefaultVirtualGraphRegistry.java:311) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry.createVirtualGraph(DefaultVirtualGraphRegistry.java:297) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry.add(DefaultVirtualGraphRegistry.java:171) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.SecuredVirtualGraphRegistry.add(SecuredVirtualGraphRegistry.java:133) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.protocols.http.server.virtual.admin.VirtualGraphHttpService.addVG(VirtualGraphHttpService.java:344) ~[stardog-virtual-protocols-http-server-6.2.2.jar:?]
at com.complexible.stardog.protocols.http.server.virtual.admin.VirtualGraphHttpService.update(VirtualGraphHttpService.java:153) ~[stardog-virtual-protocols-http-server-6.2.2.jar:?]
at com.stardog.http.server.undertow.jaxrs.ExtractRoutes.lambda$handleIt$5(ExtractRoutes.java:192) ~[stardog-protocols-http-server-6.2.2.jar:?]
at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120) [shiro-core-1.2.3.jar:1.2.3]
at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108) [shiro-core-1.2.3.jar:1.2.3]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
Caused by: java.lang.UnsupportedOperationException: Unrecognized function: http://www.opengis.net/ont/geosparql#wktLiteral
at com.complexible.stardog.plan.filter.functions.FunctionRegistry.get(FunctionRegistry.java:162) ~[stardog-6.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$ExpressionBuilder.visit(QueryParserImpl.java:3923) ~[stardog-6.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$ExpressionBuilder.visit(QueryParserImpl.java:3773) ~[stardog-6.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTFunctionCall.jjtAccept(ASTFunctionCall.java:20) ~[stardog-utils-rdf-6.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$ExpressionBuilder.toExpression(QueryParserImpl.java:4081) ~[stardog-6.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$ExpressionBuilder.access$600(QueryParserImpl.java:3773) ~[stardog-6.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.buildForBinder(QueryParserImpl.java:1469) ~[stardog-6.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:1441) ~[stardog-6.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:702) ~[stardog-6.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTBind.jjtAccept(ASTBind.java:20) ~[stardog-utils-rdf-6.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:792) ~[stardog-6.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:702) ~[stardog-6.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTScope.jjtAccept(ASTScope.java:22) ~[stardog-utils-rdf-6.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.SimpleNode.childrenAccept(SimpleNode.java:162) ~[stardog-utils-rdf-6.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:824) ~[stardog-6.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:702) ~[stardog-6.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTGraphPatternGroup.jjtAccept(ASTGraphPatternGroup.java:19) ~[stardog-utils-rdf-6.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:2866) ~[stardog-6.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:702) ~[stardog-6.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTWhereClause.jjtAccept(ASTWhereClause.java:19) ~[stardog-utils-rdf-6.2.2.jar:?]
at com.complexible.stardog.plan.parser.DatasourceMappingParser.parse(DatasourceMappingParser.java:139) ~[stardog-6.2.2.jar:?]
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_212]
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) ~[?:1.8.0_212]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_212]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_212]
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_212]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_212]
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) ~[?:1.8.0_212]
at com.complexible.stardog.plan.parser.QueryParserImpl.parseDatasourceMappings(QueryParserImpl.java:513) ~[stardog-6.2.2.jar:?]
... 18 more
ERROR 2019-07-16 15:02:30,414 [stardog-user-25] com.stardog.http.server.undertow.ErrorHandling:writeError(138): Unexpected error on the server
com.complexible.stardog.plan.PlanException: Unrecognized function: http://www.opengis.net/ont/geosparql#wktLiteral
at com.complexible.stardog.plan.parser.QueryParserImpl.parseDatasourceMappings(QueryParserImpl.java:528) ~[stardog-6.2.2.jar:?]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsMappings.parseSms2Mappings(RdbmsMappings.java:162) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsMappings.parseOrGenerateMappings(RdbmsMappings.java:122) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsMappings.parseOrGenerateMappings(RdbmsMappings.java:107) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsMappings.parseOrGenerateMappings(RdbmsMappings.java:92) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsVirtualGraphFactory.create(RdbmsVirtualGraphFactory.java:68) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsVirtualGraphFactory.create(RdbmsVirtualGraphFactory.java:44) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry.createVirtualGraph(DefaultVirtualGraphRegistry.java:311) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry.createVirtualGraph(DefaultVirtualGraphRegistry.java:297) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry.add(DefaultVirtualGraphRegistry.java:171) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.SecuredVirtualGraphRegistry.add(SecuredVirtualGraphRegistry.java:133) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.protocols.http.server.virtual.admin.VirtualGraphHttpService.addVG(VirtualGraphHttpService.java:344) ~[stardog-virtual-protocols-http-server-6.2.2.jar:?]
at com.complexible.stardog.protocols.http.server.virtual.admin.VirtualGraphHttpService.update(VirtualGraphHttpService.java:153) ~[stardog-virtual-protocols-http-server-6.2.2.jar:?]
at com.stardog.http.server.undertow.jaxrs.ExtractRoutes.lambda$handleIt$5(ExtractRoutes.java:192) ~[stardog-protocols-http-server-6.2.2.jar:?]
at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120) [shiro-core-1.2.3.jar:1.2.3]
at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108) [shiro-core-1.2.3.jar:1.2.3]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
Caused by: java.lang.UnsupportedOperationException: Unrecognized function: http://www.opengis.net/ont/geosparql#wktLiteral
at com.complexible.stardog.plan.filter.functions.FunctionRegistry.get(FunctionRegistry.java:162) ~[stardog-6.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$ExpressionBuilder.visit(QueryParserImpl.java:3923) ~[stardog-6.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$ExpressionBuilder.visit(QueryParserImpl.java:3773) ~[stardog-6.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTFunctionCall.jjtAccept(ASTFunctionCall.java:20) ~[stardog-utils-rdf-6.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$ExpressionBuilder.toExpression(QueryParserImpl.java:4081) ~[stardog-6.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$ExpressionBuilder.access$600(QueryParserImpl.java:3773) ~[stardog-6.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.buildForBinder(QueryParserImpl.java:1469) ~[stardog-6.2.2.jar:?]
at .....com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:702) ~[stardog-6.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTScope.jjtAccept(ASTScope.java:22) ~[stardog-utils-rdf-6.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.SimpleNode.childrenAccept(SimpleNode.java:162) ~[stardog-utils-rdf-6.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:824) ~[stardog-6.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:702) ~[stardog-6.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTGraphPatternGroup.jjtAccept(ASTGraphPatternGroup.java:19) ~[stardog-utils-rdf-6.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:2866) ~[stardog-6.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:702) ~[stardog-6.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTWhereClause.jjtAccept(ASTWhereClause.java:19) ~[stardog-utils-rdf-6.2.2.jar:?]
at com.complexible.stardog.plan.parser.DatasourceMappingParser.parse(DatasourceMappingParser.java:139) ~[stardog-6.2.2.jar:?]
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_212]
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) ~[?:1.8.0_212]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_212]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_212]
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_212]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_212]
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) ~[?:1.8.0_212]
at com.complexible.stardog.plan.parser.QueryParserImpl.parseDatasourceMappings(QueryParserImpl.java:513) ~[stardog-6.2.2.jar:?]
... 18 more
3. When I use the following BIND form:
MAPPING
FROM SQL {
SELECT * FROM public.poisviewTest
}
TO {
?subject a geo:Geometry;
geo:asWKT ?location.
} WHERE {
BIND(template("[http://example.com/v2#points/{poiid} AS ?subject))
BIND(xsd:float(?lat) AS ?latP)
BIND(xsd:float(?long) AS ?longP)
BIND(strdt(concat('Point(', STR(?longP) , ' ', STR(?latP), ')' ), geo:wktLiteral) as ?location)
}
I get this exception:
ERROR 2019-07-16 14:42:37,848 [stardog-user-28] com.complexible.stardog.virtual.DefaultVirtualGraphRegistry:createVirtualGraph(314): Cannot initialize virtual graph fqNearByFeatureTest
com.complexible.stardog.StardogException: Binding functions other than template() and cast are unsupported. Found StrDt for variable location
at com.complexible.stardog.virtual.vega.rdbms.RdbmsMappings.lambda$buildTriplesMapsFromSms2Mapping$11(RdbmsMappings.java:233) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.common.base.Functional.lambda$mapEntryBiFunction$0(Functional.java:27) ~[stardog-utils-common-6.2.2.jar:?]
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_212]
at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1699) ~[?:1.8.0_212]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_212]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_212]
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_212]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_212]
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) ~[?:1.8.0_212]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsMappings.buildTriplesMapsFromSms2Mapping(RdbmsMappings.java:236) ~[stardog-virtual-core-6.2.2.jar:?]
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_212]
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) ~[?:1.8.0_212]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_212]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_212]
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_212]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_212]
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) ~[?:1.8.0_212]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsMappings.parseSms2Mappings(RdbmsMappings.java:175) ~[stardog-virtual-core-6.2.2.jar:?]
at .....
at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry.createVirtualGraph(DefaultVirtualGraphRegistry.java:311) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry.createVirtualGraph(DefaultVirtualGraphRegistry.java:297) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry.add(DefaultVirtualGraphRegistry.java:171) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.SecuredVirtualGraphRegistry.add(SecuredVirtualGraphRegistry.java:133) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.protocols.http.server.virtual.admin.VirtualGraphHttpService.addVG(VirtualGraphHttpService.java:344) ~[stardog-virtual-protocols-http-server-6.2.2.jar:?]
at com.complexible.stardog.protocols.http.server.virtual.admin.VirtualGraphHttpService.update(VirtualGraphHttpService.java:153) ~[stardog-virtual-protocols-http-server-6.2.2.jar:?]
at com.stardog.http.server.undertow.jaxrs.ExtractRoutes.lambda$handleIt$5(ExtractRoutes.java:192) ~[stardog-protocols-http-server-6.2.2.jar:?]
at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120) [shiro-core-1.2.3.jar:1.2.3]
at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108) [shiro-core-1.2.3.jar:1.2.3]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
Caused by: com.complexible.stardog.StardogException: Binding functions other than template() and cast are unsupported. Found StrDt for variable location
at com.complexible.stardog.virtual.vega.mapping.MappingTermMapBuilder.buildTermMap(MappingTermMapBuilder.java:113) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsMappings.lambda$null$10(RdbmsMappings.java:228) ~[stardog-virtual-core-6.2.2.jar:?]
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_212]
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_212]
at java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1556) ~[?:1.8.0_212]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_212]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_212]
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:1.8.0_212]
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:1.8.0_212]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_212]
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) ~[?:1.8.0_212]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsMappings.lambda$buildTriplesMapsFromSms2Mapping$11(RdbmsMappings.java:229) ~[stardog-virtual-core-6.2.2.jar:?]
... 34 more
ERROR 2019-07-16 14:42:37,850 [stardog-user-28] com.stardog.http.server.undertow.ErrorHandling:writeError(138): Unexpected error on the server
com.complexible.stardog.StardogException: Binding functions other than template() and cast are unsupported. Found StrDt for variable location
at com.complexible.stardog.virtual.vega.rdbms.RdbmsMappings.lambda$buildTriplesMapsFromSms2Mapping$11(RdbmsMappings.java:233) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.common.base.Functional.lambda$mapEntryBiFunction$0(Functional.java:27) ~[stardog-utils-common-6.2.2.jar:?]
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_212]
at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1699) ~[?:1.8.0_212]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_212]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_212]
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_212]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_212]
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) ~[?:1.8.0_212]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsMappings.buildTriplesMapsFromSms2Mapping(RdbmsMappings.java:236) ~[stardog-virtual-core-6.2.2.jar:?]
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_212]
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) ~[?:1.8.0_212]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_212]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_212]
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_212]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_212]
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) ~[?:1.8.0_212]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsMappings.parseSms2Mappings(RdbmsMappings.java:175) ~[stardog-virtual-core-6.2.2.jar:?]
at ......
at com.complexible.stardog.protocols.http.server.virtual.admin.VirtualGraphHttpService.update(VirtualGraphHttpService.java:153) ~[stardog-virtual-protocols-http-server-6.2.2.jar:?]
at com.stardog.http.server.undertow.jaxrs.ExtractRoutes.lambda$handleIt$5(ExtractRoutes.java:192) ~[stardog-protocols-http-server-6.2.2.jar:?]
......[?:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
Caused by: com.complexible.stardog.StardogException: Binding functions other than template() and cast are unsupported. Found StrDt for variable location
at com.complexible.stardog.virtual.vega.mapping.MappingTermMapBuilder.buildTermMap(MappingTermMapBuilder.java:113) ~[stardog-virtual-core-6.2.2.jar:?]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsMappings.lambda$null$10(RdbmsMappings.java:228) ~[stardog-virtual-core-6.2.2.jar:?]
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_212]
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_212]
at java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1556) ~[?:1.8.0_212]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_212]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_212]
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:1.8.0_212]
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:1.8.0_212]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_212]
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) ~[?:1.8.0_212]
at com.complexible.stardog.virtual.vega.rdbms.RdbmsMappings.lambda$buildTriplesMapsFromSms2Mapping$11(RdbmsMappings.java:229) ~[stardog-virtual-core-6.2.2.jar:?]
... 34 more