andrewstellman / pbprdf

Generate linked data for advanced basketball analytics. Reads basketball play-by-play files and generates RDF to import into a semantic graph database like RDF4J.
MIT License
78 stars 5 forks source link

JAR not found on execution #1

Open danielhmills opened 6 years ago

danielhmills commented 6 years ago

./pdprdf results in:

Unable to access jarfile pbprdf.jar

"should generate RDF" also fails

andrewstellman commented 6 years ago

Did you run "sbt assembly"? (Make sure sbt 1.x is in your path.)

danielhmills commented 6 years ago

Yes, confirmed

andrewstellman commented 6 years ago

So when you run "sbt assembly" it generates a fat JAR file with all of the dependencies (essentially the executable). When you run the pbprdf script, all it does is run that jar. You can run it directly by running "java -jar pbprdf.jar" – that's all the script does:

$ rm pbprdf.jar
remove pbprdf.jar? y
$ java -jar pbprdf.jar 
Error: Unable to access jarfile pbprdf.jar
$ sbt assembly
[... output from sbt ...]
$ java -jar pbprdf.jar
(it works)

But if one or more of the unit tests fail, it won't generate the jar file. I bet that's what's happening.

Is sbt giving you a message about test failure? It'll look like this:

[info] - should _some test name_ *** FAILED ***

If so, let me know what the message is. Hopefully I can just fix it and then it should all work.

andrewstellman commented 6 years ago

Quick update. I did a little investigating, and found that under some conditions log messages could cause a unit test to fail. I committed a fix for the issue. Try pulling again and re-running, see if that generates pbprdf.jar correctly.

danielhmills commented 6 years ago

Tried again,

Running sbt assemble provides the following errors:

> [info] *** 2 TESTS FAILED ***
[error] Failed tests:
[error]     com.stellmangreene.pbprdf.test.EspnPlayByPlaySpec
[error] (Test / test) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 38 s, completed Sep 28, 2018 10:55:27 PM
andrewstellman commented 6 years ago

Well, that's not something you should have to deal with if you want to use pbprdf. I packaged up the current version into a release (release 1.0.1) and updated README.md with details. If you have any problems running it, definitely create a new issue for it and I'll see if I can help. I hope this helps! Let me know if it works for you.

Also, it would be fantastic if you could paste the output of the specific failures so I can try to troubleshoot them.

danielhmills commented 5 years ago

Hi Andrew,

I gave release (release 1.0.1) a try a few moments ago, unfortunately ran into another snag.

./pbprdf wnba-2018-playoffs/ wnba-2018-playoffs.ttl Output:

$./pbprdf wnba-2018-playoffs/ wnba-2018-playoffs.ttl
log4j:WARN No appenders could be found for logger (com.stellmangreene.pbprdf.PbpRdfApp$).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
andrewstellman commented 5 years ago

Argh, frustrating! That message usually indicates that logging isn't configured, which is preventing it from printing messages. Normally that's caused when there's no log configuration file, but I included one. Did it actually create the wnba-2018-playoffs.ttl file? What operating system and Java version ("java -version") are you using?

danielhmills commented 5 years ago

Ah! I didn't notice that the document was still being created.

I was able to generate .TTL documents for both the WNBA and NBA data using ./pbprdf and loaded them to a live Virtuoso Instance which can be viewed here:

In terms of the error messages, I'm using Mac OS X, and Java version 1.8.0_121

Thanks for your help and assistance!

andrewstellman commented 5 years ago

Excellent! If you think of any improvements, let me know. I'll leave this issue open, hopefully I can find a way to reproduce it and fix it.

danielhmills commented 5 years ago

Sounds good, and will do!

I accidentally left out the live links in my last message:

One of your queries from 'Analysis: 3-point shot percentage after other team makes or misses' -- https://tinyurl.com/y9vsrtbk

View using Faceted Browsing -- https://tinyurl.com/y944nfs8

namedgraph commented 5 years ago

Hi. Can't we just have the RDF datasets up for download somewhere? :) Pretty please.

andrewstellman commented 5 years ago

I would love to do that! Any chance that you happen to be an IP attorney? Because I have have no idea if that would violate the copyright. Sports leagues are enormously protective of their intellectual property.

I'll tell you what, though – when WNBA season starts up again, I'll be spending some time with the folks at the Lynx/Timbewolves organization. I'll make a point of asking about this. I'll also reach out to some of the folks who taught about IP in the graduate program I went to at Columbia and see if they have any ideas.

If it's legal for me to do post the processed play-by-play data, or if I can get permission without having to pay for it, I definitely will!

namedgraph commented 5 years ago

Thanks for the update!