Skip to content

Instantly share code, notes, and snippets.

@AdamSteffanick
Forked from CliffordAnderson/books.csv
Last active October 16, 2015 19:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdamSteffanick/ecf1240e182fe7d86fd4 to your computer and use it in GitHub Desktop.
Save AdamSteffanick/ecf1240e182fe7d86fd4 to your computer and use it in GitHub Desktop.
Some books
Author Title ISBN Binding Year Published
Jeannette Walls The Glass Castle 074324754X Paperback 2006
James Surowiecki The Wisdom of Crowds 385721706 Paperback 2005
Lawrence Lessig The Future of Ideas 375726446 Paperback 2002
Larry Bossidy, Ram Charan, Charles Burck Execution 609610570 Hardcover 2002
Kurt Vonnegut Slaughterhouse-Five 385333846 Paperback 1999
Haruki Murakami After the Quake 375713271 Paperback 2003
Nassim Nicholas Taleb Fooled by Randomness 812975219 Paperback 2005
Robert A. Dahl On Democracy (Yale Nota Bene) 300084552 Paperback 2000
Daniel Defoe A Journal of the Plague Year 375757899 Paperback 2001
Philip K. Dick Do Androids Dream of Electric Sheep? 345404475 Paperback 1996
Janna Levin A Madman Dreams of Turing Machines 1400040302 Hardcover 2006
Alan Moore, David Lloyd V for Vendetta 930289528 Paperback 1995
Edward W. Said Orientalism 039474067X Paperback 1979
Gary Shteyngart The Russian Debutante's Handbook 1573229881 Paperback 2003
Raymond Chandler Farewell, My Lovely 394758277 Paperback 1992
Stefan Zweig Beware of Pity 1590172000 Paperback 2006
James Blish A Case of Conscience 345438353 Paperback 2000
Alan Moore Watchmen 930289234 Paperback 1995
Marilynne Robinson Gilead 374153892 Hardcover 2004
<record>
<Author>Alan Moore</Author>
<Title>Watchmen</Title>
<ISBN>930289234</ISBN>
<Binding>Paperback</Binding>
<Year_Published>1995</Year_Published>
</record>
<record>
<Author>Alan Moore, David Lloyd</Author>
<Title>V for Vendetta</Title>
<ISBN>930289528</ISBN>
<Binding>Paperback</Binding>
<Year_Published>1995</Year_Published>
</record>
<record>
<Author>Daniel Defoe</Author>
<Title>A Journal of the Plague Year</Title>
<ISBN>375757899</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2001</Year_Published>
</record>
<record>
<Author>Edward W. Said</Author>
<Title>Orientalism</Title>
<ISBN>039474067X</ISBN>
<Binding>Paperback</Binding>
<Year_Published>1979</Year_Published>
</record>
<record>
<Author>Gary Shteyngart</Author>
<Title>The Russian Debutante's Handbook</Title>
<ISBN>1573229881</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2003</Year_Published>
</record>
<record>
<Author>Haruki Murakami</Author>
<Title>After the Quake</Title>
<ISBN>375713271</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2003</Year_Published>
</record>
<record>
<Author>James Blish</Author>
<Title>A Case of Conscience</Title>
<ISBN>345438353</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2000</Year_Published>
</record>
<record>
<Author>James Surowiecki</Author>
<Title>The Wisdom of Crowds</Title>
<ISBN>385721706</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2005</Year_Published>
</record>
<record>
<Author>Janna Levin</Author>
<Title>A Madman Dreams of Turing Machines</Title>
<ISBN>1400040302</ISBN>
<Binding>Hardcover</Binding>
<Year_Published>2006</Year_Published>
</record>
<record>
<Author>Jeannette Walls</Author>
<Title>The Glass Castle</Title>
<ISBN>074324754X</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2006</Year_Published>
</record>
<record>
<Author>Kurt Vonnegut</Author>
<Title>Slaughterhouse-Five</Title>
<ISBN>385333846</ISBN>
<Binding>Paperback</Binding>
<Year_Published>1999</Year_Published>
</record>
<record>
<Author>Larry Bossidy, Ram Charan, Charles Burck</Author>
<Title>Execution</Title>
<ISBN>609610570</ISBN>
<Binding>Hardcover</Binding>
<Year_Published>2002</Year_Published>
</record>
<record>
<Author>Lawrence Lessig</Author>
<Title>The Future of Ideas</Title>
<ISBN>375726446</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2002</Year_Published>
</record>
<record>
<Author>Marilynne Robinson</Author>
<Title>Gilead</Title>
<ISBN>374153892</ISBN>
<Binding>Hardcover</Binding>
<Year_Published>2004</Year_Published>
</record>
<record>
<Author>Nassim Nicholas Taleb</Author>
<Title>Fooled by Randomness</Title>
<ISBN>812975219</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2005</Year_Published>
</record>
<record>
<Author>Philip K. Dick</Author>
<Title>Do Androids Dream of Electric Sheep?</Title>
<ISBN>345404475</ISBN>
<Binding>Paperback</Binding>
<Year_Published>1996</Year_Published>
</record>
<record>
<Author>Raymond Chandler</Author>
<Title>Farewell, My Lovely</Title>
<ISBN>394758277</ISBN>
<Binding>Paperback</Binding>
<Year_Published>1992</Year_Published>
</record>
<record>
<Author>Robert A. Dahl</Author>
<Title>On Democracy (Yale Nota Bene)</Title>
<ISBN>300084552</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2000</Year_Published>
</record>
<record>
<Author>Stefan Zweig</Author>
<Title>Beware of Pity</Title>
<ISBN>1590172000</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2006</Year_Published>
</record>
xquery version "3.1";
let $csv := fetch:text("https://gist.githubusercontent.com/AdamSteffanick/ecf1240e182fe7d86fd4/raw/690b90b8b8aaa5dd9f29ca1949af12e9c9fa996e/books.csv")
let $books := csv:parse($csv, map { "header": true() })/csv/record
for $book in $books
order by $book/Author (: Sort books alphabetically by author :)
return $book
<Paperback>
<record>
<Author>Alan Moore</Author>
<Title>Watchmen</Title>
<ISBN>930289234</ISBN>
<Binding>Paperback</Binding>
<Year_Published>1995</Year_Published>
</record>
<record>
<Author>Alan Moore, David Lloyd</Author>
<Title>V for Vendetta</Title>
<ISBN>930289528</ISBN>
<Binding>Paperback</Binding>
<Year_Published>1995</Year_Published>
</record>
<record>
<Author>Daniel Defoe</Author>
<Title>A Journal of the Plague Year</Title>
<ISBN>375757899</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2001</Year_Published>
</record>
<record>
<Author>Edward W. Said</Author>
<Title>Orientalism</Title>
<ISBN>039474067X</ISBN>
<Binding>Paperback</Binding>
<Year_Published>1979</Year_Published>
</record>
<record>
<Author>Gary Shteyngart</Author>
<Title>The Russian Debutante's Handbook</Title>
<ISBN>1573229881</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2003</Year_Published>
</record>
<record>
<Author>Haruki Murakami</Author>
<Title>After the Quake</Title>
<ISBN>375713271</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2003</Year_Published>
</record>
<record>
<Author>James Blish</Author>
<Title>A Case of Conscience</Title>
<ISBN>345438353</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2000</Year_Published>
</record>
<record>
<Author>James Surowiecki</Author>
<Title>The Wisdom of Crowds</Title>
<ISBN>385721706</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2005</Year_Published>
</record>
<record>
<Author>Jeannette Walls</Author>
<Title>The Glass Castle</Title>
<ISBN>074324754X</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2006</Year_Published>
</record>
<record>
<Author>Kurt Vonnegut</Author>
<Title>Slaughterhouse-Five</Title>
<ISBN>385333846</ISBN>
<Binding>Paperback</Binding>
<Year_Published>1999</Year_Published>
</record>
<record>
<Author>Lawrence Lessig</Author>
<Title>The Future of Ideas</Title>
<ISBN>375726446</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2002</Year_Published>
</record>
<record>
<Author>Nassim Nicholas Taleb</Author>
<Title>Fooled by Randomness</Title>
<ISBN>812975219</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2005</Year_Published>
</record>
<record>
<Author>Philip K. Dick</Author>
<Title>Do Androids Dream of Electric Sheep?</Title>
<ISBN>345404475</ISBN>
<Binding>Paperback</Binding>
<Year_Published>1996</Year_Published>
</record>
<record>
<Author>Raymond Chandler</Author>
<Title>Farewell, My Lovely</Title>
<ISBN>394758277</ISBN>
<Binding>Paperback</Binding>
<Year_Published>1992</Year_Published>
</record>
<record>
<Author>Robert A. Dahl</Author>
<Title>On Democracy (Yale Nota Bene)</Title>
<ISBN>300084552</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2000</Year_Published>
</record>
<record>
<Author>Stefan Zweig</Author>
<Title>Beware of Pity</Title>
<ISBN>1590172000</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2006</Year_Published>
</record>
</Paperback>
<Hardcover>
<record>
<Author>Janna Levin</Author>
<Title>A Madman Dreams of Turing Machines</Title>
<ISBN>1400040302</ISBN>
<Binding>Hardcover</Binding>
<Year_Published>2006</Year_Published>
</record>
<record>
<Author>Larry Bossidy, Ram Charan, Charles Burck</Author>
<Title>Execution</Title>
<ISBN>609610570</ISBN>
<Binding>Hardcover</Binding>
<Year_Published>2002</Year_Published>
</record>
<record>
<Author>Marilynne Robinson</Author>
<Title>Gilead</Title>
<ISBN>374153892</ISBN>
<Binding>Hardcover</Binding>
<Year_Published>2004</Year_Published>
</record>
</Hardcover>
xquery version "3.1";
let $csv := fetch:text("https://gist.githubusercontent.com/AdamSteffanick/ecf1240e182fe7d86fd4/raw/690b90b8b8aaa5dd9f29ca1949af12e9c9fa996e/books.csv")
let $books := csv:parse($csv, map { "header": true() })/csv/record
for $book in $books
order by $book/Author (: Sort books alphabetically by author :)
let $binding := $book/Binding
group by $binding (: Group books by binding :)
return element {$binding} {$book}
<csv>
<record>
<Author>Jeannette Walls</Author>
<Title>The Glass Castle</Title>
<ISBN>074324754X</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2006</Year_Published>
</record>
<record>
<Author>James Surowiecki</Author>
<Title>The Wisdom of Crowds</Title>
<ISBN>385721706</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2005</Year_Published>
</record>
<record>
<Author>Lawrence Lessig</Author>
<Title>The Future of Ideas</Title>
<ISBN>375726446</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2002</Year_Published>
</record>
<record>
<Author>Larry Bossidy, Ram Charan, Charles Burck</Author>
<Title>Execution</Title>
<ISBN>609610570</ISBN>
<Binding>Hardcover</Binding>
<Year_Published>2002</Year_Published>
</record>
<record>
<Author>Kurt Vonnegut</Author>
<Title>Slaughterhouse-Five</Title>
<ISBN>385333846</ISBN>
<Binding>Paperback</Binding>
<Year_Published>1999</Year_Published>
</record>
<record>
<Author>Haruki Murakami</Author>
<Title>After the Quake</Title>
<ISBN>375713271</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2003</Year_Published>
</record>
<record>
<Author>Nassim Nicholas Taleb</Author>
<Title>Fooled by Randomness</Title>
<ISBN>812975219</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2005</Year_Published>
</record>
<record>
<Author>Robert A. Dahl</Author>
<Title>On Democracy (Yale Nota Bene)</Title>
<ISBN>300084552</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2000</Year_Published>
</record>
<record>
<Author>Daniel Defoe</Author>
<Title>A Journal of the Plague Year</Title>
<ISBN>375757899</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2001</Year_Published>
</record>
<record>
<Author>Philip K. Dick</Author>
<Title>Do Androids Dream of Electric Sheep?</Title>
<ISBN>345404475</ISBN>
<Binding>Paperback</Binding>
<Year_Published>1996</Year_Published>
</record>
<record>
<Author>Janna Levin</Author>
<Title>A Madman Dreams of Turing Machines</Title>
<ISBN>1400040302</ISBN>
<Binding>Hardcover</Binding>
<Year_Published>2006</Year_Published>
</record>
<record>
<Author>Alan Moore, David Lloyd</Author>
<Title>V for Vendetta</Title>
<ISBN>930289528</ISBN>
<Binding>Paperback</Binding>
<Year_Published>1995</Year_Published>
</record>
<record>
<Author>Edward W. Said</Author>
<Title>Orientalism</Title>
<ISBN>039474067X</ISBN>
<Binding>Paperback</Binding>
<Year_Published>1979</Year_Published>
</record>
<record>
<Author>Gary Shteyngart</Author>
<Title>The Russian Debutante's Handbook</Title>
<ISBN>1573229881</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2003</Year_Published>
</record>
<record>
<Author>Raymond Chandler</Author>
<Title>Farewell, My Lovely</Title>
<ISBN>394758277</ISBN>
<Binding>Paperback</Binding>
<Year_Published>1992</Year_Published>
</record>
<record>
<Author>Stefan Zweig</Author>
<Title>Beware of Pity</Title>
<ISBN>1590172000</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2006</Year_Published>
</record>
<record>
<Author>James Blish</Author>
<Title>A Case of Conscience</Title>
<ISBN>345438353</ISBN>
<Binding>Paperback</Binding>
<Year_Published>2000</Year_Published>
</record>
<record>
<Author>Alan Moore</Author>
<Title>Watchmen</Title>
<ISBN>930289234</ISBN>
<Binding>Paperback</Binding>
<Year_Published>1995</Year_Published>
</record>
<record>
<Author>Marilynne Robinson</Author>
<Title>Gilead</Title>
<ISBN>374153892</ISBN>
<Binding>Hardcover</Binding>
<Year_Published>2004</Year_Published>
</record>
</csv>
xquery version "3.1";
let $csv := fetch:text("https://gist.githubusercontent.com/AdamSteffanick/ecf1240e182fe7d86fd4/raw/690b90b8b8aaa5dd9f29ca1949af12e9c9fa996e/books.csv")
return csv:parse($csv, map { "header": true() })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment