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

OwlExporter 3.1 produces NullPointerException in method populateOntology

Printer-friendly versionPrinter-friendly versionPDF versionPDF version

Hey,

i loaded the demo application in Gate 7 which ran fine. Then i modified the pipeline by adding modules like Numbers Tagger and Measurement Tagger as well as modifying some Gazetteer lists and JAPE grammars to better match my use case.

The application still ran flawlessly on demo.txt. But when i provide my own corpus with a single example text i get the following exception

  1. OWLExporter Message: OWLExporter Started.............
  2. exportFilePathStr: /C:/Program%20Files/GATE_Developer_7.0/plugins/OwlExporter/gate/application-resources/ontologies/patient_out.owl
  3. Running Single OWL File Export Mode.
  4. WARNING: [Local Folder Repository] The specified file must be a directory. (C:\Program Files\GATE_Developer_7.0\plugins\edu.stanford.smi.protegex.owl) -- LocalFolderRepository.update()
  5. Loading triples from: null
  6.     Completed triple loading after 0 ms
  7. Postprocess: Process entities with incorrect Java type (0 entities) ... 0 ms
  8. Postprocess: Process metaclasses (3 metaclasses) ... 0 ms
  9. Postprocess: Process subclasses of rdf:List (1 classes) ... 0 ms
  10. Postprocess: Instances with multiple types (0 instances) ... 0 ms
  11. Postprocess: Add inferred superclasses ... 0 ms
  12. Postprocess: Process orphan classes (2 classes) ... 0 ms
  13. Postprocess: Generalized Concept Inclusion (0 axioms) ... 0 ms
  14. Postprocess: Abstract classes... 0 ms
  15. Postprocess: Domain and range of properties... 0 ms
  16. Postprocess: Possibly typed entities (0 resources) ... 0 ms
  17. Updating underlying frames model in 0 ms
  18. Sep 24, 2012 10:26:24 AM edu.stanford.smi.protegex.owl.jena.parser.ProtegeOWLParser doFinalPostProcessing
  19. INFO: Updating underlying frames model in 0 ms
  20. OWLExporter Message: Annotation ID: 1858
  21. info.semanticsoftware.owlexporter.exception.PopulatorException: Error: populateOntology java.lang.NullPointerException
  22.         at info.semanticsoftware.owlexporter.OwlExporterOntologyPopulator.populateOntology(OwlExporterOntologyPopulator.java:206)
  23.         at info.semanticsoftware.owlexporter.OwlExporter.execute(OwlExporter.java:269)
  24.         at gate.util.Benchmark.executeWithBenchmarking(Benchmark.java:291)
  25.         at gate.creole.SerialController.runComponent(SerialController.java:221)
  26.         at gate.creole.SerialController.executeImpl(SerialController.java:153)
  27.         at gate.creole.SerialAnalyserController.executeImpl(SerialAnalyserController.java:118)
  28.         at gate.creole.AbstractController.execute(AbstractController.java:75)
  29.         at gate.util.Benchmark.executeWithBenchmarking(Benchmark.java:291)
  30.         at gate.gui.SerialControllerEditor$RunAction$1.run(SerialControllerEditor.java:1619)
  31.         at java.lang.Thread.run(Unknown Source)
  32. OWLExporter info.semanticsoftware.owlexporter.exception.PopulatorException: Error: populateOntology java.lang.NullPointerException

I can process this same text with the demo application though.

While debugging i discovered that the local variable idProp (OWLDatatypeProperty) in OwlExporterOntologyPopulator must still be null when the call "addUnionDomainClass" is happening.

Do you have any idea what i am doing wrong? Is there a configuration mistake that can lead to such a behaviour?

Thank you!

elian's picture

Lingering exportNLPOntology file

Thanks for identifying this.

Turns out this is an NLP related issue not properly handled in the code. Chances are there is a lingering exportNLPOntology (i.e.: nlp_out.owl) on the file system from previous runs regardless of the exportNLP runtime parameter that might be configured.

If so, simply rename or remove this nlp_out.owl to get you past this.

Yeah, I forgot to mention

Yeah, I forgot to mention that i switched the exportNLP parameter to false.
Anyway, deleting the export files was indeed the solution, thank you :) !

After playing around a bit yesterday, loading several applications and corpora it suddenly worked but i couldn't explain why. It's interesting though that i received a clearer Exception later on which seems to be related to this situation. I don't remember the message exactly anymore but it told me something like "output file already exists, either select a different file or delete it".

Thanks for helping me out!