--- nsdl/prototypes/metadata_convert.pl 2002/05/09 07:45:55 1.1 +++ nsdl/prototypes/metadata_convert.pl 2002/05/11 20:20:32 1.2 @@ -13,19 +13,43 @@ my $LONCAPA_metadata=(<1011110523 html -bio@msu, bio@msu (Michigan State University), bio@msu (Michigan State University), bio@msu (Michigan State University) +bio\@msu, bio\@msu (Michigan State University), bio\@msu (Michigan State University), bio\@msu (Michigan State University) Bio Information, Large Biomolecules - Intro, Large Biomolecules - Review - +Test title END +# ---------------------------------------------------- The 16 major nsdl fields +# Audience +# Publisher +# Contributor +# Relation +# Coverage +# Resource Identifier +# Creator +# Resource Type +# Date +# Rights +# Description +# Source +# Format +# Subject & Keywords +# Language +# Title +# --------------- also need educational recommended fields + +# (there are also other identified cross-walk strategies for 8 other metadata +# standards) + #http://metamanagement.comm.nsdlib.org/overview.html#NSDL #http://www.dlib.vt.edu/projects/OAi/marcxml/marcxml.html #http://www.openarchives.org/OAI/openarchivesprotocol.html +# "> +# xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +# xsi:schemaLocation="http://purl.org/dc/elements/1.1 +# http://www.openarchives.org/OAI/1.1/dc.xsd"> my $NSDL_metadata1=(< + + The Cornell Law Quarterly 1915-1916 http://heinonline.org/HeinOnline/show.pl? @@ -33,6 +57,12 @@ my $NSDL_metadata1=(<Available by Subscription. See http://www.wshein.com END +open(OUT,'>tmpdc.xml'); +print(OUT < END +open(OUT,'>tmploncapa.xml'); +print(OUT < + +$LONCAPA_metadata + +END +close(OUT); + +# probably also want to protect dc name-space +open(OUT,'>tmpl2n.xsl'); +print(OUT < + + + + + + + + + + + + + +<xsl:value-of select="title"/> + +<!-- NEED TO IMPLEMENT --> +<!-- converted from LON-CAPA language tag to Dublin Core language tag --> + + + +<!-- NEED TO IMPLEMENT --> +<!-- converted from LON-CAPA seconds since 1/1/1970 to standard +calendar values --> + + +Created: ; +Last revised: + + +<!-- NEED TO IMPLEMENT --> +<!-- allow some sort of mapping to Library of Congress or Dewey Decimal +standard subject mapping --> + + + + + +<!-- NEED TO IMPLEMENT --> + +unknown mapping + + + +<!-- NEED TO IMPLEMENT --> + +unknown mapping (coauthors?) + + + +<!-- NEED TO IMPLEMENT --> + +unknown mapping... prerequisite/postrequisite info could go here + + + +<!-- NEED TO IMPLEMENT --> + +unknown mapping + + + +<!-- NEED TO IMPLEMENT --> + +the gateway url + + + +<!-- NEED TO IMPLEMENT --> +<!-- probably mapping from LON-CAPA mime typing --> + +n/a + +<!-- NEED TO IMPLEMENT --> +<!-- probably mapping from LON-CAPA copyright --> + +n/a + + + +# Source + +<!-- NEED TO IMPLEMENT --> + +software and hardware needed + +<!-- NEED TO IMPLEMENT --> + +need to break things into formal "classification" tag to insert keywords + + + + + +END +close(OUT); + +# probably also want to protect dc name-space +open(OUT,'>tmpn2l.xsl'); +print(OUT < + + + + + + + + + + + +<xsl:value-of select="."/> + + + + + + + + + + + + + + + + + + + +END +close(OUT); + +# ---------------------------------- LON-CAPA to NSDL (Dublic Core PLUS format) +my $compiled = $tr->compile_stylesheet_file("tmpl2n.xsl"); +my $parsed = $tr->parse_file("tmploncapa.xml"); +my $dest_file="l2n.xml"; +$tr->transform_to_file($parsed, $compiled, $dest_file) + or die $tr->errstr; + +# ---------------------------------- NSDL (Dublic Core PLUS format) to LON-CAPA +my $compiled = $tr->compile_stylesheet_file("tmpn2l.xsl"); +my $parsed = $tr->parse_file("tmpdc.xml"); +my $dest_file="n2l.xml"; +$tr->transform_to_file($parsed, $compiled, $dest_file) + or die $tr->errstr; -my $compiled = $tr->compile_stylesheet_file("foo.xsl"); -my $parsed = $tr->parse_file("foo.xml"); -my $dest_file="abc.xml"; +# ---------------------------------- test +my $compiled = $tr->compile_stylesheet_file("test1.xsl"); +my $parsed = $tr->parse_file("test1.xml"); +my $dest_file="test1out.xml"; $tr->transform_to_file($parsed, $compiled, $dest_file) or die $tr->errstr;