<?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/"
	>

<channel>
	<title>blog.humaneguitarist.org &#187; MODS</title>
	<atom:link href="http://blog.humaneguitarist.org/tag/mods/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.humaneguitarist.org</link>
	<description>discoveries in digital audio, music notation, and information encoding</description>
	<lastBuildDate>Tue, 07 Feb 2012 03:33:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>LS-598 #2: XQuery problems and solutions</title>
		<link>http://blog.humaneguitarist.org/2010/02/04/ls-598-2-xquery-problems-and-solutions/</link>
		<comments>http://blog.humaneguitarist.org/2010/02/04/ls-598-2-xquery-problems-and-solutions/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 13:29:47 +0000</pubDate>
		<dc:creator>nitin</dc:creator>
				<category><![CDATA[music notation]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[BaseX]]></category>
		<category><![CDATA[MODS]]></category>
		<category><![CDATA[MXMLiszt]]></category>
		<category><![CDATA[XQuery]]></category>
		<category><![CDATA[XQuery processor]]></category>

		<guid isPermaLink="false">http://blog.humaneguitarist.org/?p=777</guid>
		<description><![CDATA[Just a quick morning post today &#8230; The last 10 days or so I&#39;ve been struggling with some major problems that arose in trying to implement effective XQuer-ies on my web demo. Dublin Core doesn&#39;t allow me to differentiate creator &#34;types&#34;, so I was limited to searching across the DC:creator element for all creators, be [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick morning post today &#8230;</p>
<p>The last 10 days or so I&#39;ve been struggling with some major problems that arose in trying to implement effective XQuer-ies on my web demo.</p>
<ol>
<li>Dublin Core doesn&#39;t allow me to differentiate creator &quot;types&quot;, so I was limited to searching across the DC:creator element for all creators, be they Composer, Lyricist, or Arranger. MusicXML does differentiate these types, so essentially Dublin Core was making me &quot;dumb down&quot; some information. I want people to be able to search creator specifically by their role: Composer, Lyricist, or Arranger.</li>
<li>I needed a way to iterate an XQuery over all the MusicXML documents and I&nbsp;needed it to be relatively fast. A demo is a demo, but impatience is impatience and I just can&#39;t accept slow query processing.</li>
<li>The XQuery processor I&nbsp;was using didn&#39;t support some XQuery functions that would allow a searcher to type in &quot;Bach&quot; and retrieve documents for which the creator was &quot;J.S Bach&quot;, &quot;Johann Sebastian Bach&quot;, &quot;Bach, J.S&quot;, &quot;P.D.Q Bach&quot;, etc. This really was limiting the search/query coolness factor and I&nbsp;wasn&#39;t at all happy about it.</li>
</ol>
<p>Here are my solutions (details to follow in a few days or so):</p>
<ol>
<li>Ditch Dublin Core and switch to MODS, which does allow me to specify the role of a creator. Last week, I made a MusicXML to MODS XSL transformation for descriptive metadata and it&#39;s working well.</li>
<li>Steal an idea from <a href="http://ismir2008.ismir.net/papers/ISMIR2008_217.pdf">Using XQuery on MusicXML Databases for Musicological Analysis</a> so that rather than iterate one query (say for the number of notes in a piece) across multiple MusicXML&nbsp;docs, I just concatenated all the MusicXML&nbsp;documents. The original files are left alone, but a &quot;super&quot; MusicXML file gets created so that one can just query that one file, hence no need for lengthy iteration. I&#39;m not sure how those fellows did it, but I just automated it via PHP&nbsp;using the following format:</li>
</ol>
<p style="margin-left: 80px;"><code>&nbsp;&lt;hyperMXML&gt;</code></p>
<p style="margin-left: 120px;"><code>&lt;hypoMXML file=&quot;foo1.xml&quot;&gt;</code></p>
<p style="margin-left: 160px;"><code><span style="color: rgb(255, 0, 0);">1st MusicXML document</span></code></p>
<p style="margin-left: 120px;"><code>&lt;/hypoMXML&gt;</code></p>
<p style="margin-left: 120px;"><code>&lt;hypoMXML file=&quot;foo2.xml&quot;&gt;</code></p>
<p style="margin-left: 160px;"><code><span style="color: rgb(255, 0, 0);">2nd MusicXML document</span></code></p>
<p style="margin-left: 120px;"><code>&lt;/hypoMXML&gt;</code></p>
<p style="margin-left: 80px;"><code>&lt;/hyperMXML&gt;</code></p>
<ol start="3">
<li>Switch XQuery processors! I&#39;ll go into the ones that didn&#39;t support the function I&nbsp;needed another time, but I&nbsp;will say that <a href="http://www.inf.uni-konstanz.de/dbis/basex/index.php">BaseX</a> did the trick. Below is the query that searches for creators with &quot;Bach&quot; somewhere in MusicXML&#39;s &lt;creator&gt;&nbsp;element. For the deliverable demo, I won&#39;t be querying these big MusicXML documents for simple descriptive metadata like Creator, that&#39;s what the MODS is for. But this is just an example. The &quot;ftcontains&quot; syntax is what allows for retrieval of values where &quot;Bach&quot;&nbsp;is somewhere within the element, but isn&#39;t necessarily equivalent to the entire element value.</li>
</ol>
<p style="margin-left: 80px;"><code>for $i in doc(&quot;../temp/concat/concatMXML.xml&quot;)/hyperMXML/hypoMXML/score-partwise<br />
	where $i/identification/creator <span style="color: rgb(255, 0, 0);">ftcontains &quot;Bach&quot;</span><br />
	return ($i/work/work-title)</code></p>
<hr />
<p><span style="font-size: smaller;">This blog post is part of a semester-long investigation into digital encoding of symbolic music representation (SMR), its context in libraries, web-based delivery, preservation and metadata, and search and retrieval technologies.</span><span style="font-size: smaller;"><br />
	</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.humaneguitarist.org/2010/02/04/ls-598-2-xquery-problems-and-solutions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

