Merge branch 'dwc_cleanup' into website_design

This commit is contained in:
Peter Desmet 2015-01-13 00:56:26 +01:00
commit b5cfc6c302
10 changed files with 402 additions and 8102 deletions

2
build/README.md Normal file
View File

@ -0,0 +1,2 @@
add DOI explanations

39
build/dc.yaml Normal file
View File

@ -0,0 +1,39 @@
type:
definition: 'The nature or genre of the resource. For Darwin Core, recommended best practice is to use the name of the class that defines the root of the record.'
comment: 'Examples: "StillImage", "MovingImage", "Sound", "PhysicalObject", "Event", "Text". For discussion see http://terms.tdwg.org/wiki/dwc:type'
details: http://dublincore.org/usage/terms/history/#typeT-001
modified:
definition: 'The most recent date-time on which the resource was changed. For Darwin Core, recommended best practice is to use an encoding scheme, such as ISO 8601:2004(E).'
comment: 'Examples: "1963-03-08T14:07-0600" is 8 Mar 1963 2:07pm in the time zone six hours earlier than UTC, "2009-02-20T08:40Z" is 20 Feb 2009 8:40am UTC, "1809-02-12" is 12 Feb 1809, "1906-06" is Jun 1906, "1971" is just that year, "2007-03-01T13:00:00Z/2008-05-11T15:30:00Z" is the interval between 1 Mar 2007 1pm UTC and 11 May 2008 3:30pm UTC, "2007-11-13/15" is the interval between 13 Nov 2007 and 15 Nov 2007. For discussion see http://terms.tdwg.org/wiki/dwc:modified'
details: http://dublincore.org/usage/terms/history/#modified-003
language:
definition: 'A language of the resource. Recommended best practice is to use a controlled vocabulary such as RFC 4646 [RFC4646].'
comment: 'Examples: "en" for English, "es" for Spanish. For discussion see http://terms.tdwg.org/wiki/dwc:language'
details: http://dublincore.org/usage/terms/history/#languageT-001
license:
definition: 'A legal document giving official permission to do something with the resource.'
comment: 'Examples: "http://creativecommons.org/publicdomain/zero/1.0/legalcode", "http://creativecommons.org/licenses/by/4.0/legalcode". For discussion see http://terms.tdwg.org/wiki/dwc:license'
details: http://dublincore.org/usage/terms/history/#license-002
rightsHolder:
definition: 'A person or organization owning or managing rights over the resource.'
comment: 'Example: "The Regents of the University of California.". For discussion see http://terms.tdwg.org/wiki/dwc:rightsHolder'
details: http://dublincore.org/usage/terms/history/#rightsHolder-002
accessRights:
definition: 'Information about who can access the resource or an indication of its security status. Access Rights may include information regarding access or restrictions based on privacy, security, or other policies.'
comment: 'Example: "not-for-profit use only". For discussion see http://terms.tdwg.org/wiki/dwc:accessRights'
details: http://dublincore.org/usage/terms/history/#accessRights-002
bibliographicCitation:
definition: 'A bibliographic reference for the resource as a statement indicating how this record should be cited (attributed) when used. Recommended practice is to include sufficient bibliographic detail to identify the resource as unambiguously as possible.'
comment: 'Examples: "Ctenomys sociabilis (MVZ 165861)" for a specimen, "Oliver P. Pearson. 1985. Los tuco-tucos (genera Ctenomys) de los Parques Nacionales Lanin y Nahuel Huapi, Argentina Historia Natural, 5(37):337-343." for a Taxon. For discussion see http://terms.tdwg.org/wiki/dwc:bibliographicCitation'
details: http://dublincore.org/usage/terms/history/#bibliographicCitation-002
references:
definition: 'A related resource that is referenced, cited, or otherwise pointed to by the described resource.'
comment: 'Examples: "http://mvzarctos.berkeley.edu/guid/MVZ:Mamm:165861"; "http://www.catalogueoflife.org/annual-checklist/show_species_details.php?record_id=6197868". For discussion see http://terms.tdwg.org/wiki/dwc:references'
details: http://dublincore.org/usage/terms/history/#references-003

