<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<disco format="disco.linkout.sql" format-version="1.0">
<site-info site-name="Cellosaurus; owner has own linkout"/>
 <technical-contact email="ab@sib.swiss" name="Amos Bairoch"/>
 <linkout-sql>
 <![CDATA[

SELECT 'PubMed' AS db,
	reference AS oid,
	'Reagent: Cell Line' AS linkcategory,
	'Information about the ' || trim(both ' ' FROM split_part(identifier, '

', 1)) || ' cell line (' || trim(both ' ' FROM split_part(a.accession, '
', 1)) || ') is available at Cellosaurus.' AS linkname,
	'http://web.expasy.org/cellosaurus/' || trim(both ' ' FROM split_part(a.accession, '
', 1)) AS linkurl
FROM (
	SELECT accession,
		replace(reference, 'PubMed=', '') AS reference
	FROM (
		SELECT accession,
			trim(both ' ;' FROM regexp_split_to_table(references_identifiers, '
')) AS reference
		FROM l2_scr_013869_cellosaurus_cellosaurus
		ORDER BY reference ASC
		) ref1
	WHERE reference ilike 'pubmed%'
	) ref2
LEFT JOIN l2_scr_013869_cellosaurus_cellosaurus a ON a.accession = ref2.accession

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