An API of Ice And Fire
April 6, 2016 7:53 PM   Subscribe

 
Possibly I need docs.

http://anapioficeandfire.com/api/maimings/
Response: 404 Not Found

posted by mwhybark at 7:57 PM on April 6, 2016 [1 favorite]


Hodor
posted by dis_integration at 8:14 PM on April 6, 2016 [1 favorite]


I thought it was the GoT Crusader Kings 2 mod
posted by T.D. Strange at 8:15 PM on April 6, 2016 [3 favorites]


Surely

http://anapioficeandfire.com/api/nedshead/
Response: 404 Not Found

http://anapioficeandfire.com/api/littletheon/
Response: 404 Not Found

posted by snuffleupagus at 8:16 PM on April 6, 2016 [3 favorites]


How am I supposed to read this? It's just a bunch of code. I'll stick with Westeros.org.
posted by Hazelsmrf at 8:21 PM on April 6, 2016 [1 favorite]


Can someone who knows programming explain what this is and what it's for to those of us who don't?
posted by Sangermaine at 8:25 PM on April 6, 2016


It's the world of asoiaf turned into data that's retrievable with other software, to be used programmatically.
posted by tofu_crouton at 8:57 PM on April 6, 2016 [1 favorite]


So it can be used for data crunching, building other software, etc.
posted by tofu_crouton at 8:58 PM on April 6, 2016


Yeah, basically "structured data" means that it's arranged (structured) in a defined way that can be easily dealt with by computer programs in general, which makes it easy for programmers to write programs that interact with and use the data. So, for instance, you could write software to generate things like character relationship heat maps, or stuff like that.
posted by Itaxpica at 9:21 PM on April 6, 2016


Whooooooooosh, way over my head.
posted by Hazelsmrf at 9:52 PM on April 6, 2016 [1 favorite]


I wonder if you can find a character of interest by name directly, without searching through all the numbers and applying filter parameters.
posted by a lungful of dragon at 10:21 PM on April 6, 2016


I wonder if you can find a character of interest by name directly, without searching through all the numbers and applying filter parameters.

You can apply filters to the strings, though you do need the name: curl http://www.anapioficeandfire.com/api/characters?name=Petyr+Baelish will get you the data on Littlefinger for instance. No fuzzy matching, unfortunately.
posted by Going To Maine at 11:09 PM on April 6, 2016


Ah, they don't use URL encoding. I guess that's why it didn't work for me.
posted by a lungful of dragon at 11:12 PM on April 6, 2016


Can someone who knows programming explain what this is and what it's for to those of us who don't?

Essentially, it's a website that will take relatively straightforward URLs and give you back a JSON formatted document. (Lots of curly braces and lists of key-value pairs.) This is a fairly silly example because the amount of data is quite small - you could probably dump the whole thing and it wouldn't take more than a few megabytes of disk (and that's being generous) - and also static. Twitter has an API that you hit periodically to get back updated lists of recent tweets. Given the pace of GRRM's writing and HBO show production, you probably don't need to hit this particular API for updates more than once per year, if that. So this is whole project is decadent to the extreme, but also fun and a way for a programmer to strut their stuff.
posted by Going To Maine at 11:27 PM on April 6, 2016


Can someone who knows programming explain what this is and what it's for to those of us who don't?

Going to Maine covered it pretty well - but I'll take a crack. This guy made a representation (pretty raw, Jon Snow is https://anapioficeandfire.com/api/characters/583, for example) of the relationship of entities in asoiaf and made a way to pull that stuff out (via something that looks pretty REST, very au courant in today's nerd world) into a non-static/computed format (JSON, as if any current code slinger would be caught serializing data in anything else this season). You could have done something similar with SQL, but people who know SQL are old and are actively being put out to pasture, if not taken out back and shot.

As these relationships were determined via automation (he mentions use of Microsoft's entity framework) then GRRM could just run the same thing over his book in progress (hah) and diff the output against what's already here to computationally determine whether or not there are any continuity issues.

Regardless, this is the first step. The next steps are to pretty it up, then take the JSON output and denormalize them/blow them out even more into a semantic triple datastore. So instead of a single JSON doc telling us all about one entity like Jon Snow you get a bunch of facts over all entities ("Jon Snow is Lord Snow", "Jon Snow born in 283 AC", "Joffery is kind of a dick", etc.). What's that win you? That wins you inferencing. Inferencing is where you let our soon to be AI overlords derive new facts for us. For example, for Jon Snow, the entity framework fails to populate this part:

"father": "",
"mother": "",


I'm pretty sure any decent inferencing engine would come up with the answer. By all rights, the link above should propagate across the nerd internet, then after someone builds the thing I'm describing, the next FPP should be "IBM's Deep Thrones (TM) knows who Jon Snow's parents are!"

In conclusion, this is probably the single nerdiest piece of writing I've ever committed to the internet - and that's really saying something.
posted by NoRelationToLea at 2:40 AM on April 7, 2016 [8 favorites]


The name thing is also complicated by deciding if what you call a person is their "name" or what they are "known as". Don't even get me started on the fact that it only lists one mother and father per character. I play GoT and ASOIAF quiz up a lot and they always trip me up with questions about heritage. Is it who their father really is or who we think it is in book 1 or who /r/asoiaf thinks it is?
posted by tofu_crouton at 4:52 AM on April 7, 2016


Glad I came into this late, I would've failed at explaining what an API is to the non-programming folks. Nevertheless, this is super neat! I dunno what I can do with it yet, but I'm glad it exists!
posted by numaner at 1:42 PM on April 7, 2016


(JSON, as if any current code slinger would be caught serializing data in anything else this season)

Uh, msgpack? Get with it, Pops!
posted by Going To Maine at 3:57 PM on April 7, 2016 [1 favorite]




« Older It’s hard for me to consider a penis in my mouth...   |   25 Innocent Coloring Book Pictures Made Instantly... Newer »


This thread has been archived and is closed to new comments