<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>BioText UK</title>
	<atom:link href="http://biotext.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://biotext.wordpress.com</link>
	<description>Bioinformatics, computation, biology, medicine, language, science and culture</description>
	<lastBuildDate>Sat, 03 Jan 2009 18:00:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='biotext.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>BioText UK</title>
		<link>http://biotext.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://biotext.wordpress.com/osd.xml" title="BioText UK" />
	<atom:link rel='hub' href='http://biotext.wordpress.com/?pushpress=hub'/>
		<item>
		<title>biotext.org.uk launched&#8230;</title>
		<link>http://biotext.wordpress.com/2008/12/19/biotextorguk-launched/</link>
		<comments>http://biotext.wordpress.com/2008/12/19/biotextorguk-launched/#comments</comments>
		<pubDate>Fri, 19 Dec 2008 11:11:37 +0000</pubDate>
		<dc:creator>andrewclegg</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://biotext.wordpress.com/?p=22</guid>
		<description><![CDATA[I&#8217;ve launched this site&#8217;s successor, at biotext.org.uk. Please update your links &#8212; all new material will be posted there instead. Andrew.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biotext.wordpress.com&amp;blog=3515489&amp;post=22&amp;subd=biotext&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve launched this site&#8217;s successor, at <a title="biotext.org.uk" href="http://biotext.org.uk/">biotext.org.uk</a>.</p>
<p>Please update your links &#8212; all new material will be posted there instead.</p>
<p>Andrew.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biotext.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biotext.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biotext.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biotext.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/biotext.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/biotext.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/biotext.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/biotext.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biotext.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biotext.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biotext.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biotext.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biotext.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biotext.wordpress.com/22/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biotext.wordpress.com&amp;blog=3515489&amp;post=22&amp;subd=biotext&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://biotext.wordpress.com/2008/12/19/biotextorguk-launched/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">andrewclegg</media:title>
		</media:content>
	</item>
		<item>
		<title>Querying MeSH with XQuery and SQL</title>
		<link>http://biotext.wordpress.com/2008/05/06/querying-mesh-with-xquery-and-sql/</link>
		<comments>http://biotext.wordpress.com/2008/05/06/querying-mesh-with-xquery-and-sql/#comments</comments>
		<pubDate>Tue, 06 May 2008 15:11:40 +0000</pubDate>
		<dc:creator>andrewclegg</dc:creator>
				<category><![CDATA[Hints and tips]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[MeSH]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[XQuery]]></category>

		<guid isPermaLink="false">http://biotext.wordpress.com/?p=15</guid>
		<description><![CDATA[This is the third in a series of posts on MeSH headings and how they can be manipulated in XML form in XML databases like SQL Server. Before reading this, you&#8217;ll want to read the previous post on loading the data, which in turn refers to the original post where I described the schema. Most [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biotext.wordpress.com&amp;blog=3515489&amp;post=15&amp;subd=biotext&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is the third in a series of posts on <a href="http://www.nlm.nih.gov/mesh/">MeSH headings</a> and how they can be manipulated in XML form in XML databases like SQL Server. Before reading this, you&#8217;ll want to read the <a href="http://biotext.wordpress.com/2008/04/24/loading-mesh-into-sql-server-2005/">previous post</a> on loading the data, which in turn refers to the <a href="http://biotext.wordpress.com/2008/04/21/xsd-schema-for-mesh/">original post</a> where I described the schema.</p>
<p><span id="more-15"></span></p>
<p>Most of the queries shown below use a combination of <a href="http://en.wikipedia.org/wiki/XQuery">XQuery</a> and Transact-SQL (Microsoft&#8217;s dialect). Some of them might well be achievable in pure XQuery, but in practice I found that it was a lot easier to express my intention using hybrid queries.</p>
<p>A similar compromise exists in the storage format. I originally loaded the XML data into a one-column, one-row table — that is, the entire MeSH tree in a single cell. However, many queries turned out to be rather awkward like this, so I chopped up the tree into individual descriptor records, and held each such record in its own row in the table. I also &#8216;hoisted&#8217; the unique identifier for each descriptor out of the XML and into a separate char column, for ease of access. If I was working on a system that relied on repeated execution of similar queries I&#8217;d probably &#8216;hoist&#8217; more elements out of the XML and into their own columns (or even lookup tables), for performance and ease of access. This is a good compromise between a pure XML/XQuery solution, and converting your XML schema into an entirely relational model.</p>
<h3>The queries</h3>
<p>First up, a few checks to make sure everything looks happy:</p>
<p><pre class="brush: sql;">
--  Display the schema, reconstructed from SQL Server's internal representation

select xml_schema_namespace( 'MeSH', 'DescriptorSchema' );

-- Count number of descriptors to check we've loaded everything
-- correctly: should be 24767 (April 2008 MeSH)

select count( * ) from [MeSH].[Descriptor];

-- Select a single descriptor as an XML fragment

select top 1 * from [MeSH].[Descriptor];

select * from [MeSH].[Descriptor] where ui = 'D009125';
</pre></p>
<p>There&#8217;s essentially two ways to retrieve XML data, as XML fragments or cast into native SQL data types:</p>
<p><pre class="brush: sql;">
-- Get all tree numbers (as XML lists)

with xmlnamespaces( default 'uri:mesh' )
select ui, record.query( '
DescriptorRecord/TreeNumberList/TreeNumber
' ) as TreeNumber
from [MeSH].[Descriptor];


-- Get all tree numbers (flattened out)

with xmlnamespaces( default 'uri:mesh' )
select ui, c.value( '.', 'char( 7 )' ) as TreeNumber
from [MeSH].[Descriptor]
cross apply record.nodes( '
DescriptorRecord/TreeNumberList/TreeNumber
' ) as T( c );
</pre></p>
<p>The last two queries demonstrated pretty simple XQuery fragments embedded in SQL (the <code>DescriptorRecord/TreeNumberList/TreeNumber</code> bits which define the elements of interest). Of course, these can be as complex as you like. The next one shows how to look for all String elements that occur in the names of descriptors, concepts or terms — or more specifically, which <i>aren&#8217;t</i> in the context of qualifiers or related terms (which I&#8217;m not covering yet):</p>
<p><pre class="brush: sql;">
-- Get all descriptor/concept/term strings (distinct per descriptor)

with xmlnamespaces( default 'uri:mesh' )
select distinct ui, c.value( '.', 'varchar( 4000 )' ) as String
from [MeSH].[Descriptor]
cross apply record.nodes( '
DescriptorRecord//String
	[ local-name( .. ) != &quot;QualifierName&quot;
		and local-name( ../.. ) != &quot;DescriptorReferredTo&quot; ]
' ) as T( c );
</pre></p>
<p>One useful starting point for these queries is to find all descriptors who match a given substring (at the level of descriptor name, concept names or terms). However, somehow Microsoft managed to make the XQuery <code>contains</code> function case-sensitive, without implementing functions to force lower or upper case, so to do case-insensitive string comparisons you have to do them with <code>like</code>outside of the XQuery:</p>
<p><pre class="brush: sql;">
-- Get all descriptors matching a query string (at D, C or T level)

declare @query varchar( 50 );
set @query = '%muscle%';
with xmlnamespaces( default 'uri:mesh' ),
T1 as
(
	select ui, c.value( '.', 'varchar( 4000 )' ) as String
	from [MeSH].[Descriptor]
	cross apply record.nodes( '
	DescriptorRecord//String
		[ local-name( .. ) != &quot;QualifierName&quot;
			and local-name( ../.. ) != &quot;DescriptorReferredTo&quot; ]
	' ) as T( c )
)
select ui from T1
where String like @query;
</pre></p>
<p>So that&#8217;s one of the hierarchies within MeSH, the descriptor-concept-term hierarchy. Traversing the other hierarchy, the tree of TreeNumbers, is easy to achieve using substring comparisons, either in XQuery or SQL. Putting these together, you can extract data from all the descriptors, concepts and terms within a particular branch (or branches) of the tree:</p>
<p><pre class="brush: sql;">
-- Get all strings at or under a given tree number (remove % from
-- end of @query to restrict to exact node without descendents)

declare @query varchar( 50 );
set @query = 'A02.633%';
with xmlnamespaces( default 'uri:mesh' ),
T1 as
(
	select ui, c.value( '.', 'varchar( 50 )' ) as TreeNumber
	from [MeSH].[Descriptor]
	cross apply record.nodes( '
	DescriptorRecord/TreeNumberList/TreeNumber
	' ) as T( c )
),
T2 as
(
	select ui, c.value( '.', 'varchar( 4000 )' ) as String
	from [MeSH].[Descriptor]
	cross apply record.nodes( '
	DescriptorRecord//String
		[ local-name( .. ) != &quot;QualifierName&quot;
			and local-name( ../.. ) != &quot;DescriptorReferredTo&quot; ]
	' ) as T( c )
)
select T2.ui, T2.String
from T2 inner join T1 on T2.ui = T1.ui
where T1.TreeNumber like @query;
</pre></p>
<p>Finally, the query that I needed in the first place, which inspired all this hacking. Given an input string, I wanted to get all the strings in subtrees headed by descriptors matching the input string. This involves first identifying all the descriptors that match the input string, at any descriptor/concept/term level, retrieving all of their TreeNumbers, and then extracting the strings associated with these descriptors and any other descriptors that are descendents of these in the TreeNumber hierarchy.</p>
<p>This requires one expression (<code>T1</code>) that models the TreeNumber hierarchy, and another (<code>T2</code>) to model the hierarchy internal to each descriptor, just like the previous query. However, in this case we need two copies of each of these in the SQL join that brings it all together. This is because the query maps from input string -&gt; TreeNumbers -&gt; descendent TreeNumbers -&gt; output strings. So it&#8217;s a little more complicated than before:</p>
<p><pre class="brush: sql;">
-- Get all strings at or under tree nodes matching a given query string
-- (remove %s from @query to match exact string only, no substring matches)

declare @query varchar( 100 );
set @query = '%Muscle%';
with xmlnamespaces( default 'uri:mesh' ),
T1 as
(
	select ui, c.value( '.', 'varchar( 50 )' ) as TreeNumber
	from [MeSH].[Descriptor]
	cross apply record.nodes( '
	DescriptorRecord/TreeNumberList/TreeNumber
	' ) as T( c )
),
T2 as
(
	select ui, c.value( '.', 'varchar( 4000 )' ) as String
	from [MeSH].[Descriptor]
	cross apply record.nodes( '
	DescriptorRecord//String
		[ local-name( .. ) != &quot;QualifierName&quot;
			and local-name( ../.. ) != &quot;DescriptorReferredTo&quot; ]
	' ) as T( c )
)
select distinct T2_out.ui, T2_out.String
from T2 T2_out inner join T1 T1_out on T2_out.ui = T1_out.ui
	inner join T1 T1_in on T1_out.TreeNumber like T1_in.TreeNumber + '%'
	inner join T2 T2_in on T2_in.ui = T1_in.ui
where T2_in.String like @query
order by String asc;
</pre></p>
<p>I&#8217;m not going to give a line-by-line breakdown of how this works, but if you familiarize yourself with the <a href="http://msdn.microsoft.com/en-us/library/ms189075.aspx">SQL Server XQuery docs</a> it should become clear. Leave a comment if you get stuck though. Have fun!</p>
<p>Andrew.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/biotext.wordpress.com/15/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/biotext.wordpress.com/15/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biotext.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biotext.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biotext.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biotext.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/biotext.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/biotext.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/biotext.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/biotext.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biotext.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biotext.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biotext.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biotext.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biotext.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biotext.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biotext.wordpress.com&amp;blog=3515489&amp;post=15&amp;subd=biotext&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://biotext.wordpress.com/2008/05/06/querying-mesh-with-xquery-and-sql/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">andrewclegg</media:title>
		</media:content>
	</item>
		<item>
		<title>Loading MeSH into SQL Server 2005</title>
		<link>http://biotext.wordpress.com/2008/04/24/loading-mesh-into-sql-server-2005/</link>
		<comments>http://biotext.wordpress.com/2008/04/24/loading-mesh-into-sql-server-2005/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 16:47:48 +0000</pubDate>
		<dc:creator>andrewclegg</dc:creator>
				<category><![CDATA[Hints and tips]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[MeSH]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://biotext.wordpress.com/?p=14</guid>
		<description><![CDATA[One of the neat things you can do with many modern relational database servers is import and index hierarchically-structured XML data in a similar way as you would with tabular data — without &#8216;shredding&#8217; it into tables and rows. Of course, you can also do this with native XML databases or other query engines, but [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biotext.wordpress.com&amp;blog=3515489&amp;post=14&amp;subd=biotext&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One of the neat things you can do with many modern relational database servers is import and index hierarchically-structured XML data in a similar way as you would with tabular data — <em>without</em> &#8216;shredding&#8217; it into tables and rows.<br />
<span id="more-14"></span><br />
Of course, you can also do this with <a href="http://en.wikipedia.org/wiki/XML_database#Native_XML_databases">native XML databases</a> or other query engines, but the advantage of using an RDBMS is that you can integrate queries over XML documents with regular SQL queries.</p>
<p>I was writing some custom, task-specific Perl tools for querying the <a href="http://www.nlm.nih.gov/mesh/meshhome.html">MeSH</a> controlled vocabulary when it occurred to me that a more flexible, general-purpose solution might be possible by loading it all into <a href="http://www.microsoft.com/sql/editions/express/default.mspx">SQL Server</a> which we use for normal database purposes anyway (just the free version behind that link). It worked pretty well and I thought I&#8217;d share my methods in case anyone else would find it useful.</p>
<p>The first thing you need is the MeSH descriptors XML distribution, available <a href="http://www.nlm.nih.gov/mesh/filelist.html">here</a> (the link entitled &#8217;2008 MeSH in XML format&#8217;).</p>
<p>Then you import the <a href="http://biotext.wordpress.com/2008/04/21/xsd-schema-for-mesh/">XSD schema for MeSH</a> into SQL Server. Well, you don&#8217;t actually <em>need</em> to, but it will allow SQL Server to validate the XML as it loads (always a good thing) and is supposed to make things faster too. To do this, you need a little bit of T-SQL as follows:</p>
<p><pre class="brush: sql;">
create xml schema collection [MeSH].[DescriptorSchema] as
'
paste_the_XSD_schema_in_here
'
</pre></p>
<p>Remember those single-quotes!</p>
<p>Then you can create, load and index the table to hold the XML. It has two columns, one to hold the unique identifier of each descriptor record, and the other to hold the entire descriptor record in parsed XML format.</p>
<p>First, create the table.</p>
<p><pre class="brush: sql;">
create table [MeSH].[Descriptor]
(
   ui char( 7 ) PRIMARY KEY,
   record XML( content [MeSH].[DescriptorSchema] )
);
</pre></p>
<p>Then create a temporary table to load the entire MeSH file into, for shredding.</p>
<p><pre class="brush: sql;">
create table [MeSH].[DescriptorTemp]
(
	data xml( document [MeSH].[DescriptorSchema] )
);
</pre></p>
<p>Load the data into this table to start with. Obviously, replace m:\desc2008.xml with the location you saved the MeSH XML distribution to.</p>
<p><pre class="brush: sql;">
insert into [MeSH].[DescriptorTemp]
	select *
		from openrowset( bulk 'm:\desc2008.xml', single_blob ) as data;
</pre></p>
<p>This is where it starts to get complex. For each descriptor record, pull out the unique identifier, and store the record with the identifier in two columns of a new row in the main table. (<a href="http://technet.microsoft.com/en-us/library/ms175156.aspx">CROSS APPLY</a> is very handy for shredding XML.)</p>
<p><pre class="brush: sql;">
with xmlnamespaces( default 'uri:mesh' )
insert into [MeSH].[Descriptor] select
	T.c.value( './DescriptorUI', 'char( 7 )' ) as ui,
	T.c.query( '.' ) as record
from [MeSH].[DescriptorTemp]
cross apply data.nodes( '/DescriptorRecordSet/DescriptorRecord' ) as T( c );
</pre></p>
<p>Then we need to index the XML data column so it&#8217;s queriable.</p>
<p><pre class="brush: sql;">
create primary xml index DescriptorIdx on [MeSH].[Descriptor]( record );
</pre></p>
<p>Finally, clean up.</p>
<p><pre class="brush: sql;">
drop table [MeSH].[DescriptorTemp];
</pre></p>
<p>Now it&#8217;s ready to use, and I&#8217;ll give some handy example queries in the <a href="http://biotext.wordpress.com/2008/05/06/querying-mesh-with-xquery-and-sql/">next post</a>.</p>
<p><a href="http://technet.microsoft.com/en-us/library/ms345121.aspx">In theory</a>, adding additional indices to the XML column should improve performance, but I haven&#8217;t found a combination of indices yet that really makes my queries much faster. I suspect it depends very much on how your queries work, and in particular how much happens in the XML as opposed to relational parts of the query.</p>
<p>Andrew.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/biotext.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/biotext.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biotext.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biotext.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biotext.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biotext.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/biotext.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/biotext.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/biotext.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/biotext.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biotext.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biotext.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biotext.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biotext.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biotext.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biotext.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biotext.wordpress.com&amp;blog=3515489&amp;post=14&amp;subd=biotext&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://biotext.wordpress.com/2008/04/24/loading-mesh-into-sql-server-2005/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">andrewclegg</media:title>
		</media:content>
	</item>
		<item>
		<title>XSD schema for MeSH</title>
		<link>http://biotext.wordpress.com/2008/04/21/xsd-schema-for-mesh/</link>
		<comments>http://biotext.wordpress.com/2008/04/21/xsd-schema-for-mesh/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 16:39:45 +0000</pubDate>
		<dc:creator>andrewclegg</dc:creator>
				<category><![CDATA[Hints and tips]]></category>
		<category><![CDATA[MeSH]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xsd]]></category>

		<guid isPermaLink="false">http://biotext.wordpress.com/?p=13</guid>
		<description><![CDATA[The National Library of Medicine distributes the entire 25,000-node tree of MeSH descriptors (Medical Subject Headings) in XML form. Although they supply a DTD, many XML tools these days are designed to use XML schemas (aka XSDs) only. I&#8217;ve converted the MeSH DTD into an XSD, starting with an automatic conversion using the W3C&#8217;s dtd2xsd.pl [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biotext.wordpress.com&amp;blog=3515489&amp;post=13&amp;subd=biotext&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.nlm.nih.gov/nlmhome.html">National Library of Medicine</a> distributes the entire 25,000-node tree of <a href="http://www.nlm.nih.gov/mesh/meshhome.html">MeSH</a> descriptors (Medical Subject Headings) in XML form. Although they supply a DTD, many XML tools these days are designed to use XML schemas (aka XSDs) only.</p>
<p>I&#8217;ve converted the MeSH DTD into an XSD, starting with an automatic conversion using the W3C&#8217;s <a href="http://www.w3.org/2000/04/schema_hack/">dtd2xsd.pl</a> script, and then manually correcting the output. I haven&#8217;t done much XSD for a while so I&#8217;d be grateful for any feedback on it. I&#8217;ve included an explanation of the structure of MeSH because it has some subtleties that can make querying it rather confusing.<br />
<span id="more-13"></span></p>
<h3>A note on MeSH&#8217;s structure</h3>
<p>One thing I didn&#8217;t entirely realise about MeSH before I embarked on this project was that it&#8217;s actually hierarchical along two entirely orthogonal axes. Say what now? Put another way, there&#8217;s a hierarchical structure both <em>between</em> and <em>within</em> the descriptors.</p>
<p>Each descriptor (D) is composed of one or more related concepts (C), which can each in turn be referred to by one or more terms (T). For example, consider descriptor <a href="http://www.nlm.nih.gov/cgi/mesh/2008/MB_cgi?mode=&amp;index=859&amp;view=expanded">D27.505.954.122.085, Anti-Bacterial Agents</a>:</p>
<pre>D Anti-Bacterial Agents
  C Anti-Bacterial Agents
    T Anti-Bacterial Agents
    T Antibacterial Agents
  C Anti-Mycobacterial Agents
    T Anti-Mycobacterial Agents
    T Antimycobacterial Agents
  C Antibiotics
    T Antibiotics
  C Bacteriocidal Agents
    T Bacteriocidal Agents
    T Bacteriocides</pre>
<p>In general then, the concepts account for subtle differences in meaning that are too fine to use as the basis for a whole new descriptor, and the terms account for different ways of describing the same concept (e.g. spelling or phrasing variations). This hierarchy is represented <em>explicitly</em> within the XML schema.</p>
<p>However, the descriptors themselves are organized into a hierarchical structure of (apparently) unrestricted depth, and these relationships are only <em>implicitly</em> shown in the XML via the &#8216;tree numbers&#8217; of the descriptors themselves. For example, the parent of Anti-Bacterial Agents [D27.505.954.122.085] is Anti-Infective Agents [D27.505.954.122], and its children include Antitubercular Agents [D27.505.954.122.085.255] and Leprostatic Agents [D27.505.954.122.085.777]. All of these ultimately descend from Chemical Actions and Uses [D27]. It&#8217;s all in the numbers, see — a bit like <a href="http://cathdb.info/">CATH codes</a> and <a href="http://en.wikipedia.org/wiki/EC_number">EC numbers</a>.</p>
<p>But wait, there&#8217;s one more level of complexity. Viewed from the point of view of the tree numbers, MeSH is a forest of proper trees, but each descriptor can have more than one tree number. This means that from the perspective of the descriptors themselves, MeSH isn&#8217;t a tree but a directed graph of parent-child relations. It&#8217;s not a tree because a descriptor with multiple tree numbers has multiple parents. And it&#8217;s cyclic, because you can follow parent-to-child paths and end up back at the descriptor you started at. This results in some surprising circuits. For example, Morals [F01.829.500] is the parent of Ethics [F01.829.500.519] on the Behavior and Behavior Mechanisms [F01] tree, but Morals [K01.316.630] is a child of Ethics [K01.316] on the Humanities [K01] tree. Watch out for infinite loops if you write any code to traverse MeSH by descriptor.</p>
<p>Note that while the descriptor-concept-term hierarchy is enforced by the schema, the tree number hierarchy can&#8217;t be, although it is pretty easy to check using substring matching. Note also that there are other elements in MeSH that don&#8217;t fit into this structure, such as pharmacological actions, related terms and subheadings, but let&#8217;s save at least some material for a later post.</p>
<p>Andrew.</p>
<h3>The Schema</h3>
<p><pre class="brush: xml;">
&lt;xs:schema
  xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;
  xmlns=&quot;uri:mesh&quot;
  targetNamespace=&quot;uri:mesh&quot;
  elementFormDefault=&quot;qualified&quot;&gt;

  &lt;xs:element name=&quot;DescriptorRecordSet&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;DescriptorRecord&quot; minOccurs=&quot;0&quot;
maxOccurs=&quot;unbounded&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;DescriptorRecord&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element ref=&quot;DescriptorUI&quot;/&gt;
          &lt;xs:element ref=&quot;DescriptorName&quot;/&gt;
        &lt;/xs:sequence&gt;
        &lt;xs:element ref=&quot;DateCreated&quot;/&gt;
        &lt;xs:element ref=&quot;DateRevised&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;xs:element ref=&quot;DateEstablished&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;xs:element ref=&quot;ActiveMeSHYearList&quot;/&gt;
        &lt;xs:element ref=&quot;AllowableQualifiersList&quot; minOccurs=&quot;0&quot;
maxOccurs=&quot;1&quot;/&gt;
        &lt;xs:element ref=&quot;Annotation&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;xs:element ref=&quot;HistoryNote&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;xs:element ref=&quot;OnlineNote&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;xs:element ref=&quot;PublicMeSHNote&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;xs:element ref=&quot;PreviousIndexingList&quot; minOccurs=&quot;0&quot;
maxOccurs=&quot;1&quot;/&gt;
        &lt;xs:element ref=&quot;EntryCombinationList&quot; minOccurs=&quot;0&quot;
maxOccurs=&quot;1&quot;/&gt;
        &lt;xs:element ref=&quot;SeeRelatedList&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;xs:element ref=&quot;ConsiderAlso&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;xs:element ref=&quot;PharmacologicalActionList&quot; minOccurs=&quot;0&quot;
maxOccurs=&quot;1&quot;/&gt;
        &lt;xs:element ref=&quot;RunningHead&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;xs:element ref=&quot;TreeNumberList&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;xs:element ref=&quot;RecordOriginatorsList&quot;/&gt;
        &lt;xs:element ref=&quot;ConceptList&quot;/&gt;
      &lt;/xs:sequence&gt;
      &lt;xs:attribute name=&quot;DescriptorClass&quot; use=&quot;optional&quot;&gt;
        &lt;xs:simpleType&gt;
          &lt;xs:restriction base=&quot;xs:string&quot;&gt;
            &lt;xs:enumeration value=&quot;1&quot;/&gt;
            &lt;xs:enumeration value=&quot;2&quot;/&gt;
            &lt;xs:enumeration value=&quot;3&quot;/&gt;
            &lt;xs:enumeration value=&quot;4&quot;/&gt;
          &lt;/xs:restriction&gt;
        &lt;/xs:simpleType&gt;
      &lt;/xs:attribute&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;ActiveMeSHYearList&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;Year&quot; maxOccurs=&quot;unbounded&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;AllowableQualifiersList&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;AllowableQualifier&quot; maxOccurs=&quot;unbounded&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;AllowableQualifier&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;QualifierReferredTo&quot;/&gt;
        &lt;xs:element ref=&quot;Abbreviation&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;Annotation&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;ConsiderAlso&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;Day&quot; type=&quot;xs:integer&quot;/&gt;

  &lt;xs:element name=&quot;DescriptorUI&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;DescriptorName&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;String&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;DateCreated&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;Year&quot;/&gt;
        &lt;xs:element ref=&quot;Month&quot;/&gt;
        &lt;xs:element ref=&quot;Day&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;DateRevised&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;Year&quot;/&gt;
        &lt;xs:element ref=&quot;Month&quot;/&gt;
        &lt;xs:element ref=&quot;Day&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;DateEstablished&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;Year&quot;/&gt;
        &lt;xs:element ref=&quot;Month&quot;/&gt;
        &lt;xs:element ref=&quot;Day&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;DescriptorReferredTo&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;DescriptorUI&quot;/&gt;
        &lt;xs:element ref=&quot;DescriptorName&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;EntryCombinationList&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;EntryCombination&quot; maxOccurs=&quot;unbounded&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;EntryCombination&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;ECIN&quot;/&gt;
        &lt;xs:element ref=&quot;ECOUT&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;ECIN&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;DescriptorReferredTo&quot;/&gt;
        &lt;xs:element ref=&quot;QualifierReferredTo&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;ECOUT&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;DescriptorReferredTo&quot;/&gt;
        &lt;xs:element ref=&quot;QualifierReferredTo&quot; minOccurs=&quot;0&quot;
maxOccurs=&quot;1&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;HistoryNote&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;Month&quot; type=&quot;xs:integer&quot;/&gt;

  &lt;xs:element name=&quot;OnlineNote&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;PublicMeSHNote&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;PreviousIndexingList&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence maxOccurs=&quot;unbounded&quot;&gt;
        &lt;xs:element ref=&quot;PreviousIndexing&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;PreviousIndexing&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;RecordOriginatorsList&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;RecordOriginator&quot;/&gt;
        &lt;xs:element ref=&quot;RecordMaintainer&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;xs:element ref=&quot;RecordAuthorizer&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;RecordOriginator&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;RecordMaintainer&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;RecordAuthorizer&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;RunningHead&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;QualifierReferredTo&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;QualifierUI&quot;/&gt;
        &lt;xs:element ref=&quot;QualifierName&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;QualifierUI&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;QualifierName&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;String&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;Year&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;SeeRelatedList&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;SeeRelatedDescriptor&quot; maxOccurs=&quot;unbounded&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;SeeRelatedDescriptor&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;DescriptorReferredTo&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;TreeNumberList&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence maxOccurs=&quot;unbounded&quot;&gt;
        &lt;xs:element ref=&quot;TreeNumber&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;TreeNumber&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;ConceptList&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;Concept&quot; maxOccurs=&quot;unbounded&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;Concept&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element ref=&quot;ConceptUI&quot;/&gt;
          &lt;xs:element ref=&quot;ConceptName&quot;/&gt;
          &lt;xs:element ref=&quot;ConceptUMLSUI&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;/xs:sequence&gt;
        &lt;xs:element ref=&quot;CASN1Name&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;xs:element ref=&quot;RegistryNumber&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;xs:element ref=&quot;ScopeNote&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;xs:element ref=&quot;SemanticTypeList&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;xs:element ref=&quot;RelatedRegistryNumberList&quot; minOccurs=&quot;0&quot;
maxOccurs=&quot;1&quot;/&gt;
        &lt;xs:element ref=&quot;ConceptRelationList&quot; minOccurs=&quot;0&quot;
maxOccurs=&quot;1&quot;/&gt;
        &lt;xs:element ref=&quot;TermList&quot;/&gt;
      &lt;/xs:sequence&gt;
      &lt;xs:attribute name=&quot;PreferredConceptYN&quot; use=&quot;required&quot;&gt;
        &lt;xs:simpleType&gt;
          &lt;xs:restriction base=&quot;xs:string&quot;&gt;
            &lt;xs:enumeration value=&quot;Y&quot;/&gt;
            &lt;xs:enumeration value=&quot;N&quot;/&gt;
          &lt;/xs:restriction&gt;
        &lt;/xs:simpleType&gt;
      &lt;/xs:attribute&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;ConceptUI&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;ConceptName&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;String&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;ConceptRelationList&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;ConceptRelation&quot; maxOccurs=&quot;unbounded&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;ConceptRelation&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;Concept1UI&quot;/&gt;
        &lt;xs:element ref=&quot;Concept2UI&quot;/&gt;
        &lt;xs:element ref=&quot;RelationAttribute&quot; minOccurs=&quot;0&quot;
maxOccurs=&quot;1&quot;/&gt;
      &lt;/xs:sequence&gt;
      &lt;xs:attribute name=&quot;RelationName&quot; use=&quot;optional&quot;&gt;
        &lt;xs:simpleType&gt;
          &lt;xs:restriction base=&quot;xs:string&quot;&gt;
            &lt;xs:enumeration value=&quot;NRW&quot;/&gt;
            &lt;xs:enumeration value=&quot;BRD&quot;/&gt;
            &lt;xs:enumeration value=&quot;REL&quot;/&gt;
          &lt;/xs:restriction&gt;
        &lt;/xs:simpleType&gt;
      &lt;/xs:attribute&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;Concept1UI&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;Concept2UI&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;ConceptUMLSUI&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;CASN1Name&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;PharmacologicalActionList&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;PharmacologicalAction&quot; maxOccurs=&quot;unbounded&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;PharmacologicalAction&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;DescriptorReferredTo&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;RegistryNumber&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;RelatedRegistryNumberList&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;RelatedRegistryNumber&quot; maxOccurs=&quot;unbounded&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;RelatedRegistryNumber&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;RelationAttribute&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;ScopeNote&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;SemanticTypeList&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;SemanticType&quot; maxOccurs=&quot;unbounded&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;SemanticType&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;SemanticTypeUI&quot;/&gt;
        &lt;xs:element ref=&quot;SemanticTypeName&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;SemanticTypeUI&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;SemanticTypeName&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;TermList&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;Term&quot; maxOccurs=&quot;unbounded&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;Term&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element ref=&quot;TermUI&quot;/&gt;
          &lt;xs:element ref=&quot;String&quot;/&gt;
        &lt;/xs:sequence&gt;
        &lt;xs:element ref=&quot;DateCreated&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;xs:element ref=&quot;Abbreviation&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;xs:element ref=&quot;SortVersion&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;xs:element ref=&quot;EntryVersion&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;xs:element ref=&quot;ThesaurusIDlist&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot;/&gt;
      &lt;/xs:sequence&gt;
      &lt;xs:attribute name=&quot;ConceptPreferredTermYN&quot; use=&quot;required&quot;&gt;
        &lt;xs:simpleType&gt;
          &lt;xs:restriction base=&quot;xs:string&quot;&gt;
            &lt;xs:enumeration value=&quot;Y&quot;/&gt;
            &lt;xs:enumeration value=&quot;N&quot;/&gt;
          &lt;/xs:restriction&gt;
        &lt;/xs:simpleType&gt;
      &lt;/xs:attribute&gt;
      &lt;xs:attribute name=&quot;IsPermutedTermYN&quot; use=&quot;required&quot;&gt;
        &lt;xs:simpleType&gt;
          &lt;xs:restriction base=&quot;xs:string&quot;&gt;
            &lt;xs:enumeration value=&quot;Y&quot;/&gt;
            &lt;xs:enumeration value=&quot;N&quot;/&gt;
          &lt;/xs:restriction&gt;
        &lt;/xs:simpleType&gt;
      &lt;/xs:attribute&gt;
      &lt;xs:attribute name=&quot;LexicalTag&quot; use=&quot;required&quot;&gt;
        &lt;xs:simpleType&gt;
          &lt;xs:restriction base=&quot;xs:string&quot;&gt;
            &lt;xs:enumeration value=&quot;ABB&quot;/&gt;
            &lt;xs:enumeration value=&quot;ABX&quot;/&gt;
            &lt;xs:enumeration value=&quot;ACR&quot;/&gt;
            &lt;xs:enumeration value=&quot;ACX&quot;/&gt;
            &lt;xs:enumeration value=&quot;EPO&quot;/&gt;
            &lt;xs:enumeration value=&quot;LAB&quot;/&gt;
            &lt;xs:enumeration value=&quot;NAM&quot;/&gt;
            &lt;xs:enumeration value=&quot;NON&quot;/&gt;
            &lt;xs:enumeration value=&quot;TRD&quot;/&gt;
          &lt;/xs:restriction&gt;
        &lt;/xs:simpleType&gt;
      &lt;/xs:attribute&gt;
      &lt;xs:attribute name=&quot;PrintFlagYN&quot; use=&quot;required&quot;&gt;
        &lt;xs:simpleType&gt;
          &lt;xs:restriction base=&quot;xs:string&quot;&gt;
            &lt;xs:enumeration value=&quot;Y&quot;/&gt;
            &lt;xs:enumeration value=&quot;N&quot;/&gt;
          &lt;/xs:restriction&gt;
        &lt;/xs:simpleType&gt;
      &lt;/xs:attribute&gt;
      &lt;xs:attribute name=&quot;RecordPreferredTermYN&quot; use=&quot;required&quot;&gt;
        &lt;xs:simpleType&gt;
          &lt;xs:restriction base=&quot;xs:string&quot;&gt;
            &lt;xs:enumeration value=&quot;Y&quot;/&gt;
            &lt;xs:enumeration value=&quot;N&quot;/&gt;
          &lt;/xs:restriction&gt;
        &lt;/xs:simpleType&gt;
      &lt;/xs:attribute&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;TermUI&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;String&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;Abbreviation&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;SortVersion&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;EntryVersion&quot; type=&quot;xs:string&quot;/&gt;

  &lt;xs:element name=&quot;ThesaurusIDlist&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element ref=&quot;ThesaurusID&quot; maxOccurs=&quot;unbounded&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;

  &lt;xs:element name=&quot;ThesaurusID&quot; type=&quot;xs:string&quot;/&gt;

&lt;/xs:schema&gt;
</pre></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/biotext.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/biotext.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biotext.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biotext.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biotext.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biotext.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/biotext.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/biotext.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/biotext.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/biotext.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biotext.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biotext.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biotext.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biotext.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biotext.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biotext.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biotext.wordpress.com&amp;blog=3515489&amp;post=13&amp;subd=biotext&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://biotext.wordpress.com/2008/04/21/xsd-schema-for-mesh/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">andrewclegg</media:title>
		</media:content>
	</item>
		<item>
		<title>Hello world</title>
		<link>http://biotext.wordpress.com/2008/04/18/hello-world/</link>
		<comments>http://biotext.wordpress.com/2008/04/18/hello-world/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 10:22:25 +0000</pubDate>
		<dc:creator>andrewclegg</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Welcome to BioText UK.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biotext.wordpress.com&amp;blog=3515489&amp;post=1&amp;subd=biotext&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Welcome to BioText UK.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/biotext.wordpress.com/1/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/biotext.wordpress.com/1/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biotext.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biotext.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biotext.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biotext.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/biotext.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/biotext.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/biotext.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/biotext.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biotext.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biotext.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biotext.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biotext.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biotext.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biotext.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biotext.wordpress.com&amp;blog=3515489&amp;post=1&amp;subd=biotext&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://biotext.wordpress.com/2008/04/18/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">andrewclegg</media:title>
		</media:content>
	</item>
	</channel>
</rss>
