Function stop working after working fine

Hi all, I tried to run the query below. It first work then it start complaining that the my custom function does not exist.

I would like to enforce that it works the first time and then stop working due to the exception below.

Is it a known bug?

prefix f: geophy:function:
prefix realestate: http://geophy.io/ontologies/realestate#
prefix meta: http://geophy.io/ontologies/rank/meta#

delete { ?functional_area ?definition_key ?value } insert{ ?functional_area ?definition_key ?value } where { ?functional_area realestate:building_detail ?input . ?functional_area realestate:actual_purpose ?purpose . ?component meta:service http://geophy.io/ontologies/services#year_of_construction . ?component meta:key ?component_key . ?component meta:formula ?formula . ?component meta:defined_by ?definition . ?definition meta:purpose ?purpose . ?definition meta:key ?definition_key . ?input realestate:construction_year ?con_year . optional {?input realestate:renovation_year ?ren_year. } bind (COALESCE(?ren_year,0) as ?renovation_year) . bind (COALESCE(?con_year,0) as ?construction_year) . bind(f:component(?formula,?construction_year, ?renovation_year) as ?value) . values ?input { http://geophy.io/buildings/381164
http://geophy.io/buildings/496492
http://geophy.io/buildings/496493
http://geophy.io/buildings/496494
http://geophy.io/buildings/496495
http://geophy.io/buildings/496496
http://geophy.io/buildings/496497
http://geophy.io/buildings/496498 } }
org.openrdf.query.QueryEvaluationException: com.complexible.stardog.plan.eval.ExecutionException: There was an error while creating a new query plan
at com.complexible.stardog.query.DefaultQueryFactory$UpdateQueryImpl.execute(DefaultQueryFactory.java:266) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.query.DefaultQueryFactory$UpdateQueryImpl.execute(DefaultQueryFactory.java:242) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.query.DelegatingUpdateQuery.execute(DelegatingUpdateQuery.java:139) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.db.DatabaseImpl$TimerPauseUpdate.execute(DatabaseImpl.java:1571) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.db.DatabaseImpl$TimerPauseUpdate.execute(DatabaseImpl.java:1559) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.query.DelegatingUpdateQuery.execute(DelegatingUpdateQuery.java:139) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.StardogKernel$SecuredUpdateQuery.execute(StardogKernel.java:3765) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.StardogKernel$SecuredUpdateQuery.execute(StardogKernel.java:3752) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.protocols.server.SPECServerFunction.query(SPECServerFunction.java:526) ~[stardog-protocols-spec-server-4.2.3.jar:?]
at com.complexible.stardog.protocols.server.SPECServerFunction.handleMessage(SPECServerFunction.java:152) ~[stardog-protocols-spec-server-4.2.3.jar:?]
at com.complexible.stardog.protocols.http.annex.QueryPanelEndpoint.handleMessage(QueryPanelEndpoint.java:89) ~[stardog-webconsole-annex-4.2.3.jar:?]
at com.complexible.common.protocols.server.rpc.ServerHandler.lambda$handleMessage$1(ServerHandler.java:311) ~[stardog-protocols-api-server-4.2.3.jar:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_131]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_131]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
Caused by: com.complexible.stardog.plan.eval.ExecutionException: There was an error while creating a new query plan
at com.complexible.stardog.plan.eval.QueryEngine.getExecutablePlan(QueryEngine.java:252) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.executeUpdate(QueryEngine.java:162) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.query.DefaultQueryFactory$UpdateQueryImpl.execute(DefaultQueryFactory.java:263) ~[stardog-4.2.3.jar:?]
... 16 more
Caused by: com.complexible.stardog.plan.PlanException: There was an error while creating a new query plan
at com.complexible.stardog.plan.parser.QueryParserImpl.parseUpdate(QueryParserImpl.java:427) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.PlanContext.planFor(PlanContext.java:86) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.getExecutablePlan(QueryEngine.java:229) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.executeUpdate(QueryEngine.java:162) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.query.DefaultQueryFactory$UpdateQueryImpl.execute(DefaultQueryFactory.java:263) ~[stardog-4.2.3.jar:?]
... 16 more
Caused by: java.lang.UnsupportedOperationException: Unrecognized function: geophy:function:component
at com.complexible.stardog.plan.filter.functions.FunctionRegistry.get(FunctionRegistry.java:112) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$ExpressionBuilder.visit(QueryParserImpl.java:4275) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$ExpressionBuilder.visit(QueryParserImpl.java:4126) ~[stardog-4.2.3.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTFunctionCall.jjtAccept(ASTFunctionCall.java:19) ~[stardog-utils-rdf-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$ExpressionBuilder.toExpression(QueryParserImpl.java:4433) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$ExpressionBuilder.access$300(QueryParserImpl.java:4126) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:1547) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:847) ~[stardog-4.2.3.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTBind.jjtAccept(ASTBind.java:18) ~[stardog-utils-rdf-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.translateGraphPatterns(QueryParserImpl.java:1007) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:1135) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:847) ~[stardog-4.2.3.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTBasicGraphPattern.jjtAccept(ASTBasicGraphPattern.java:19) ~[stardog-utils-rdf-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.translateGraphPatterns(QueryParserImpl.java:1024) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:1109) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:847) ~[stardog-4.2.3.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTGraphPatternGroup.jjtAccept(ASTGraphPatternGroup.java:19) ~[stardog-utils-rdf-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$UpdateBuilder.visit(QueryParserImpl.java:3792) ~[stardog-4.2.3.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTModify.jjtAccept(ASTModify.java:18) ~[stardog-utils-rdf-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl.parseUpdate(QueryParserImpl.java:415) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.PlanContext.planFor(PlanContext.java:86) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.getExecutablePlan(QueryEngine.java:229) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.executeUpdate(QueryEngine.java:162) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.query.DefaultQueryFactory$UpdateQueryImpl.execute(DefaultQueryFactory.java:263) ~[stardog-4.2.3.jar:?]
... 16 more
ERROR 2017-08-01 11:22:29,329 [Stardog.Executor-22] com.complexible.common.protocols.server.rpc.ServerHandler:exceptionCaught(401): exceptionCaughtServerHandler
org.openrdf.query.QueryEvaluationException: com.complexible.stardog.plan.eval.ExecutionException: There was an error while creating a new query plan
at com.complexible.stardog.query.DefaultQueryFactory$UpdateQueryImpl.execute(DefaultQueryFactory.java:266) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.query.DefaultQueryFactory$UpdateQueryImpl.execute(DefaultQueryFactory.java:242) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.query.DelegatingUpdateQuery.execute(DelegatingUpdateQuery.java:139) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.db.DatabaseImpl$TimerPauseUpdate.execute(DatabaseImpl.java:1571) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.db.DatabaseImpl$TimerPauseUpdate.execute(DatabaseImpl.java:1559) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.query.DelegatingUpdateQuery.execute(DelegatingUpdateQuery.java:139) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.StardogKernel$SecuredUpdateQuery.execute(StardogKernel.java:3765) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.StardogKernel$SecuredUpdateQuery.execute(StardogKernel.java:3752) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.protocols.server.SPECServerFunction.query(SPECServerFunction.java:526) ~[stardog-protocols-spec-server-4.2.3.jar:?]
at com.complexible.stardog.protocols.server.SPECServerFunction.handleMessage(SPECServerFunction.java:152) ~[stardog-protocols-spec-server-4.2.3.jar:?]
at com.complexible.stardog.protocols.http.annex.QueryPanelEndpoint.handleMessage(QueryPanelEndpoint.java:89) ~[stardog-webconsole-annex-4.2.3.jar:?]
at com.complexible.common.protocols.server.rpc.ServerHandler.lambda$handleMessage$1(ServerHandler.java:311) ~[stardog-protocols-api-server-4.2.3.jar:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_131]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_131]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
Caused by: com.complexible.stardog.plan.eval.ExecutionException: There was an error while creating a new query plan
at com.complexible.stardog.plan.eval.QueryEngine.getExecutablePlan(QueryEngine.java:252) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.executeUpdate(QueryEngine.java:162) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.query.DefaultQueryFactory$UpdateQueryImpl.execute(DefaultQueryFactory.java:263) ~[stardog-4.2.3.jar:?]
... 16 more
Caused by: com.complexible.stardog.plan.PlanException: There was an error while creating a new query plan
at com.complexible.stardog.plan.parser.QueryParserImpl.parseUpdate(QueryParserImpl.java:427) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.PlanContext.planFor(PlanContext.java:86) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.getExecutablePlan(QueryEngine.java:229) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.executeUpdate(QueryEngine.java:162) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.query.DefaultQueryFactory$UpdateQueryImpl.execute(DefaultQueryFactory.java:263) ~[stardog-4.2.3.jar:?]
... 16 more
Caused by: java.lang.UnsupportedOperationException: Unrecognized function: geophy:function:component
at com.complexible.stardog.plan.filter.functions.FunctionRegistry.get(FunctionRegistry.java:112) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$ExpressionBuilder.visit(QueryParserImpl.java:4275) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$ExpressionBuilder.visit(QueryParserImpl.java:4126) ~[stardog-4.2.3.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTFunctionCall.jjtAccept(ASTFunctionCall.java:19) ~[stardog-utils-rdf-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$ExpressionBuilder.toExpression(QueryParserImpl.java:4433) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$ExpressionBuilder.access$300(QueryParserImpl.java:4126) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:1547) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:847) ~[stardog-4.2.3.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTBind.jjtAccept(ASTBind.java:18) ~[stardog-utils-rdf-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.translateGraphPatterns(QueryParserImpl.java:1007) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:1135) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:847) ~[stardog-4.2.3.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTBasicGraphPattern.jjtAccept(ASTBasicGraphPattern.java:19) ~[stardog-utils-rdf-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.translateGraphPatterns(QueryParserImpl.java:1024) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:1109) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$GeneratePlan.visit(QueryParserImpl.java:847) ~[stardog-4.2.3.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTGraphPatternGroup.jjtAccept(ASTGraphPatternGroup.java:19) ~[stardog-utils-rdf-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl$UpdateBuilder.visit(QueryParserImpl.java:3792) ~[stardog-4.2.3.jar:?]
at com.complexible.common.rdf.query.parser.sparql.ast.ASTModify.jjtAccept(ASTModify.java:18) ~[stardog-utils-rdf-4.2.3.jar:?]
at com.complexible.stardog.plan.parser.QueryParserImpl.parseUpdate(QueryParserImpl.java:415) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.PlanContext.planFor(PlanContext.java:86) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.getExecutablePlan(QueryEngine.java:229) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.plan.eval.QueryEngine.executeUpdate(QueryEngine.java:162) ~[stardog-4.2.3.jar:?]
at com.complexible.stardog.query.DefaultQueryFactory$UpdateQueryImpl.execute(DefaultQueryFactory.java:263) ~[stardog-4.2.3.jar:?]

Hi,

I do see the Unrecognized function: geophy:function:component in the stack trace, so I’m wondering how the query worked the first time, unless it didn’t actually need to call the function. It could have something to do with the query itself:

You have delete { ?functional_area ?definition_key ?value } insert{ ?functional_area ?definition_key ?value }. This essentially makes the entire query a no-op, as it is deleting and inserting the exact same triples. Which, if you’re recalculating said triples, will never be in the db to delete in the first place.

That aside, are you able to share the code for your custom function, either here or privately? Have you double-checked that you registered your function in the META-INF/services directory?

Hi all, manage to make it work. I probably mess up this time. Sorry for inconvenience and taking your time.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.