Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to start component "CELOE" when using SPARQL endpoint and SPARQL reasoner #112

Open
Jean-KOUAGOU opened this issue Nov 4, 2024 · 4 comments

Comments

@Jean-KOUAGOU
Copy link

I am using a public SPARQL endpoint as knowledge source for DL-Learner but I cannot get it running. Is there any workaround? More details on the errors below

java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'alg': Initialization of bean failed; nested exception is java.lang.RuntimeException: java.lang.RuntimeException: Error sending query "PREFIX owl:<http://www.w3.org/2002/07/owl#> PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> SELECT ?var1 WHERE {?var1 a owl:Class .}" to endpoint https://dbpedia.data.dice-research.org/sparql
	at org.dllearner.configuration.spring.DefaultApplicationContextBuilder.buildApplicationContext(DefaultApplicationContextBuilder.java:62)
	at org.dllearner.cli.CLI.main(CLI.java:213)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'alg': Initialization of bean failed; nested exception is java.lang.RuntimeException: java.lang.RuntimeException: Error sending query "PREFIX owl:<http://www.w3.org/2002/07/owl#> PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> SELECT ?var1 WHERE {?var1 a owl:Class .}" to endpoint https://dbpedia.data.dice-research.org/sparql
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:756)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
	at org.dllearner.configuration.spring.DefaultApplicationContextBuilder.buildApplicationContext(DefaultApplicationContextBuilder.java:60)
	... 1 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Error sending query "PREFIX owl:<http://www.w3.org/2002/07/owl#> PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> SELECT ?var1 WHERE {?var1 a owl:Class .}" to endpoint https://dbpedia.data.dice-research.org/sparql
	at org.dllearner.configuration.spring.ComponentInitializationBeanPostProcessor.postProcessBeforeInitialization(ComponentInitializationBeanPostProcessor.java:46)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:407)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1611)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
	... 10 more
Caused by: java.lang.RuntimeException: Error sending query "PREFIX owl:<http://www.w3.org/2002/07/owl#> PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> SELECT ?var1 WHERE {?var1 a owl:Class .}" to endpoint https://dbpedia.data.dice-research.org/sparql
	at org.dllearner.reasoning.SPARQLReasoner.executeSelectQuery(SPARQLReasoner.java:2633)
	at org.dllearner.reasoning.SPARQLReasoner.executeSelectQuery(SPARQLReasoner.java:2638)
	at org.dllearner.reasoning.SPARQLReasoner.getOWLClasses(SPARQLReasoner.java:1100)
	at org.dllearner.reasoning.SPARQLReasoner.getOWLClasses(SPARQLReasoner.java:1091)
	at org.dllearner.reasoning.SPARQLReasoner.getClasses(SPARQLReasoner.java:1087)
	at org.dllearner.reasoning.SPARQLReasoner.getClasses(SPARQLReasoner.java:96)
	at org.dllearner.utilities.Helper.computeConcepts(Helper.java:154)
	at org.dllearner.core.AbstractCELA.initClassHierarchy(AbstractCELA.java:407)
	at org.dllearner.algorithms.celoe.CELOE.init(CELOE.java:253)
	at org.dllearner.configuration.spring.ComponentInitializationBeanPostProcessor.postProcessBeforeInitialization(ComponentInitializationBeanPostProcessor.java:35)
	... 13 more
Caused by: java.lang.UnsupportedOperationException: Not Implemented.
	at org.aksw.jena_sparql_api.utils.query_execution.QueryExecutionAdapter.setTimeout(QueryExecutionAdapter.java:101)
	at org.dllearner.reasoning.SPARQLReasoner.executeSelectQuery(SPARQLReasoner.java:2627)
	... 22 more
@Jean-KOUAGOU
Copy link
Author

Jean-KOUAGOU commented Nov 4, 2024

An overview of all steps that have passed before the error occured:

0    [main] INFO  org.dllearner.configuration.spring.ComponentInitializationBeanPostProcessor  - Initializing component 'op' of type Refinement Operator TDT ...
2    [main] INFO  org.dllearner.configuration.spring.ComponentInitializationBeanPostProcessor  - ... initialized component 'op' in 0ms. Status: OK
41   [main] INFO  org.dllearner.configuration.spring.ComponentInitializationBeanPostProcessor  - Initializing component 'ks' of type SPARQL endpoint ...
553  [main] INFO  org.dllearner.kb.SparqlEndpointKS  - SPARQL KB setup:
Endpoint:       Remote                   
URL:            https://dbpedia.data.dice-research.org/sparql
Cache:          /tmp/sparql-cache;COMPRESS=TRUE
Delay:          50ms

553  [main] INFO  org.dllearner.configuration.spring.ComponentInitializationBeanPostProcessor  - ... initialized component 'ks' in 512ms. Status: OK
556  [main] INFO  org.dllearner.configuration.spring.ComponentInitializationBeanPostProcessor  - Initializing component 'reasoner' of type SPARQL Reasoner ...
556  [main] INFO  org.dllearner.configuration.spring.ComponentInitializationBeanPostProcessor  - ... initialized component 'reasoner' in 0ms. Status: OK
560  [main] INFO  org.dllearner.configuration.spring.ComponentInitializationBeanPostProcessor  - Initializing component 'accuracyMethod' of type FMeasure ...
560  [main] INFO  org.dllearner.configuration.spring.ComponentInitializationBeanPostProcessor  - ... initialized component 'accuracyMethod' in 0ms. Status: OK
564  [main] INFO  org.dllearner.configuration.spring.ComponentInitializationBeanPostProcessor  - Initializing component 'lp' of type PosNegLPStandard ...
565  [main] INFO  org.dllearner.configuration.spring.ComponentInitializationBeanPostProcessor  - ... initialized component 'lp' in 1ms. Status: OK
581  [main] INFO  org.dllearner.configuration.spring.ComponentInitializationBeanPostProcessor  - Initializing component 'alg' of type CELOE ...
581  [main] WARN  org.dllearner.core.AbstractCELA  - Ignoring unsatisfiable check due to org.dllearner.reasoning.SPARQLReasoner.getInconsistentClassesImpl(SPARQLReasoner.java:1863)
595  [main] WARN  org.dllearner.configuration.spring.ComponentInitializationBeanPostProcessor  - Could not initialize component "CELOE"
599  [main] ERROR org.dllearner.cli.CLI  - An Error Has Occurred During Processing.
600  [main] ERROR org.dllearner.cli.CLI  - Not Implemented.
600  [main] ERROR org.dllearner.cli.CLI  - Terminating DL-Learner...and writing stacktrace to: log/error.log

@SimonBin
Copy link
Member

SimonBin commented Nov 4, 2024

duplicate of #111

you can use version 1.4.0 if you need remote sparql endpoint

@Jean-KOUAGOU
Copy link
Author

Thanks for your reply. I have downloaded version 1.4.0. I do not get the error above, but the execution stops after displying start class 'T' and without any error. Also, the produced searchTree file is empty, see the actual output below:

DL-Learner command line interface
Initializing component 'op' of type Refinement Operator TDT ...
... initialized component 'op' in 0ms. Status: OK
Initializing component 'ks' of type SPARQL endpoint ...
SPARQL KB setup:
Endpoint:       Remote                   
URL:            https://dbpedia.data.dice-research.org/sparql
Cache:          /tmp/sparql-cache;COMPRESS=TRUE
Delay:          50ms

... initialized component 'ks' in 471ms. Status: OK
Initializing component 'reasoner' of type SPARQL Reasoner ...
... initialized component 'reasoner' in 0ms. Status: OK
Initializing component 'accuracyMethod' of type FMeasure ...
... initialized component 'accuracyMethod' in 0ms. Status: OK
Initializing component 'lp' of type PosNegLPStandard ...
... initialized component 'lp' in 0ms. Status: OK
Initializing component 'alg' of type CELOE ...
Ignoring unsatisfiable check due to org.dllearner.reasoning.SPARQLReasoner.getInconsistentClassesImpl(SPARQLReasoner.java:1601)
Preparing object property subsumption hierarchy ...
... done in 106ms
Preparing data property subsumption hierarchy ...
... done in 106ms
Numeric Facet restrictions are not (yet) implemented for SPARQL Reasoner, option ignored
Time based Facet restrictions are not (yet) implemented for SPARQL Reasoner, option ignored
Cardinality restrictions in Sparql not fully implemented, defaulting to 10.
... initialized component 'alg' in 983ms. Status: OK
Running algorithm instance "alg" (CELOE)
start class:⊤

How can I get the algorithm to execute properly? For now I have set the max_runtime to 1000, but the execution lasts at most 60 seconds

@Jean-KOUAGOU
Copy link
Author

I am executing the algorithm a large dataset, DBpedia with over 800 million statements. Should Java memory size be increased?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants