<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<disco format="disco.linkout.sql" format-version="1.0">
<site-info site-name="NIFRegistry"/>
 <technical-contact email="" name=""/>
 <linkout-sql>
 <![CDATA[

SELECT a.db,
	a.oid,
	a.linkcategory,
	a.linkname,
	a.linkurl
FROM (
	SELECT 'PubMed' AS db,
		trim(both ' ' from regexp_split_to_table(replace(defining_citation, 'PMID:', ''), ',')) AS oid,
		'Resource: Registry' AS linkcategory,
		resource_name || ' (RRID:' || canonical_id||') is a ' || lower(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(trim(trailing ',' FROM additional_resource_types), ')', ''), '0', ''), '9', ''), '8', ''), '7', ''), '6', ''), '5', ''), '4', ''), '3', ''), '2', ''), '1', ''), ' (birnlex_', ''), ' (nlx_res_', ''), 'nlx_inv_', ''), '_', ''), '(', '')) || ' registered with the SciCrunch Registry.' AS linkname,
		resource_url AS linkurl
	FROM l2_nlx_144509_resource_scicruch_registry
	WHERE defining_citation NOT LIKE ''
		AND resource_url NOT LIKE ''
	) a
WHERE oid NOT LIKE ''
	AND oid NOT LIKE 'DOI:%'

 ]]>
</linkout-sql>
</disco>
