Skip navigation.
Home
Semantic Software Lab
Concordia University
Montréal, Canada

Error by loading main.jape from demo: japehelpers.Japehelpers cannot be resolved to a type (Help needed ASAP)

Printer-friendly versionPrinter-friendly versionPDF versionPDF version

I am getting error by loading main.jape from demo in GATE Developer GUI. It seems like some class Japehelpers is needed. I would appreciate any help. Thanks.
Here there is a stack:

  1. Error: japehelpers.Japehelpers cannot be resolved to a type at line 23 in japeactionclasses.mention_owl_classnpATChain_ruleActionClass443
  2. Error: japehelpers.Japehelpers cannot be resolved to a type at line 23 in japeactionclasses.mention_owl_classnpATChain_ruleActionClass443
  3.  
  4. The offending input was:
  5.  
  6.  1  // mention_owl_classnpATChain_ruleActionClass443
  7.  2  package japeactionclasses;
  8.  3  import java.io.*;
  9.  4  import java.util.*;
  10.  5  import gate.*;
  11.  6  import gate.jape.*;
  12.  7  import gate.creole.ontology.*;
  13.  8  import gate.annotation.*;
  14.  9  import gate.util.*;
  15. 10  
  16. 11  public class mention_owl_classnpATChain_ruleActionClass443
  17. 12  implements java.io.Serializable, RhsAction {
  18. 13    public void doit(gate.Document doc,
  19. 14                     java.util.Map<java.lang.String, gate.AnnotationSet> bindings,
  20. 15                     gate.AnnotationSet annotations,
  21. 16                     gate.AnnotationSet inputAS, gate.AnnotationSet outputAS,
  22. 17                     gate.creole.ontology.Ontology ontology) throws gate.jape.JapeException {
  23. 18  
  24. 19  if (true) {
  25. 20  
  26. 21  AnnotationSet as = (gate.AnnotationSet)bindings.get("ann");
  27. 22  Annotation a = (gate.Annotation)as.iterator().next();
  28. 23  japehelpers.Japehelpers myJapehelpers = new japehelpers.Japehelpers();
  29. 24  AnnotationSet chain = myJapehelpers.getAS("NP Chain", inputAS);
  30. 25  if(chain==null||chain.isEmpty())
  31. 26  {
  32. 27       //System.out.println("chain empty");
  33. 28  }
  34. 29  Integer chainId = null;
  35. 30  
  36. 31       Iterator chainIt = chain.iterator();
  37. 32       while(chainIt.hasNext())
  38. 33  {
  39. 34       Annotation chainAnn = (Annotation)chainIt.next();     
  40. 35       if(((ArrayList)(chainAnn.getFeatures().get("IDs"))).contains(a.getFeatures().get("id")))
  41. 36       chainId = chainAnn.getId();
  42. 37  }
  43. 38  FeatureMap outputFeatures = Factory.newFeatureMap();
  44. 39  outputFeatures.put("className", a.getFeatures().get("class"));
  45. 40  
  46. 41  String instanceName = "";
  47. 42  
  48. 43  try {
  49. 44      instanceName = doc.getContent().getContent(a.getStartNode().getOffset(), a.getEndNode().getOffset()).toString();
  50. 45  }
  51. 46  catch(Exception e) {
  52. 47  }
  53. 48  
  54. 49  if(a.getFeatures().get("class").toString().compareToIgnoreCase("Document")==0) {
  55. 50      outputFeatures.put("instanceName",a.getFeatures().get("title"));
  56. 51  }
  57. 52  else if(a.getFeatures().get("class").toString().compareToIgnoreCase("Sentence")==0) {      
  58. 53      outputFeatures.put("instanceName", instanceName);
  59. 54  }          
  60. 55  else
  61. 56      outputFeatures.put("instanceName",instanceName);
  62. 57  
  63. 58  outputFeatures.put("corefChain", chainId);
  64. 59  outputFeatures.put("representationId", a.getFeatures().get("id"));
  65. 60  outputAS.add(as.firstNode(), as.lastNode(), "OwlExportClassDomain", outputFeatures);
  66. 61  
  67. 62  }
  68. 63    }
  69. 64  }
  70.  
  71. gate.creole.ResourceInstantiationException: Error while parsing the grammar (file:/home/artjomk/Work/GateOwlTutorial/OwlExporterDemo/grammars/main/main.jape):
  72.         at gate.creole.Transducer.init(Transducer.java:114)
  73.         at gate.Factory.createResource(Factory.java:385)
  74.         at gate.gui.NewResourceDialog$4.run(NewResourceDialog.java:220)
  75.         at java.lang.Thread.run(Thread.java:636)
  76. Caused by: gate.util.GateRuntimeException: gate.util.GateException: There were errors; see error log for details!
  77.         at gate.jape.SinglePhaseTransducer.finish(SinglePhaseTransducer.java:160)
  78.         at gate.jape.MultiPhaseTransducer.finish(MultiPhaseTransducer.java:126)
  79.         at gate.jape.Batch.parseJape(Batch.java:216)
  80.         at gate.jape.Batch.<init>(Batch.java:84)
  81.         at gate.creole.Transducer.init(Transducer.java:96)
  82.         ... 3 more
  83. Caused by: gate.util.GateException: There were errors; see error log for details!
  84.         at gate.util.compilers.Eclipse.compile(Eclipse.java:398)
  85.         at gate.util.Javac.loadClasses(Javac.java:46)
  86.         at gate.jape.SinglePhaseTransducer.finish(SinglePhaseTransducer.java:157)
  87.         ... 7 more

rene's picture

Try the new 3.0-pre-release

Hi Artjom,

I just mailed you a pre-release of the new 3.0 version which we'll put up shortly. Let me know if this fixes the problem.

Cheers, René

3.0-pre-release

Hi Rene,

I have been having the same problem with the japehelpers.Hapehelpers class not being loaded

Could you please send me the pre release 3.0 version of OWLExporter

Cheers
Lesley

rene's picture

Contact me

I've tried to email you, but the email address in your profile does not seem to work. Please contact me: http://www.semanticsoftware.info/contact