Skip to content

Instantly share code, notes, and snippets.

@PeterHovenkamp
Forked from nickynicolson/Taxonomic-mind-mapper
Last active August 29, 2015 13:57
Show Gist options
  • Save PeterHovenkamp/9684109 to your computer and use it in GitHub Desktop.
Save PeterHovenkamp/9684109 to your computer and use it in GitHub Desktop.
We investigate the use of the scheme in: https://docs.google.com/document/d/1FIxNrrGrIZs0l4QJEdGfctXbYVL4cQhKspmMEHmKAGg/edit with a use case in the taxonomy of Diplazium tomentosum (https://docs.google.com/document/d/1vni44RBwGNZ7iRCFf243NtcD-7xwjHrDeAPehato7KY/edit?usp=sharing)
Our case starts with modelling the name D. tomentosum Blume. By definition, each name has a type collection.
Query 1:
[source,cypher]
----
CREATE (n:Name
{name:"Diplazium tomentosum Blume"
,ipniid: "17089100-1"
,URL:"http://biodiversitylibrary.org/page/31163025"}
)
,(c:CollectingEvent
{name:"Diplazium tomentosum Blume"}
)
,(c)-[:TypeOf]->(n)
RETURN n, c
----
//graph
A specimens is located in the Leiden herbarium (http://plants.jstor.org/specimen/l0051073),by definition, each specimen is modelled as derived from a collecting event.
Query 2:
[source,cypher]
----
CREATE (s:Specimen
{id:"L0051073"
,url:'http://plants.jstor.org/specimen/l0051073'
,heldIn:'L'}
)
, (c:CollectingEvent
{collector: "Blume"}
)
,(s)<-[:DerivedFrom]-(c)
RETURN s, c
----
//graph
After due consideration, we may conclude that the two collecting events are the same:
query 3:
[source,cypher]
----
MATCH ({name:"Diplazium tomentosum Blume"})<-[:TypeOf]-(c1)
MATCH ({id:"L0051073"})<-[:DerivedFrom]-(c2)
CREATE (c1)<-[:SameAs]-(c2)
----
//graph
Now we add details of another type specimen from Berlin: http://plants.jstor.org/specimen/b%2020%200051655
It is marked as type of Diplazium tomentosum Blume.
We model that as an assertion by Berlin that it is derived from the same collection event as the Leiden specimen.
Query 4:
[source,cypher]
----
MATCH ({name:"Diplazium tomentosum Blume"})<-[:TypeOf]-(c)
CREATE (s:Specimen
{id:'B-200051655'
,heldIn:'B'}
)
,(s) <-[r:DerivedFrom{AssertedBy: 'Berlin'}]- (c)
RETURN s, c, r
----
//graph
The graph now shows the basic relations between the three different types of nodes.
We can populate the graph with specimens from different herbaria,
starting with this one (http://plants.jstor.org/specimen/gh00022916) from the GH herbarium.
We have to introduce a new name to accomodate the type status of the specimen.
Query 5:
[source,cypher]
----
CREATE (n:Name
{name:'Asplenium deflexum Mett.'
,ipniid:'17042170-1'}
)
,(c:CollectingEvent
{CollNumber:'386'
,Collector:'H. Cuming'}
)
,(s:Specimen{id:'GH00022916'
,heldIn:'GH'
,url:'http://plants.jstor.org/specimen/gh00022916'}
)
, (s)<-[:DerivedFrom]-(c)
, (c)-[:TypeOf]->(n)
RETURN s, c, n
----
//graph
//table
Now we introduce some taxonomic work: Price has identified the GH specimen as D. tomentosum,
PH confirms this on basis of comparison of specimens.
Query 6:
[source,cypher]
----
MATCH ({name:"Diplazium tomentosum Blume"})<-[:TypeOf]-(c1)
MATCH (s1:Specimen{id:"L0051073"})
MATCH (s2:Specimen{id:'GH00022916'})
CREATE (s2)<-[:IdentifiedAs
{assertedBy:'M.G.Price 1989'}]-(c1)
, (s1) <-[:ConspecificWith
{AssertedBy: 'PH'}] -(s2)
RETURN s1, s2, c1
----
//graph
//table
We find that a duplicate of this specimen is at the Michigan herbarium (http://plants.jstor.org/specimen/mich1190057)
and this can now easily be added:
Query 6:
[source,cypher]
----
MATCH (c:CollectingEvent
{Collector:'H. Cuming'
,CollNumber: '386'}
)
CREATE (s:Specimen
{id:'MICH1190057'
,URL:'http://plants.jstor.org/specimen/mich1190057'
,heldIn:'MICH'})
, (s)<-[:DerivedFrom]-(c)
RETURN s, c
----
//graph
//table
Next stop is Brussels, where another specimen is held (http://plants.jstor.org/specimen/br0000006990008).
The annotations that come with this specimens are quite extensive, en introduce a number of new nodes.
Query 7:
[source,cypher]
----
MATCH ({name:"Diplazium tomentosum Blume"})<-[:TypeOf]-(c2)
CREATE (c:CollectingEvent
{Collector: 'Roxburgh W.'
,CollNumber:'S.N.'}
)
,(s:Specimen{id:'BR0000006990008'
,URL:'http://plants.jstor.org/specimen/br0000006990008'
,heldIn:'BR'}
)
, (n:Name{ipniid: '17044840-1',name:'Asplenium hemionitoides Roxb.'})
, (s)<-[:DerivedFrom]- (c)
, (s)<-[conspec:ConspecificWith
{AssertedBy:'Morton C.V. 1970/7/1'}]-(c2)
, (s) <-[:ConspecificWith
{AssertedBy: 'PH'}] -(c2)
, (s)-[type:TypeOf
{AssertedBy: 'Morton C.V. in http://www.biodiversitylibrary.org/page/409837#page/305'
, TypeOfType: "Lecto"}]->(n)
RETURN n,s, c, c2, conspec, type
----
//graph
//table
And to accommodate the annotations by Morton, again a new specimen has to be introduced, from the Geneva herbarium.
Query 8:
[source,cypher]
----
MATCH (c:CollectingEvent
{Collector: 'Roxburgh W.'
,CollNumber:'S.N.'}
)
CREATE (s:Specimen
{Collector: 'Christopher Smith'
,Locality: 'Amboina'
,HeldIn: 'G'}
)
,(s)<-[:DerivedFrom]-(c)
RETURN s,c
----
//graph
//table
Next stop is Sweden, where an interesting specimen from Taiwan is held, under the same name, but marked as type of another name:
Query 9:
[source,cypher]
----
CREATE (c:CollectingEvent
{Collector:'Faurie, U.J.'
,CollNumber:'168'
,Locality:'Formosa. Urai.'
,country:'Taiwan'
,EventDate:'1914/4'}
)
,(s:Specimen{id:'SP10962'
,URL:'http://plants.jstor.org/specimen/s-p-10962'
,heldIn:'SP'}
)
, (n:Name
{name:'Diplazium crenato-serratum (Blume) T.Moore var. hirta Rosenst.'}
)
, (s)<-[:DerivedFrom]-(c)
, (c)-[:TypeOf]->(n)
RETURN n, c, s
----
//graph
//table
To model the identification of this specimen, the specimen is linked to the type material of D. tomentosum
Query 10:
[source,cypher]
----
MATCH ({Collector:'Faurie, U.J.'
,CollNumber:'168'})-->(s)
MATCH ({name:"Diplazium tomentosum Blume"})<-[:TypeOf]-(c)
CREATE (s)<-[:ConspecificWith
{AsIdentifiedBy: 'S'}] -(c)
RETURN s.heldIn
----
//graph
//table
And finally a specimen from Sumatra, also in Sweden, where it is labeled as type of D. burchardii, but the only type specimen we know of for this species is in L, at least, according to Morton's annotations in Geneva, who has seen and photographed it, with the number "Rosenst. fil. sumatranae exs. 22".
But we know that Rosenstock frequently renumbered specimens in series he distributed, so we can express this an an assertion that the Swedish specimen indeed derives from the same collection as the Leiden one.
Query 11:
[source,cypher]
----
CREATE (s1:Specimen{id:'SP4702'
,URL:'http://plants.jstor.org/specimen/s-p-4702'
,heldIn:'SP'}
)
,(s2:Specimen{
heldIn:'L'
,CollNumber:'Rosenst. fil. sumatranae exs. 22'}
)
,(c:CollectingEvent{
collector:'Burchard, O.'
,CollNumber:'121'
,Locality:'Sumatera: Indragiri, inter Tjinaco et Pukan Herun.'
,EventDate:'1907'}
)
, (n:Name{
name:'Diplazium burchardii Rosenst.'
,ipniid:'17246030-1'}
)
, (s1)<-[:DerivedFrom
{AssertedBy: 'S'}]-(c)
, (s2)<-[:DerivedFrom
{AssertedBy: 'PH'}]-(c)
, (c)-[:TypeOf]->(n)
RETURN s1, s2, n, c
----
//graph
//table
Knowing this, we could ask someone in L to examine the specimen and compare it with
any of the other specimens that are in L and that we have already connected to D. tomentosum. A Conspecificity link with any of the specimens in the network would include the name D. burchardii in the list of available names.
Query 12:
[source,cypher]
----
MATCH (n1:Name{name:"Diplazium burchardii Rosenst."})<--()-->(s2{heldIn: "L"})
MATCH (n2:Name{name:"Diplazium tomentosum Blume"})<--()-->(s1{heldIn: "L"})
CREATE(s1)<-[r:ConspecificWith
{AssertedBy: "someone in L"}]-(s2)
RETURN s1, s2, r
----
//table
We may now list all the specimens that are connected by Conspecificity links to the original Blume type specimen.
Query 13:
[source,cypher]
----
MATCH (typeL:Specimen{id: "L0051073"})-[Conspec:ConspecificWith*1..10]-()-[:DerivedFrom*1..10]-(s:Specimen)
where s <> typeL
RETURN DISTINCT s, Conspec
----
//table
By applying more strict criteria to the paths traversed to arrive at these results, we may now be able to recover different taxon concepts and specify these as specimen lists with associated names.
[source,cypher]
----
MATCH (typeL:Specimen{id: "L0051073"})-[Conspec:ConspecificWith*1..10]-()-[:DerivedFrom*1..10]-(s:Specimen)
where all(c in Conspec where c.AssertedBy ='PH' OR c.AssertedBy='Morton C.V. 1970/7/1')
RETURN DISTINCT s, Conspec
----
//table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment