HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
andrewstellman
pbprdf
Python2018–2019
andrewstellman / pbprdf

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.

2Distinct people
4Mentions
0Explicit recommenders
82GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

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.

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by month4 dated mentions

Observed mentions: 2018-03-08 05:40:28 UTC to 2019-03-18 14:20:39 UTC.

0122018-03-01 00:00:00 UTC to 2018-04-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 commentsMar 20182018-04-01 00:00:00 UTC to 2018-05-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-05-01 00:00:00 UTC to 2018-06-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-06-01 00:00:00 UTC to 2018-07-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2018-07-01 00:00:00 UTC to 2018-08-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-08-01 00:00:00 UTC to 2018-09-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-09-01 00:00:00 UTC to 2018-10-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsSep 20182018-10-01 00:00:00 UTC to 2018-11-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-11-01 00:00:00 UTC to 2018-12-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-12-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-01-01 00:00:00 UTC to 2019-02-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-02-01 00:00:00 UTC to 2019-03-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-03-01 00:00:00 UTC to 2019-04-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsMar 2019

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Mar 20182018-03-01 00:00:00 UTC2018-04-01 00:00:00 UTC202
Apr 20182018-04-01 00:00:00 UTC2018-05-01 00:00:00 UTC000
May 20182018-05-01 00:00:00 UTC2018-06-01 00:00:00 UTC000
Jun 20182018-06-01 00:00:00 UTC2018-07-01 00:00:00 UTC101
Jul 20182018-07-01 00:00:00 UTC2018-08-01 00:00:00 UTC000
Aug 20182018-08-01 00:00:00 UTC2018-09-01 00:00:00 UTC000
Sep 20182018-09-01 00:00:00 UTC2018-10-01 00:00:00 UTC000
Oct 20182018-10-01 00:00:00 UTC2018-11-01 00:00:00 UTC000
Nov 20182018-11-01 00:00:00 UTC2018-12-01 00:00:00 UTC000
Dec 20182018-12-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
Jan 20192019-01-01 00:00:00 UTC2019-02-01 00:00:00 UTC000
Feb 20192019-02-01 00:00:00 UTC2019-03-01 00:00:00 UTC000
Mar 20192019-03-01 00:00:00 UTC2019-04-01 00:00:00 UTC101

What Hacker News says

4 sources
I'm seeing several people asking what RDF is useful for. If you're curious, I use it for basketball analytics: https://github.com/andrewstellman/pbprdf Here's an article about my system, pbprdf: https://www.zdnet.com/article/nba-analytics-and-rdf-graphs-g... And an example of its use: https://gist.github.com/andrewstellman/4872dbb9dc7593e56abdd... Here's an example of what the RDF files generated by pbprdf look like: Here's the ontology, which defines the vocabulary it uses: https://github.com/andrewstellman/pbprdf/blob/master/generat... And this is what the data looks like: <pbprdf/games/2017-11-29_Warriors_at_Lakers/230> pbprdf:shotPoints "3"^^xsd:int ; pbprdf:shotAssistedBy <pbprdf/players/Klay_Thompson> ; pbprdf:shotType "26-foot three point jumper" ; pbprdf:shotMade "true"^^xsd:boolean ; a pbprdf:Sho
Read the rest
t ; pbprdf:shotBy <pbprdf/players/Stephen_Curry> ; a pbprdf:Play ; pbprdf:forTeam <pbprdf/teams/Warriors> ; pbprdf:inGame <pbprdf/games/2017-11-29_Warriors_at_Lakers> ; pbprdf:time "10:23" ; pbprdf:period "3"^^xsd:int ; a pbprdf:Event ; rdfs:label "Warriors: Stephen Curry makes 26-foot three point jumper (Klay Thompson assists)" ; pbprdf:secondsIntoGame "1537"^^xsd:int ; pbprdf:secondsLeftInPeriod "623"^^xsd:int .
In Apache Jena
This is interesting, I always wanted to find a good use case for RDF but in the end RDBMS worked out fine. Sports events seem a good example. What made it easier for you in your example of basketball play-by-plays with RDF? Taking the first example https://github.com/andrewstellman/pbprdf#example-analyze-a-s... and translating it into an RDBMS approach seems rather straight forward: GameEvent (PersonA, EventType, PersonB, Game, Time) Roster (Person, Game, Team) To get the fouls drawn you then take SELECT Team, COUNT(Team) FROM GameEvent JOIN Roster ON GameEvent.Game = Roster.Game AND GameEvent.PersonB = Roster.Person WHERE GameEvent.EventType = "foul" GROUP BY Roster.Team Is it because of easier schema changes later on like introducing "secondsLeftInPeriod"? I suppose in a normalized relational scenario that could be somet
Read the rest
hing like: Period (Number, Game, StartTime, EndTime) And doing .. WHERE Period.EndTime - GameEvent.Time < 5 ..
In Ask HN: If you've used a graph database, would you use it again?
I've been using RDF and triplestores / RDF databases for the last half-decade, developing both front-end and back-end systems, and training many developers to work in RDF. If you're used to either relational databases or object-oriented design, it's a really different way of thinking about data. Just like OOP is really good for certain kinds of problems and models, and RDBMS is good for other kinds of problems and models, RDF is great for specific kinds of problems. For example, if you need to combine several data from several somewhat incongruent sources into a single coherent database (e.g. dozens of data feeds that are almost the same, but you need to preserve the differences while combining the parts that are the same), you might end up with headaches trying to come up with a good RDBMS design; RDF is really well-suited for that kind
Read the rest
of problem. While a lot of the work I do is covered by NDA, one problem that I've applied it that I can talk about is analyzing basketball play-by-plays. I've spent some time talking to the analytics team at an NBA franchise, and it turns out doing interesting analytics on play-by-plays can be a surprisingly tough nut to crack. RDF was a great tool for tackling this. Here's the source (written in Scala), for anyone interested at having a look: https://github.com/andrewstellman/pbprdf
In Ask HN: If you've used a graph database, would you use it again?

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.