owlexporter plugin creation problem


hi,
Owlexporter plugin is not getting created in GATE framework. it gives error after calling ant jar in command line.
can someone help in creating this plugin.
Error as under:
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntology.java:240: cannot find symbol
[javac] symbol : class OWLIndividual
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
y
[javac] OWLIndividual individual2 = (O
WLIndividual) kt.next();
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntology.java:240: cannot find symbol
[javac] symbol : class OWLIndividual
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
y
[javac] OWLIndividual individual2 = (O
WLIndividual) kt.next();
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntology.java:264: cannot find symbol
[javac] symbol : variable OWLUtil
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
y
[javac] OWLUtil.renameOntology(this.getOwlModel(),
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntology.java:282: cannot find symbol
[javac] symbol : variable URIUtilities
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
y
[javac] URI importUri = URIUtilities.createURI(ontology.
getExportFilePathStr());
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:125: cannot find symbol
[javac] symbol : class RDFSNamedClass
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] RDFSNamedClass c = model.getRDFSNamedClass("Docu
ment");
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:127: cannot find symbol
[javac] symbol : class RDFSClass
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] Collection i = c.getInstances
(true);
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:128: cannot find symbol
[javac] symbol : class RDFSClass
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] for(Iterator instanceIt = i.i
terator(); instanceIt.hasNext();) {
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:129: cannot find symbol
[javac] symbol : class OWLIndividual
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] OWLIndividual ind = (OWLIndividu
al) instanceIt.next();
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:129: cannot find symbol
[javac] symbol : class OWLIndividual
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] OWLIndividual ind = (OWLIndividu
al) instanceIt.next();
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:131: cannot find symbol
[javac] symbol : class RDFProperty
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] Collection p = ind.
getRDFProperties();
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:132: cannot find symbol
[javac] symbol : class RDFProperty
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] for(Iterator propIt
= p.iterator(); propIt.hasNext();) {
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:133: cannot find symbol
[javac] symbol : class RDFProperty
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] RDFProperty prop = (RDFP
roperty) propIt.next();
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:133: cannot find symbol
[javac] symbol : class RDFProperty
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] RDFProperty prop = (RDFP
roperty) propIt.next();
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:157: cannot find symbol
[javac] symbol : class OWLDatatypeProperty
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] OWLDatatypeProperty idProp = null;
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:190: cannot find symbol
[javac] symbol : class OWLNamedClass
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] OWLNamedClass owlClass = this.getOwlExporterOnto
logy().getOwlModel().
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:194: cannot find symbol
[javac] symbol : class RDFSClass
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] idProp.addUnionDomainClass((RDFSClass)ow
lClass);
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:212: cannot find symbol
[javac] symbol : class OWLIndividual
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] OWLIndividual individual = null;
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:245: cannot find symbol
[javac] symbol : class OWLNamedClass
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] Collection owlSuperClasse
s = owlClass.getSuperclasses(false);
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:246: cannot find symbol
[javac] symbol : class OWLDatatypeProperty
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] Collection owlClass
Prop;
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:247: cannot find symbol
[javac] symbol : class OWLDatatypeProperty
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] Collection owlSuper
ClassProp;
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:249: cannot find symbol
[javac] symbol : class OWLDatatypeProperty
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] owlClassProp = (Collection) owlClass.getUnionDomainProperties(false);
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:251: cannot find symbol
[javac] symbol : class OWLNamedClass
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] Iterator owlSuperClass =
owlSuperClasses.iterator();
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:255: cannot find symbol
[javac] symbol : class OWLClass
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] OWLClass namedClass = (OWLClass)
owlSuperClass.next();
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:255: cannot find symbol
[javac] symbol : class OWLClass
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] OWLClass namedClass = (OWLClass)
owlSuperClass.next();
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:257: cannot find symbol
[javac] symbol : class OWLDatatypeProperty
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] owlSuperClassProp = (Collection<
OWLDatatypeProperty>)
[javac]
^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:263: cannot find symbol
[javac] symbol : class OWLDatatypeProperty
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] Iterator oIt = owlC
lassProp.iterator();
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:267: cannot find symbol
[javac] symbol : class RDFProperty
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] RDFProperty k = (RDFProp
erty)oIt.next();
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:267: cannot find symbol
[javac] symbol : class RDFProperty
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] RDFProperty k = (RDFProp
erty)oIt.next();
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:297: cannot find symbol
[javac] symbol : class OWLObjectProperty
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] OWLObjectProperty relProperty;
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:298: cannot find symbol
[javac] symbol : class RDFSClass
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] RDFSClass owlDomainClass = null, owlRangeClass = null;
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:328: cannot find symbol
[javac] symbol : class RDFSClass
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] relDomainStr = ((RDFSClass)relDomainIt.n
ext()).getName();
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:331: cannot find symbol
[javac] symbol : class RDFSClass
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] relRangeStr = ((RDFSClass)relRan
geIt.next()).getName();
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:356: cannot find symbol
[javac] symbol : class OWLIndividual
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] OWLIndividual domainInd
= (OWLIndividual) domainIt.next();
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:356: cannot find symbol
[javac] symbol : class OWLIndividual
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] OWLIndividual domainInd
= (OWLIndividual) domainIt.next();
[javac]
^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:362: cannot find symbol
[javac] symbol : class OWLIndividual
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] OWLIndiv
idual rangeInd = (OWLIndividual)rangeIt.next();
[javac] ^
[javac] C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\semantics
oftware\owlexporter\OwlExporterOntologyPopulator.java:362: cannot find symbol
[javac] symbol : class OWLIndividual
[javac] location: class info.semanticsoftware.owlexporter.OwlExporterOntolog
yPopulator
[javac] OWLIndiv
idual rangeInd = (OWLIndividual)rangeIt.next();
[javac]
^
[javac] Note: C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\src\info\sem
anticsoftware\owlexporter\OwlExporterOntologyPopulator.java uses unchecked or un
safe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 100 errors
BUILD FAILED
C:\Program Files\GATE-5.2.1\plugins\OwlExporterV2\build.xml:87: Compile failed;
see the compiler error output for details.
regards
gaurav
- Login to post comments
OwlExporter Compile Time Error
Hello Gaurav
Sorry for the delayed response. When trying to compile the OwlExporter, both PROTEGE_HOME and GATE_HOME need to be part of your system's classpath variables. The extensive documentation for the OwlExporter can be downloaded from the OwlExporter site @ http://www.semanticsoftware.info/owlexporter.
Please let me know if you have any more questions.
Ninus.
Similar (or same) trouble
Hi Ninus!
I have almost the same problem, and I also think it depends by the environment variables: ant says "package edu.stanford.smi.protegex.owl.model does not exist".
I should say that instructions are quite hard to understand for not-Ant-expert-user :)
I'll tell you what I did, and you'll tell me what's wrong: I'm working on a Windows XP environment, and downloaded both Protégé 3.4.4 and Protégé OWL source code from http://protege.stanford.edu/download/registered.html.
I downloaded the second because it contained the missing package, which wasn't contained in Protégé's installation directory (there just was e.s.s.p.owl).
I extracted "edu" directory and subdirectories from the source ZIP file to Protégé's plugins folder, even if I saw that the installations folder were called A.B.C.D.E instead of having B subdirectory of A etc (it should be the same for the packages).
I set the "GATE and Protégé lib folders" in "system CLASSPATH" as written in your instructions, setting a new CLASSPATH system variable containing "C:\Programmi\Gate\lib;C:\Programmi\Protege_3.4.4\plugins" (without quotes).
I created two more system variables as you say here, PROTEGE_HOME containing "C:\Programmi\Protege_3.4.4" and GATE_HOME with "C:\Programmi\Gate".
I also modified two strings in your installation files: in build.xml I put
(there was a simple ../.. that I wasn't sure could work)
and in build.properties I inserted gate.home=C:/Programmi/Gate in the place of that Linux-like folder (which was being searched during the installation).
Now I think I'm in Gaurav's same situation. What should I do?
Thanks in advance!
Massi
Hello Massi, It seems that we
Hello Massi,
It seems that we were always having problems with setting protege environment variables in windows machines. What I have done is modified the ant build for such environments. You will need to modify build.properties to point to the correct locations.
################################################################
#build.properties:
###############################################################
################################################################
#build.xml:
###############################################################
You will not need to modify the relative path material "../.." because java compiler will automatically do this depending on the environment the ant task is running on.
Please let me know if this works, your next problem after building the jar file will be loading plugin into gate, I have a solution for that too, I just want to address one problem at a time.
Regards,
Ninus.
Classpath problem also when running OWLExporter
Good night Ninus!
I'm still here trying to execute OWLExporter... but when I launch the pipeline it still looks for a "not findable" class:
Exception in thread "ApplicationViewer1" java.lang.NoClassDefFoundError: edu/stanford/smi/protegex/owl/model/OWLModel
at info.semanticsoftware.owlexporter.OwlExporter.execute(OwlExporter.java:224)
...
He was right at first: I don't know why I couldn't find it in Protégé 3.4.4 sources nor in 3.4.4 installation. I re-extracted the sources from the downloaded zip and compiled them. I moved the edu/stanford/... directory (with class files) to the CLASSPATH-ed directory of Protégé plugins, but nothing new happened. Anymore magic available overseas? :)
I also tried with this hack http://forums.sun.com/thread.jspa?threadID=5434012 but it didn't work....
It's 4:56 a.m. here! :O
Class Def Not Found
Hello Massi,
After some minor modifications to the GATE ant build (AKA magic ;), I have another solution to your problem. Please replace build.properties in GATE_HOME with the following:
and build.xml in GATE_HOME with the following:
Running GATE with ${runtime.arch}
After making the two modifications:
* ant clean
* ant compile
* ant run
And the OwlExporter will work like a dream!
Cheers,
Ninus.
Temporary not-ideal-solution
I temporary solved by zipping the necessary classpaths in OWLExporter jar: it "just" gives ontology problems now, but I still need to try better
Question Regarding OwlExporter
Hello Ninus,
Since that "The specified file must be a directory." error message, I
thought that it could require just the directory for the ontology
output, instead of the filename (the new ontology is created from
scratch, you said), thus I tried with
file:/C:/blahblahblah/OntologieOutPut/, but it said
OWLExporter Message: OWLExporter V2.0 Started.............
exportFilePathStr:
/C:/Documents%20and%20Settings/Massi/Desktop/Vari%20per%20GATE/OntologieOutPut/
Running Multi OWL File Export Mode.
WARNING: [Local Folder Repository] The specified file must be a
directory. (C:\Programmi\Gate\plugins\edu.stanford.smi.protegex.owl) --
LocalFolderRepository.update()
SEVERE: Error at loading file
file:/C:/Documents%20and%20Settings/Massi/Desktop/Vari%20per%20GATE/OntologieOutPut/.owl
-- Could not get input stream for
file:/C:/Documents%20and%20Settings/Massi/Desktop/Vari%20per%20GATE/OntologieOutPut/.owl
The same without the last "/". "Input stream" for an output file?
I then tried to give it already available copies of my ontology in the
same folder, and giving it
file:/C:/blahblahblah/OntologieOutPut/SoftwareEngineering (without the
".owl")
and we went back to the previuos error message: OWLExporter Message:
OWLExporter V2.0 Started.............
exportFilePathStr:
/C:/Documents%20and%20Settings/Massi/Desktop/Vari%20per%20GATE/OntologieOutPut/SoftwareEngineering
Running Multi OWL File Export Mode.
WARNING: [Local Folder Repository] The specified file must be a
directory. (C:\Programmi\Gate\plugins\edu.stanford.smi.protegex.owl) --
LocalFolderRepository.update()
WARNING: Could not get ontology from URL: http://localhost/NLP.owl --
HTTPRepository.update()
What's the "specified file" which "must be a directory"? Why doesn't
it
find my localhost ontology?
I also tried to put file:// and file:/// instead of file:/, but with
three slashes it gives the same problem, with two another one, prabably
due to bad syntax. Without the file:/ it doesn't work.
I really think it's a stupid runtime parameters how-to problem :)
Looking forward to chatting with you on Skype (text chat, I'd prefer,
due to my PC power and my not very good English understanding), I just
added both Ninus and Nick available on nkhamis@cogeco.ca!
Massi
Hello Massi, We deployed a
Hello Massi,
We deployed a new version of the OwlExporter that solves the build and run-time errors experienced by Windows users. Please:
- Remove the old OwlExporter from your GATE environment
- Download, buld and include the new OwlExporter to your GATE environment.
@ For input and output runtime parameters:
The runtime parameters need to be set to the actual owl files. In the case of the output owl file, it could be an already existing owl file that is populated using information from a different corpus, or a non existing one. If the output owl file is already populated, the owlexporter will check if it is processing the same document and will throw an error if it has already processed the document.
As input: C:/blahblahblah/OntologieOutPut/SoftwareEngineering.owl
As output: C:/blahblahblah/OntologieOutPut/SoftwareEngineeringOut.owl
The same goes for the NLP ontology.
Successful!
Hi Ninus, thanks for your answer!
And thanks God you know how to create an Ant build.xml (I really don't have time for it) :)
BUILD SUCCESSFUL! ;)
I was trying to use the version Gaurav managed to build, and now I did it with your new solution... I'd update the documentation if I was in you ;)
Another curiosity: in the package U release we can find a folder which ISN'T called OWLExporterV2 (but it's owlexporter-2.1). If I extracted it without renaming it to the "right name", would it have worked?
I think I won't have problems to make it work (I already did with Gaurav's build), but I will begin trying "annotating for it" in a few hours... so I'd have a question about the documentations... which will appear on these pages in half an hour (it's dinnertime) :)
You are very welcome Massi,
You are very welcome Massi, if you have anymore questions please don't hesitate.
I don't own any microsoft products, but I will need to borrow someone's computer at some point to figure out why it does not work with the system's environment variables. This was just a quick fix that may remain as the norm....
You could rename the folder, GATE should not complain either way.
As for the exporting of entities and relationships of type domain or nlp, I would follow the demo in the documentation at first to get acquainted with the product.
Cheers,
Ninus.
I'm also trying to make the
I'm also trying to make the Big Jump, I also have OpenSUSE installed, but I began my GATE job on Windows, and moving it to Linux would be quite hard :) (Pity for RASP: I could try it too, with MultiPaX)
How about using VirtualBox with a fabulous Windows virtual machine? Ah, right, Microsoft license says it can't be installed on virtual machines, and anyone obeys Microsoft's EULAs :D
About the folder, I mean if it could have implied some problems while compiling...
About the OWLExp usage problems, I'll start a new thread here soon!
Thanks again!
Massi
I wasn't logged in...
...it was me!