76
build/recommended.tmpl Normal file
View File

@ -0,0 +1,76 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Darwin Core Terms: A quick reference guide</title>
<link rel="stylesheet" href="bootstrap.min.css">
</head>
#def showTerm($t)
#if $t.uri is not None
<a name="$t.name"></a>
<dl class="dl-horizontal">
<dt>Name</dt>
<dd><strong>$t.name</strong></dd>
<dt>Identifier</dt>
<dd>$t.uri</dd>
#if $t.class is not None
<dt>Class</dt>
<dd>$t.class</dd>
#end if
<dt>Definition</dt>
<dd>$t.definition</dd>
<dt>Comment</dt>
<dd>$t.comment</dd>
<dt>Details</dt>
<dd><a href="$t.version">$t.version</a></dd>
</dl>
<hr/>
#end if
#end def
<body>
<div class="container">
<div class="jumbotron">
<h1>Darwin Core Term Reference</h1>
</div>
#for $group in $groups
#if $group.uri is not None
<h4><a href="#$group.name">$group.name</a></h4>
#else
<h4>$group.name</h4>
#end if
<p>
#set $sep = ''
#for $term in $group.terms
$sep <a href="#$term.name">$term.name</a>
#set $sep = '|'
#end for
</p>
#end for
<hr/>
#for $t in $groups
$showTerm(t)
#end for
#for $group in $groups
#for $t in $group.terms
$showTerm(t)
#end for
#end for
</div> <!-- /container -->
</body>
</html>

3
build/requirements.txt Normal file
View File

@ -0,0 +1,3 @@
Cheetah==2.4.4
rdflib==4.1.2
PyYAML==3.11

1
build/term_order.yaml Normal file
View File

@ -0,0 +1 @@
- Record-level Terms: - DC_type - DC_modified - DC_language - DC_license - DC_rightsHolder - DC_accessRights - DC_bibliographicCitation - DC_references - institutionID - collectionID - datasetID - institutionCode - collectionCode - datasetName - ownerInstitutionCode - basisOfRecord - informationWithheld - dataGeneralizations - dynamicProperties - Occurrence: - occurrenceID - catalogNumber - recordNumber - recordedBy - individualCount - sex - lifeStage - reproductiveCondition - behavior - establishmentMeans - occurrenceStatus - preparations - disposition - associatedMedia - associatedReferences - associatedSequences - associatedTaxa - otherCatalogNumbers - occurrenceRemarks - Organism: - organismID - organismName - organismScope - associatedOccurrences - associatedOrganisms - previousIdentifications - organismRemarks - MaterialSample: - materialSampleID - Event: - eventID - fieldNumber - eventDate - eventTime - startDayOfYear - endDayOfYear - year - month - day - verbatimEventDate - habitat - samplingProtocol - samplingEffort - fieldNotes - eventRemarks - DC_Location: - locationID - higherGeographyID - higherGeography - continent - waterBody - islandGroup - island - country - countryCode - stateProvince - county - municipality - locality - verbatimLocality - minimumElevationInMeters - maximumElevationInMeters - verbatimElevation - minimumDepthInMeters - maximumDepthInMeters - verbatimDepth - minimumDistanceAboveSurfaceInMeters - maximumDistanceAboveSurfaceInMeters - locationAccordingTo - locationRemarks - decimalLatitude - decimalLongitude - geodeticDatum - coordinateUncertaintyInMeters - coordinatePrecision - pointRadiusSpatialFit - verbatimCoordinates - verbatimLatitude - verbatimLongitude - verbatimCoordinateSystem - verbatimSRS - footprintWKT - footprintSRS - footprintSpatialFit - georeferencedBy - georeferencedDate - georeferenceProtocol - georeferenceSources - georeferenceVerificationStatus - georeferenceRemarks - GeologicalContext: - geologicalContextID - earliestEonOrLowestEonothem - latestEonOrHighestEonothem - earliestEraOrLowestErathem - latestEraOrHighestErathem - earliestPeriodOrLowestSystem - latestPeriodOrHighestSystem - earliestEpochOrLowestSeries - latestEpochOrHighestSeries - earliestAgeOrLowestStage - latestAgeOrHighestStage - lowestBiostratigraphicZone - highestBiostratigraphicZone - lithostratigraphicTerms - group - formation - member - bed - Identification: - identificationID - identificationQualifier - typeStatus - identifiedBy - dateIdentified - identificationReferences - identificationVerificationStatus - identificationRemarks - Taxon: - taxonID - scientificNameID - acceptedNameUsageID - parentNameUsageID - originalNameUsageID - nameAccordingToID - namePublishedInID - taxonConceptID - scientificName - acceptedNameUsage - parentNameUsage - originalNameUsage - nameAccordingTo - namePublishedIn - namePublishedInYear - higherClassification - kingdom - phylum - class - order - family - genus - subgenus - specificEpithet - infraspecificEpithet - taxonRank - verbatimTaxonRank - scientificNameAuthorship - vernacularName - nomenclaturalCode - taxonomicStatus - nomenclaturalStatus - taxonRemarks - ResourceRelationship: - resourceRelationshipID - resourceID - relatedResourceID - relationshipOfResource - relationshipAccordingTo - relationshipEstablishedDate - relationshipRemarks - MeasurementOrFact: - measurementID - measurementType - measurementValue - measurementAccuracy - measurementUnit - measurementDeterminedBy - measurementDeterminedDate - measurementMethod - measurementRemarks

76
build/update_terms.py Executable file
View File

@ -0,0 +1,76 @@
#!/usr/bin/env python
'''
easy_install pip
pip install -r requirements.txt
'''
import yaml
from Cheetah.Template import Template
from rdflib import Graph, URIRef, Namespace, Literal
from rdflib.namespace import RDFS
DWC=Namespace("http://rs.tdwg.org/dwc/terms/")
DC=Namespace("http://purl.org/dc/terms/")
DWCA=Namespace("http://rs.tdwg.org/dwc/terms/attributes/")
def buildHtml():
print """building html files"""
html = Template(file="recommended.tmpl", searchList=[parseTerms()])
recommended = open("recommended.html", "w")
recommended.write(str(html))
recommended.close()
def buildDownloads():
print """building downloads"""
print """TBD"""
def getTerm(name, g):
t={}
if name.startswith("DC_"):
name=name[3:]
uri=DC[name]
t["name"]="dcterms:"+name
elif name.find(" ") > 0:
uri=None
t["name"]=name
else:
uri=DWC[name]
t["name"]=name
t["uri"]=uri
t["class"]=g.value(subject=uri, predicate=DWCA.organizedInClass)
t["definition"]=g.value(subject=uri, predicate=RDFS.comment)
t["comment"]=g.value(subject=uri, predicate=DC.description)
t["version"]=g.value(subject=uri, predicate=DC.hasVersion)
return t
def parseTerms():
with open('term_order.yaml', 'r') as f:
order = yaml.load(f)
with open('dc.yaml', 'r') as dcf:
dc = yaml.load(dcf)
g = Graph()
g.parse("../terms/dwc_normative.rdf")
for t in dc:
uri=DC[t]
g.add( (uri, RDFS.comment, Literal(dc[t]["definition"])) )
g.add( (uri, DC.description, Literal(dc[t]["comment"])) )
g.add( (uri, DC.hasVersion, URIRef(dc[t]["details"])) )
data={}
groups=[]
for groupData in order:
group=getTerm(sorted(groupData.keys())[0], g)
groups.append(group)
group["terms"]=[]
for t in sorted(groupData.values())[0]:
group["terms"].append(getTerm(t, g))
data["groups"]=groups
# print data
return data
if __name__ == "__main__":
buildHtml()
buildDownloads()

View File

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File