GEGlobalResearch / DARPA-ASKE-TA1

ANSWER Project to demonstrate knowledge-driven extraction of scientific models from code and texts
Other
7 stars 5 forks source link

"No target found to which to save the equation model." #132

Open agabaldon opened 3 years ago

agabaldon commented 3 years ago

After extraction from Java, trying to Save an equation to a target model issues the error:

com.ge.research.sadl.darpa.aske.processing.imports.AnswerExtractionException: No target found to which to save the equation model. at com.ge.research.sadl.darpa.aske.curation.AnswerCurationManager.saveEquationInstanceToTargetSemanticModel(AnswerCurationManager.java:966) at com.ge.research.sadl.darpa.aske.curation.AnswerCurationManager.processSaveRequest(AnswerCurationManager.java:956) at com.ge.research.sadl.darpa.aske.curation.AnswerCurationManager.processUserRequest(AnswerCurationManager.java:3460) at com.ge.research.sadl.darpa.aske.curation.AnswerCurationManager.processExpectsAnswerContent(AnswerCurationManager.java:6716) at com.ge.research.sadl.darpa.aske.curation.AnswerCurationManager.processExpectsAnswerContent(AnswerCurationManager.java:6604) at com.ge.research.sadl.darpa.aske.curation.AnswerCurationManager.processConversation(AnswerCurationManager.java:6239) at com.ge.research.sadl.darpa.aske.processing.JenaBasedDialogModelProcessor.onValidate(JenaBasedDialogModelProcessor.java:438) at com.ge.research.sadl.validation.ResourceValidator.doValidate(ResourceValidator.java:75) at com.ge.research.sadl.validation.ResourceValidator.validate(ResourceValidator.java:71) at org.eclipse.xtext.validation.ResourceValidatorImpl.validate(ResourceValidatorImpl.java:91) at com.ge.research.sadl.validation.ResourceValidator.lambda$0(ResourceValidator.java:55) at org.eclipse.xtext.util.OnChangeEvictingCache.get(OnChangeEvictingCache.java:77) at com.ge.research.sadl.validation.ResourceValidator.validate(ResourceValidator.java:57) at org.eclipse.xtext.ui.editor.validation.ValidationJob$1.exec(ValidationJob.java:92) at org.eclipse.xtext.ui.editor.validation.ValidationJob$1.exec(ValidationJob.java:1) at org.eclipse.xtext.util.concurrent.CancelableUnitOfWork.exec(CancelableUnitOfWork.java:27) at org.eclipse.xtext.util.concurrent.WrappingCancelableUnitOfWork.exec(WrappingCancelableUnitOfWork.java:58) at org.eclipse.xtext.util.concurrent.CancelableUnitOfWork.exec(CancelableUnitOfWork.java:27) at org.eclipse.xtext.resource.OutdatedStateManager.exec(OutdatedStateManager.java:92) at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.internalReadOnly(XtextDocument.java:525) at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.readOnly(XtextDocument.java:497) at org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(XtextDocument.java:136) at org.eclipse.xtext.util.concurrent.IReadAccess.tryReadOnly(IReadAccess.java:50) at org.eclipse.xtext.ui.editor.validation.ValidationJob.createIssues(ValidationJob.java:87) at org.eclipse.xtext.ui.editor.validation.ValidationJob.run(ValidationJob.java:68) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

crapo commented 3 years ago

Did you precede the save statement with a target model statement? This is not an area that was ever really completed and error handling clearly stinks, but I'm guessing that this is the cause.

agabaldon commented 3 years ago

Yes, I had "target model "http://...." line at the top after an import statement. I also created the sadl target model (empty except for an import statement) in the project to check if it has to preexist, but got the same result.

crapo commented 3 years ago

just to be sure I'm not going in the wrong direction, please give me the complete content of the "target model" statement and of the "save" statement.

agabaldon commented 3 years ago

I created a new dialog file and ran extract from WindTurbine. The file starts with:

uri "http://sadl.org/test.dialog". import "http://aske.ge.com/WindTurbine". target model "http://sadl.org/WTextract.sadl".

Then after the results of extraction (and after curating equation definitions), I added:

Save Coefficients.getCoefficientDrag.

crapo commented 3 years ago

@agabaldon , I have identified and fixed this issue. It would have worked (I think) if you had specified an alias on the target model line and an alias on the save line. However, the grammar does say that they are optional, and the intent was that you would only need to use them if there were more than one target model specified. The modification uses the single default if there is only one without use of aliases.

I have pushed the fix to master branch.

Please note that debugging for me is a bit tricky as I don't have the services running. @AbhaMoitra , FYI.

agabaldon commented 3 years ago

You are right, with alias it worked.