Skip to content

Instantly share code, notes, and snippets.

@nickynicolson
Last active August 29, 2015 13:57
Show Gist options
  • Save nickynicolson/9645618 to your computer and use it in GitHub Desktop.
Save nickynicolson/9645618 to your computer and use it in GitHub Desktop.
Peter's use cases for the taxonomic mind mapper
Peter investigates the taxonomy of Diplazium tomentosum.
//console
He starts with one of the types from the Leiden herbarium (http://plants.jstor.org/specimen/l0051073):
[source,cypher]
----
CREATE (s:Specimen{id:"L0051073"
,jstorUrl:'http://plants.jstor.org/specimen/l0051073'
,heldIn:'L'
,collector:'Blume'
,locality:"Java"
,country:"Indonesia"})
,(n:Name{name:"Diplazium tomentosum Blume", ipniid: "17089100-1", ref:"http://biodiversitylibrary.org/page/31163025"})
,(s)-[:TYPE_OF]->(n)
RETURN s, n
----
Now he adds details of another type specimen from Berlin: http://plants.jstor.org/specimen/b%2020%200051655
[source,cypher]
----
MATCH (n:Name{ipniid: '17089100-1'})
CREATE (s:Specimen{id:'B-20-0051655',heldIn:'B'})
, (s)-[:TYPE_OF]->(n)
RETURN s, n
----
He next adds in specimens which have been verified to Diplazium tomentosum, such as this one (http://plants.jstor.org/specimen/gh00022916) from the GH herbarium:
[source,cypher]
----
MATCH (n2:Name{ipniid: '17089100-1'})
CREATE (s:Specimen{id:'GH00022916'
,heldIn:'GH'
,jstorUrl:'http://plants.jstor.org/specimen/gh00022916'
,fieldNumber:'386'
,collector:'H. Cuming'})
, (n1:Name{name:'Asplenium deflexum Mett.',ipniid:'17042170-1'})
, (s)-[:VERIFIED_AS{verifier:'M.G.Price'}]->(n2)
, (s)-[:ISOTYPE_OF]->(n1)
RETURN s, n1, n2
----
He finds a duplicate of this specimen at the Michigan herbarium (http://plants.jstor.org/specimen/mich1190057) and adds this too:
[source,cypher]
----
MATCH (n1:Name{ipniid:'17089100-1'})
, (n2:Name{ipniid:'17042170-1'})
CREATE (s:Specimen{id:'MICH1190057'
,jstorUrl:'http://plants.jstor.org/specimen/mich1190057'
,collector:'H. Cuming'
,fieldNumber:'386'
,eventDate:'1840'
,locality:'Melaka, Malay Peninsula'
,country:'Malaysia'
,heldIn:'MICH'})
, (s)-[:VERIFIED_AS{verifier:'M.G.Price',verificationDate:'1978'}]->(n1)
, (s)-[:ISOTYPE_OF]->(n2)
RETURN s, n1, n2
----
He looks at some material from Brussels (http://plants.jstor.org/specimen/br0000006990008)
[source,cypher]
----
MATCH (n1:Name{ipniid: '17089100-1'})
CREATE (s:Specimen{id:'BR0000006990008'
,jstorUrl:'http://plants.jstor.org/specimen/br0000006990008'
,heldIn:'BR'
,collector:'Roxburgh W.'
,fieldNumber:'S.N.'
})
, (n2:Name{ipniid: '17044840-1',name:'Asplenium hemionitoides Roxb.'})
, (s)-[:VERIFIED_AS{verifier:'Morton C.V.',verificationDate:'1970/7/1'}]->(n1)
, (s)-[:LECTOTYPE_OF]->(n2)
RETURN n1,s,n2
----
Next stop - Sweden, where Peter finds a couple of specimens of interest, one from Taiwan:
[source,cypher]
----
MATCH (n1:Name{ipniid: '17089100-1'})
CREATE (s:Specimen{id:'SP10962'
,jstorUrl:'http://plants.jstor.org/specimen/s-p-10962'
,heldIn:'SP'
,collector:'Faurie, U.J.'
,fieldNumber:'168'
,locality:'Formosa. Urai.'
,country:'Taiwan, Province of China (Taiwan)'
,eventDate:'1914/4'})
, (n2:Name{name:'Diplazium crenato-serratum (Blume) T.Moore var. hirta Rosenst.'})
, (s)-[:VERIFIED_AS]->(n1)
, (s)-[:TYPE_OF]->(n2)
RETURN n1, s, n2
----
And finally one from Sumatra:
[source,cypher]
----
CREATE (s:Specimen{id:'SP4702'
,jstorUrl:'http://plants.jstor.org/specimen/s-p-4702'
,heldIn:'SP'
,collector:'Burchard, O.'
,fieldNumber:'121'
,locality:'Sumatera: Indragiri, inter Tjinaco et Pukan Herun.'
,eventDate:'1907'})
, (n:Name{name:'Diplazium burchardii Rosenst.',ipniid:'17246030-1'})
, (s)-[:TYPE_OF]->(n)
RETURN s, n
----
//graph
Peter also has some unidentified specimens, from BM and L:
BM AC.Jermy 7493
BM AC.Jermy 7471
BM AHG.Alston 16550
BM,L AHG.Alston 16524
BM AHG.Alston 15683
L E.Hennipman 6040
L GJ de Joncheere 1345
L GJ de Joncheere 1384
L GJ de Joncheere 1059
He adds these to his "mind map":
[source,cypher]
----
CREATE (s1:Specimen{heldIn:'BM',collector:'AC.Jermy',fieldNumber:'7493',locality:'Sulawesi'})
, (s2:Specimen{heldIn:'BM',collector:'AC.Jermy',fieldNumber:'7471',locality:'Sulawesi'})
, (s3:Specimen{heldIn:'BM',collector:'AHG.Alston',fieldNumber:'16550',locality:'Sulawesi'})
, (s4:Specimen{heldIn:'BM',collector:'AHG.Alston',fieldNumber:'16524',locality:'Sulawesi'})
, (s5:Specimen{heldIn:'L',collector:'AHG.Alston',fieldNumber:'16524',locality:'Sulawesi'})
, (s6:Specimen{heldIn:'BM',collector:'AHG.Alston',fieldNumber:'15683',locality:'Sulawesi'})
, (s7:Specimen{heldIn:'L',collector:'E.Hennipman',fieldNumber:'6040',locality:'Sulawesi'})
, (s8:Specimen{heldIn:'L',collector:'GJ de Joncheere',fieldNumber:'1345',locality:'Sulawesi'})
, (s9:Specimen{heldIn:'L',collector:'GJ de Joncheere',fieldNumber:'1384',locality:'Sulawesi'})
, (s10:Specimen{heldIn:'L',collector:'GJ de Joncheere',fieldNumber:'1059',locality:'Sulawesi'})
RETURN s1,s2,s3,s4,s5,s6,s7,s8,s9,s10
----
//graph
Armed with this data, Peter wants to:
1) To establish links establishing a “typeof” relation between specimen, relevant publication and the relevant IPNI-reference for all type specimens *Done*
1a) To annotate the link for B 20 0051655 to say that I at this moment do not believe that it is in fact a type specimen. *Done*
[source,cypher]
----
MATCH (s:Specimen{id:'B-20-0051655',heldIn:'B'})-[r:TYPE_OF]->()
SET r.disputedBy='PH'
RETURN s
----
//graph
2) To establish a link showing the two Cuming 386 specimens in MICH and GH to be duplicates. *Done*
[source,cypher]
----
MATCH (s_mich:Specimen{heldIn:'MICH',fieldNumber:'386',collector:'H. Cuming'})
, (s_gh:Specimen{heldIn:'GH',fieldNumber:'386',collector:'H. Cuming'})
CREATE (s_mich)-[:DUPLICATE_OF{accordingTo:'PH'}]->(s_gh)
RETURN s_mich,s_gh
----
//graph
3) To establish links between all type specimens except S-P-10962 to state that they are conspecific with the Blume type
4) To establish links establishing conspecificity between all BM-specimens listed for Sulawesi. *Done*:
[source,cypher]
----
MATCH(s:Specimen{heldIn:'BM',locality:'Sulawesi'})
WITH collect(s) as specimens
FOREACH (x IN specimens |
FOREACH (y IN filter(z IN specimens WHERE NOT (z=x)) |
MERGE (x)-[:CONSPECIFIC_WITH{accordingTo:'PH'}]-(y)
)
)
----
And the same between all L specimens listed for Sulawesi. *Done*:
[source,cypher]
----
MATCH(s:Specimen{heldIn:'L',locality:'Sulawesi'})
WITH collect(s) as specimens
FOREACH (x IN specimens |
FOREACH (y IN filter(z IN specimens WHERE NOT (z=x)) |
MERGE (x)-[:CONSPECIFIC_WITH{accordingTo:'PH'}]-(y)
)
)
----
//graph
5) To establish a link showing that Alston 16524 (BM) is a duplicate of Alston 16524 (L). *Done*
[source,cypher]
----
MATCH (s_bm:Specimen{heldIn:'BM',fieldNumber:'16524',collector:'AHG.Alston'})
, (s_l:Specimen{heldIn:'L',fieldNumber:'16524',collector:'AHG.Alston'})
CREATE (s_bm)-[:DUPLICATE_OF{accordingTo:'PH'}]->(s_l)
RETURN s_bm,s_l
----
//graph
6) To establish a link establishing conspecificity between one of the L specimens and the Blume type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment