This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= Roosevelt Family Geneaology | |
:neo4j-version: 2.1.0 | |
:author: Suellen Stringer-Hye | |
:twitter: @suellenshye | |
:tags: domain:education, use-case:geneaology | |
== Purpose of Graph |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= Roosevelt Family Geneaology | |
:neo4j-version: 2.1.0 | |
:author: Suellen Stringer-Hye | |
:twitter: @suellenshye | |
:tags: domain:education, use-case:geneaology | |
== Purpose of Graph |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "3.1"; | |
(: FUNCTION: Whether all the values in a sequence are distinct http://www.xqueryfunctions.com/xq/functx_are-distinct-values.html :) | |
declare namespace functx = "http://www.functx.com"; | |
declare function functx:are-distinct-values | |
($seq as xs:anyAtomicType* ) as xs:boolean { | |
count(distinct-values($seq)) = count($seq)}; | |
(: Converts sentences into verses and returns verses containing duplicate lemmata :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "3.1"; | |
declare function local:get_facet ($books as element()*, $path as xs:string, $facet_type as xs:string ) as element()? | |
{ | |
<facet type="{$facet_type}">{ | |
for $book in $books | |
let $fld := $book/*[name()=$path] | |
group by $f := $fld | |
order by $f descending | |
return element {$facet_type} {attribute v {$f}, attribute number {fn:count($book)} } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<terms> | |
<term> | |
<path>date</path> | |
<facet>date</facet> | |
</term> | |
</terms> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "3.1"; | |
(: Thanks to Tao You!! :) | |
declare function local:get_facet ($books as element()*, $path as xs:string, $facet_type as xs:string ) as element()? | |
{ | |
<facet type="{$facet_type}">{ | |
for $book in $books | |
let $fld := $book/*[name()=$path] | |
group by $f := $fld |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "3.1"; | |
declare namespace functx = "http://www.functx.com"; | |
for $title in fn:collection("books")/record/Title | |
let $string-fun := "fn:upper-case" | |
return xquery:eval( | |
"declare variable $title external;" || | |
$string-fun || "($title)", | |
map { 'title': $title } ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--reference implementation in Haskell | |
qsort' :: (Ord a) => [a] -> [a] | |
qsort' [] = [] | |
qsort' (x:xs) = qsort' smaller ++ [x] ++ qsort' larger | |
where larger = [a | a <- xs, a > x] | |
smaller = [b | b <- xs, b <= x] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
See http://www.gbif.org/developer/summary for background. | |
Find the single occurrence with identifier http://bioimages.vanderbilt.edu/vanderbilt/7-314#2002-06-14 | |
http://api.gbif.org/v1/occurrence/search?occurrenceID=http%3A%2F%2Fbioimages.vanderbilt.edu%2Fvanderbilt%2F7-314%232002-06-14 | |
Note: the occurrenceID is URLencoded. | |
Find occurrences | |
- with scientificName=Quercus%20macrocarpa (bur oak, note: space between genus and species is URLencoded as "%20") | |
- with decimalLatitude between 35.81 and 36.45 | |
- with decimalLongitude between -87.21 and -86.27 |
OlderNewer