Modul:Citation: Unterschied zwischen den Versionen
+urn, +arxiv, +bibcode
Keine Bearbeitungszusammenfassung |
(+urn, +arxiv, +bibcode) |
||
| Zeile 201: | Zeile 201: | ||
args.ol = '' | args.ol = '' | ||
table.insert( wrong, 'ol' ) | table.insert( wrong, 'ol' ) | ||
end | |||
end | |||
if cu.isSet( args.urn ) then | |||
args.urn = args.urn:gsub( '^urn:', '' ) | |||
if not ( args.urn:match( '^nbn:de:.+$' ) or args.urn:match( '^nbn:ch:.+$' ) ) then | |||
args.urn = '' | |||
table.insert( wrong, 'urn' ) | |||
end | end | ||
end | end | ||
| Zeile 213: | Zeile 221: | ||
args.hdl = '' | args.hdl = '' | ||
table.insert( wrong, 'hdl' ) | table.insert( wrong, 'hdl' ) | ||
end | |||
-- See: https://arxiv.org/help/arxiv_identifier | |||
if cu.isSet( args.arxiv ) and not ( | |||
-- 1991-07 … 2007-03 | |||
args.arxiv:match( '^%a[%a%.%-]+/[90]%d[01]%d%d%d%d$' ) or args.arxiv:match( '^%a[%a%.%-]+/[90]%d[01]%d%d%d%d[vV]%d+$' ) or | |||
-- 2007-04 … 2014-12 | |||
args.arxiv:match( '^[01]%d[01]%d%.%d%d%d%d$' ) or args.arxiv:match( '^[01]%d[01]%d%.%d%d%d%d[vV]%d+$' ) or | |||
-- 2015-01 … | |||
args.arxiv:match( '^%d%d[01]%d%.%d%d%d%d%d$' ) or args.arxiv:match( '^%d%d[01]%d%.%d%d%d%d%d[vV]%d+$' ) ) then | |||
args.arxiv = '' | |||
table.insert( wrong, 'arXiv' ) | |||
end | |||
-- See: https://adsabs.harvard.edu/abs_doc/help_pages/data.html#bibcodes | |||
if cu.isSet( args.bibcode ) and not args.bibcode:match( '^[12]%d%d%d%a[%w&%.][%w&%.][%w&%.][%w.]+[%a%.]$' ) then | |||
args.bibcode = '' | |||
table.insert( wrong, 'bibcode' ) | |||
end | end | ||
| Zeile 352: | Zeile 378: | ||
elseif cu.isSet( args.dnb ) then | elseif cu.isSet( args.dnb ) then | ||
formatIdentifier( tab, 'dnb', args.dnb, args.dnb ) | formatIdentifier( tab, 'dnb', args.dnb, args.dnb ) | ||
elseif cu.isSet( args.urn ) then | |||
formatIdentifier( tab, 'urn', args.urn, args.urn ) | |||
elseif cu.isSet( args.oclc ) then | elseif cu.isSet( args.oclc ) then | ||
formatIdentifier( tab, 'oclc', args.oclc, args.oclc ) | formatIdentifier( tab, 'oclc', args.oclc, args.oclc ) | ||
| Zeile 384: | Zeile 412: | ||
table.insert( tab, args.extent ) | table.insert( tab, args.extent ) | ||
end | end | ||
for _, key in ipairs( { 'doi', 'hdl', 'jstor', 'arxiv', 'bibcode' } ) do | |||
if cu.isSet( args[ key ] ) then | |||
formatIdentifier( tab, key, args[ key ], args[ key ] ) | |||
break | |||
end | |||
end | end | ||
formatIdentifier( tab, 'pmid', args.pmid, args.pmid ) | formatIdentifier( tab, 'pmid', args.pmid, args.pmid ) | ||