Getting java output in python -
based on last question here, trying run java in python , results. far code looks this:
import subprocess = subprocess.popen(['java -xmx1024m -jar ./maui-standalone-1.1-snapshot.jar run /data/models/term_assignment_model -v /data/vocabulary/nyt_descriptors.rdf.gz -f skos'], cwd=r'/users/samuelburke/repositories/rake-tutorial/', shell=true, stdout=subprocess.pipe) out, err = a.communicate() print out
the java on own, when run in command line returns list of keywords text so:
04 jun 2015 12:49:10 info vocabulary - --- loading rdf model skos file... 04 jun 2015 12:49:12 info vocabulary - --- building vocabulary index rdf model... 04 jun 2015 12:49:12 info vocabulary - --- statistics vocabulary: 04 jun 2015 12:49:12 info vocabulary - 498 terms in total 04 jun 2015 12:49:12 info vocabulary - 0 non-descriptive terms 04 jun 2015 12:49:12 info vocabulary - 0 terms have related terms keyword: food 0.010580524344569287 keyword: theater 0.0022471910112359544 keyword: education , schools 0.0022471910112359544 keyword: child care 0.0022471910112359544 keyword: trees , shrubs 0.0022471910112359544 keyword: sociology 0.0022471910112359544 keyword: wines 0.0022471910112359544 keyword: science , technology 0.0022471910112359544 keyword: heart 0.0022471910112359544 keyword: evolution 0.0022471910112359544
however, running above code returns this:
java.lang.reflect.invocationtargetexception @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:497) @ org.springframework.boot.loader.mainmethodrunner.run(mainmethodrunner.java:53) @ java.lang.thread.run(thread.java:745) caused by: java.lang.exception: name of model required argument. @ com.entopix.maui.standalonemain.runmaui(standalonemain.java:40) @ com.entopix.maui.standalonemain.main(standalonemain.java:109) ... 6 more
this first time i'm doing , i'm pretty new programming think might approaching wrong. appreciated. cheers!
Comments
Post a Comment