I encountered a problem querying spatial data based on multiple RDF-files.
I created a spatial index file and inserted an IFC-RDF file as well as an SHP-RDF file.
Both files contain spatial WKT-literals.
thank for your quick reply.
I indeed didn’t configure my Stardog to use enhanced polygons.
In the meanwhile tried to configure my stardog.properties file but not sure i managed to do that properly.
I restarted stardog server, but face the same problems performing the spatial query.
Probably stardog.properties is still not configured correct. -> I will need to do a bit more research on that part.
thanks already for the suggestion about enhanced polygons!
What exact jar did you download? I’m always a little confused when trying to locate the right one. There’s jts and jts-core artifacts and one from vividsolutions at 1.14 and one from location tech at 1.15. The Stardog docs recommends com.vividsolutions:jts-core:1.14
If you would like to include your stardog.properties file I’d be happy to take a look and see if I can spot anything wrong to help get you going.
I did download the jts-core-1.14.0.jar and located it on STARDOG_HOME/server/ext.
the properties-file is located on STARDOG_HOME.
I took the one which is posted on GitHub and opened it on my GitHub Desktop.
(attached a jpg of it because attachment of file itself gave an error.)
ERROR 2018-04-05 21:22:32,277 [stardog-user-9] com.complexible.stardog.protocols.http.server.StardogHttpServiceLoader:accept(235): An unexpected exception was handled by the server
org.openrdf.query.QueryEvaluationException: com.complexible.stardog.plan.eval.ExecutionException: Unrecognized function: http://www.opengis.net/def/function/geosparql/sfWithin
at com.complexible.stardog.query.DefaultQueryFactory$TupleQuery.execute(DefaultQueryFactory.java:207) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.query.DefaultQueryFactory$TupleQuery.execute(DefaultQueryFactory.java:190) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.protocols.http.annex.QueryPanelService.executeQuery(QueryPanelService.java:167) ~[stardog-webconsole-annex-5.2.2.jar:?]
at com.complexible.stardog.protocols.http.annex.QueryPanelService.post(QueryPanelService.java:120) ~[stardog-webconsole-annex-5.2.2.jar:?]
at com.stardog.http.server.undertow.jaxrs.ExtractRoutes.lambda$handleIt$5(ExtractRoutes.java:196) ~[stardog-protocols-http-server-5.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 com.stardog.http.server.undertow.ErrorHandling.lambda$safeDispatch$1(ErrorHandling.java:71) ~[stardog-protocols-http-server-5.2.2.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_161]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_161]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_161]
Caused by: com.complexible.stardog.plan.eval.ExecutionException: Unrecognized function: http://www.opengis.net/def/function/geosparql/sfWithin
at com.complexible.stardog.plan.eval.QueryEngine.planFor(QueryEngine.java:273) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.getExecutablePlan(QueryEngine.java:331) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.getExecutablePlan(QueryEngine.java:279) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.executeSelect(QueryEngine.java:215) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.query.DefaultQueryFactory$TupleQuery.execute(DefaultQueryFactory.java:204) ~[stardog-5.2.2.jar:?]
... 10 more
Caused by: com.complexible.stardog.plan.PlanException: Unrecognized function: http://www.opengis.net/def/function/geosparql/sfWithin
at com.complexible.stardog.plan.parser.QueryParserImpl.parseQuery(QueryParserImpl.java:528) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl.parseQuery(QueryParserImpl.java:475) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.PlanContext.planFor(PlanContext.java:99) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.planFor(QueryEngine.java:270) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.getExecutablePlan(QueryEngine.java:331) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.getExecutablePlan(QueryEngine.java:279) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.executeSelect(QueryEngine.java:215) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.query.DefaultQueryFactory$TupleQuery.execute(DefaultQueryFactory.java:204) ~[stardog-5.2.2.jar:?]
... 10 more
Caused by: java.lang.UnsupportedOperationException: Unrecognized function: http://www.opengis.net/def/function/geosparql/sfWithin
at com.complexible.stardog.plan.filter.functions.FunctionRegistry.get(FunctionRegistry.java:163) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$ExpressionBuilder.visit(QueryParserImpl.java:3790) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$ExpressionBuilder.visit(QueryParserImpl.java:3634) ~[stardog-5.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTFunctionCall.jjtAccept(ASTFunctionCall.java:19) ~[stardog-utils-rdf-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:1247) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:629) ~[stardog-5.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTConstraint.jjtAccept(ASTConstraint.java:19) ~[stardog-utils-rdf-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:710) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:629) ~[stardog-5.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTScope.jjtAccept(ASTScope.java:22) ~[stardog-utils-rdf-5.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.SimpleNode.childrenAccept(SimpleNode.java:162) ~[stardog-utils-rdf-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:739) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:629) ~[stardog-5.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTGraphPatternGroup.jjtAccept(ASTGraphPatternGroup.java:35) ~[stardog-utils-rdf-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:2729) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:629) ~[stardog-5.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTWhereClause.jjtAccept(ASTWhereClause.java:19) ~[stardog-utils-rdf-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.query(QueryParserImpl.java:2530) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:2325) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:629) ~[stardog-5.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTSelectQuery.jjtAccept(ASTSelectQuery.java:19) ~[stardog-utils-rdf-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl.parseQuery(QueryParserImpl.java:499) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl.parseQuery(QueryParserImpl.java:475) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.PlanContext.planFor(PlanContext.java:99) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.planFor(QueryEngine.java:270) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.getExecutablePlan(QueryEngine.java:331) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.getExecutablePlan(QueryEngine.java:279) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.executeSelect(QueryEngine.java:215) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.query.DefaultQueryFactory$TupleQuery.execute(DefaultQueryFactory.java:204) ~[stardog-5.2.2.jar:?]
... 10 more
ERROR 2018-04-05 21:26:08,234 [stardog-user-10] com.complexible.stardog.protocols.http.server.StardogHttpServiceLoader:accept(235): An unexpected exception was handled by the server
org.openrdf.query.QueryEvaluationException: com.complexible.stardog.plan.eval.ExecutionException: Unrecognized function: http://www.opengis.net/def/function/geosparql/sfWithin
at com.complexible.stardog.query.DefaultQueryFactory$TupleQuery.execute(DefaultQueryFactory.java:207) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.query.DefaultQueryFactory$TupleQuery.execute(DefaultQueryFactory.java:190) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.protocols.http.annex.QueryPanelService.executeQuery(QueryPanelService.java:167) ~[stardog-webconsole-annex-5.2.2.jar:?]
at com.complexible.stardog.protocols.http.annex.QueryPanelService.post(QueryPanelService.java:120) ~[stardog-webconsole-annex-5.2.2.jar:?]
at com.stardog.http.server.undertow.jaxrs.ExtractRoutes.lambda$handleIt$5(ExtractRoutes.java:196) ~[stardog-protocols-http-server-5.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 com.stardog.http.server.undertow.ErrorHandling.lambda$safeDispatch$1(ErrorHandling.java:71) ~[stardog-protocols-http-server-5.2.2.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_161]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_161]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_161]
Caused by: com.complexible.stardog.plan.eval.ExecutionException: Unrecognized function: http://www.opengis.net/def/function/geosparql/sfWithin
at com.complexible.stardog.plan.eval.QueryEngine.planFor(QueryEngine.java:273) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.getExecutablePlan(QueryEngine.java:331) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.getExecutablePlan(QueryEngine.java:279) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.executeSelect(QueryEngine.java:215) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.query.DefaultQueryFactory$TupleQuery.execute(DefaultQueryFactory.java:204) ~[stardog-5.2.2.jar:?]
... 10 more
Caused by: com.complexible.stardog.plan.PlanException: Unrecognized function: http://www.opengis.net/def/function/geosparql/sfWithin
at com.complexible.stardog.plan.parser.QueryParserImpl.parseQuery(QueryParserImpl.java:528) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl.parseQuery(QueryParserImpl.java:475) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.PlanContext.planFor(PlanContext.java:99) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.planFor(QueryEngine.java:270) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.getExecutablePlan(QueryEngine.java:331) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.getExecutablePlan(QueryEngine.java:279) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.executeSelect(QueryEngine.java:215) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.query.DefaultQueryFactory$TupleQuery.execute(DefaultQueryFactory.java:204) ~[stardog-5.2.2.jar:?]
... 10 more
Caused by: java.lang.UnsupportedOperationException: Unrecognized function: http://www.opengis.net/def/function/geosparql/sfWithin
at com.complexible.stardog.plan.filter.functions.FunctionRegistry.get(FunctionRegistry.java:163) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$ExpressionBuilder.visit(QueryParserImpl.java:3790) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$ExpressionBuilder.visit(QueryParserImpl.java:3634) ~[stardog-5.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTFunctionCall.jjtAccept(ASTFunctionCall.java:19) ~[stardog-utils-rdf-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:1247) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:629) ~[stardog-5.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTConstraint.jjtAccept(ASTConstraint.java:19) ~[stardog-utils-rdf-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:710) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:629) ~[stardog-5.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTScope.jjtAccept(ASTScope.java:22) ~[stardog-utils-rdf-5.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.SimpleNode.childrenAccept(SimpleNode.java:162) ~[stardog-utils-rdf-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:739) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:629) ~[stardog-5.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTGraphPatternGroup.jjtAccept(ASTGraphPatternGroup.java:35) ~[stardog-utils-rdf-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:2729) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:629) ~[stardog-5.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTWhereClause.jjtAccept(ASTWhereClause.java:19) ~[stardog-utils-rdf-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.query(QueryParserImpl.java:2530) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:2325) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:629) ~[stardog-5.2.2.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTSelectQuery.jjtAccept(ASTSelectQuery.java:19) ~[stardog-utils-rdf-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl.parseQuery(QueryParserImpl.java:499) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl.parseQuery(QueryParserImpl.java:475) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.PlanContext.planFor(PlanContext.java:99) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.planFor(QueryEngine.java:270) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.getExecutablePlan(QueryEngine.java:331) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.getExecutablePlan(QueryEngine.java:279) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.executeSelect(QueryEngine.java:215) ~[stardog-5.2.2.jar:?]
at com.complexible.stardog.query.DefaultQueryFactory$TupleQuery.execute(DefaultQueryFactory.java:204) ~[stardog-5.2.2.jar:?]
... 10 more
try using geof:within rather than geof:sfWithin. From the documentation that's the name of the function that Stardog supports although I can't find a reference to a geof:within in the GeoSPARQL spec just geof.sfWithin.
geof:within didn’t do the trick immediately, but I saw a loose end in my polygon , i didn’t close it. So perhaps this was an error as well.
new query looks like this and gives me a result!