Difference between revisions of "Metadata XML Schema"

From Biowikifarm Metawiki
Jump to: navigation, search
Line 1: Line 1:
Suppose you have this metadata to publish:
+
Let us suppose we have a database having these data:
 
+
<TABLE style="WIDTH: 548pt; BORDER-COLLAPSE: collapse; TABLE-LAYOUT: fixed; " border=0 cellSpacing=0 cellPadding=0 width=730>
+
 
+
<TR style="HEIGHT: 15pt;background-color: #aaaaaa;" >
+
<TD style="WIDTH: 96pt; HEIGHT: 15pt" >Type</TD>
+
<TD style="WIDTH: 96pt" >Title</TD>
+
<TD style="WIDTH: 96pt" >Caption</TD>
+
<TD style="WIDTH: 122pt" >Collection By Resource ID</TD>
+
<TD style="WIDTH: 98pt" >Copyright_Statement</TD>
+
<TD style="WIDTH: 42pt" >Creators</TD>
+
<TD style="WIDTH: 47pt" >Language</TD>
+
<TD style="WIDTH: 95pt" >Metadata_Language</TD></TR>
+
<TR style="HEIGHT: 100px;background-color: #eeeeee;" >
+
<TD style=" HEIGHT: 64.5pt" >InteractiveResource</TD>
+
<TD  >Ustilago tragopogi-pratensis</TD>
+
<TD  >Ustilago tragopogi-pratensis (Pers.) Roussel;</TD>
+
<TD  >872783096</TD>
+
<TD  >© XXX</TD>
+
<TD  >Mr Smith</TD>
+
<TD  >fr</TD>
+
<TD  >fr</TD></TR>
+
<TR style="HEIGHT: 100px;background-color: #eeeeee;" >
+
<TD style="HEIGHT: 90pt; BORDER-TOP: medium none" >InteractiveResource</TD>
+
<TD  " >Puccinia coronata</TD>
+
<TD  >Puccinia coronata Cda.; sur Alopecurus agrestis L.</TD>
+
<TD  >872783096</TD>
+
<TD  >© ABC</TD>
+
<TD  >Mr Fritz</TD>
+
<TD  >de</TD>
+
<TD  >de</TD></TR>
+
<TR style="HEIGHT: 100px;background-color: #eeeeee;" >
+
<TD style=" HEIGHT: 128.25pt; " >InteractiveResource</TD>
+
<TD >Uromyces arenariae-leptoclados</TD>
+
<TD >Uromyces arenariae-leptoclados Vienn.-Bourg.; sur Arenaria leptoclados Guss.</TD>
+
<TD >872783096</TD>
+
<TD >© ZZZ</TD>
+
<TD >Mr Fritz</TD>
+
<TD >it</TD>
+
<TD >it</TD></TR></TABLE>
+
  
 +
<TABLE border=1 width=500>
 +
<TR>
 +
<TH>Type</TH>
 +
<TH>Title</TH>
 +
<TH>Caption</TH>
 +
<TH>Collection By Resource ID</TH>
 +
<TH>Copyright_Statement</TH>
 +
<TH>Creators</TH>
 +
<TH>Language</TH>
 +
<TH>Metadata_Language</TH>
 +
</TR>
 +
<TR>
 +
<TD>InteractiveResource</TD>
 +
<TD>Ustilago tragopogi-pratensis</TD>
 +
<TD>Ustilago tragopogi-pratensis (Pers.) Roussel;</TD>
 +
<TD>872783096</TD>
 +
<TD>© XXX</TD>
 +
<TD>Mr Smith</TD>
 +
<TD>fr</TD>
 +
<TD>fr</TD>
 +
</TR>
 +
<TR>
 +
<TD>InteractiveResource</TD>
 +
<TD>Puccinia coronata</TD>
 +
<TD>Puccinia coronata Cda.; sur Alopecurus agrestis L.</TD>
 +
<TD>872783096</TD>
 +
<TD>© ABC</TD>
 +
<TD>Mr Fritz</TD>
 +
<TD>de</TD>
 +
<TD>de</TD>
 +
</TR>
 +
<TR>
 +
<TD>InteractiveResource</TD>
 +
<TD>Uromyces arenariae-leptoclados</TD>
 +
<TD>Uromyces arenariae-leptoclados Vienn.-Bourg.; sur Arenaria leptoclados Guss.</TD>
 +
<TD>872783096</TD>
 +
<TD>© ZZZ</TD>
 +
<TD>Mr Fritz</TD>
 +
<TD>it</TD>
 +
<TD>it</TD>
 +
</TR>
 +
</TABLE>
  
 
You have to create three XML files with this content:
 
You have to create three XML files with this content:
Line 117: Line 120:
 
</pre>
 
</pre>
  
XML file to be uploaded must must be valid according to the scheme [http://www.species-id.net/o/media/3/32/K2N.xsd K2N.xsd ] and [http://www.species-id.net/o/media/d/de/K2NDictionary.xsd K2NDictionary.xsd].
+
The XML files must be valid according to the scheme [http://www.species-id.net/o/media/3/32/K2N.xsd K2N.xsd ] and [http://www.species-id.net/o/media/d/de/K2NDictionary.xsd K2NDictionary.xsd].
You can check validity of your XML file by using online validation tool at http://www.xmlvalidation.com/.
+
You can check the validity of your XML file by using online validation tool at http://www.xmlvalidation.com/.
 
The tool allows you to upload the XML file as well as the required XSD files for validation.
 
The tool allows you to upload the XML file as well as the required XSD files for validation.
If your XML file is valid, tools reply "No errors were found".
+
If your XML file is valid, the tool replies "No errors were found".
If your XML file is not valid, a report is generated showing you errors and allowing you to edit the XML file for any corrections.
+
If your XML file is not valid, a report is generated showing your errors and allowing you to edit the XML file for any corrections.
 
Next image show successfully XML validation.
 
Next image show successfully XML validation.
  
Line 130: Line 133:
 
You can upload those XML files to Fedora repository from http://<URL of application>.  
 
You can upload those XML files to Fedora repository from http://<URL of application>.  
  
A form is presented to you (see next image), where you must supply some informations (some already filled):
+
A form is presented to you (see next image), where you must supply some information:
  
  
Line 144: Line 147:
  
  
After click on 'Upload File' button, page show server messages indicating the success or failure of operation.
+
After clicking on 'Upload File' button, a page shows server messages indicating the success or failure of operation.
  
 
http://www.species-id.net/o/media/5/5e/SuccessFedoraIngest.jpg
 
http://www.species-id.net/o/media/5/5e/SuccessFedoraIngest.jpg

Revision as of 15:21, 4 November 2009

Let us suppose we have a database having these data:

Type Title Caption Collection By Resource ID Copyright_Statement Creators Language Metadata_Language
InteractiveResource Ustilago tragopogi-pratensis Ustilago tragopogi-pratensis (Pers.) Roussel; 872783096 © XXX Mr Smith fr fr
InteractiveResource Puccinia coronata Puccinia coronata Cda.; sur Alopecurus agrestis L. 872783096 © ABC Mr Fritz de de
InteractiveResource Uromyces arenariae-leptoclados Uromyces arenariae-leptoclados Vienn.-Bourg.; sur Arenaria leptoclados Guss. 872783096 © ZZZ Mr Fritz it it

You have to create three XML files with this content:

File 1: (demoData1.xml)

<?xml version="1.0" encoding="UTF-8"?>
<K2NMetadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="K2N.xsd" timestamp="2009-11-04T13:05:01.667+02:00">
	<InteractiveResource>
		<!-- Mandatory -->
		<Resource_ID>d1e4</Resource_ID>
		<Service_Attribution_URI>http://www.keytonature.eu/wiki/</Service_Attribution_URI>
		<Collection_By_Resource_ID>872783096</Collection_By_Resource_ID>
		<!-- End Mandatory -->		
		
		<Title>Ustilago tragopogi-pratensis</Title>
		

		<Caption>Ustilago tragopogi-pratensis (Pers.) Roussel;</Caption>		

		<Copyright_Statement>@ XXX</Copyright_Statement>
		
		<Creators>Mr Smith</Creators>
		<Language><li>fr</li></Language>
		<Metadata_Language>fr</Metadata_Language>
	</InteractiveResource>
</K2NMetadata>

File 2: (demoData2.xml)

<?xml version="1.0" encoding="UTF-8"?>
<K2NMetadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="K2N.xsd" timestamp="2009-11-04T13:05:01.667+02:00">
	<InteractiveResource>
		<!-- Mandatory -->
		<Resource_ID>d1e4</Resource_ID>
		<Service_Attribution_URI>http://www.keytonature.eu/wiki/</Service_Attribution_URI>
		<Collection_By_Resource_ID>872783096</Collection_By_Resource_ID>
		<!-- End Mandatory -->		
		
		<Title>Puccinia coronata</Title>
		

		<Caption>Puccinia coronata Cda.; sur Alopecurus agrestis L.</Caption>		

		<Copyright_Statement>@ ABC</Copyright_Statement>
		
		<Creators>Mr Fritz</Creators>
		<Language><li>de</li></Language>
		<Metadata_Language>de</Metadata_Language>
	</InteractiveResource>
</K2NMetadata>

File 3: (demoData3.xml)

<?xml version="1.0" encoding="UTF-8"?>

<K2NMetadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="K2N.xsd" timestamp="2009-11-04T13:05:01.667+02:00">
	<InteractiveResource>
		<!-- Mandatory -->
		<Resource_ID>d1e4</Resource_ID>
		<Service_Attribution_URI>http://www.keytonature.eu/wiki/</Service_Attribution_URI>
		<Collection_By_Resource_ID>872783096</Collection_By_Resource_ID>
		<!-- End Mandatory -->		
		
		<Title>Uromyces arenariae-leptoclados</Title>
		

		<Caption>Uromyces arenariae-leptoclados Vienn.-Bourg.; sur Arenaria leptoclados Guss.</Caption>		

		<Copyright_Statement>@ ZZZ</Copyright_Statement>
		
		<Creators>Mr Fritz</Creators>
		<Language><li>it</li></Language>
		<Metadata_Language>it</Metadata_Language>
	</InteractiveResource>
</K2NMetadata>

The XML files must be valid according to the scheme K2N.xsd and K2NDictionary.xsd. You can check the validity of your XML file by using online validation tool at http://www.xmlvalidation.com/. The tool allows you to upload the XML file as well as the required XSD files for validation. If your XML file is valid, the tool replies "No errors were found". If your XML file is not valid, a report is generated showing your errors and allowing you to edit the XML file for any corrections. Next image show successfully XML validation.


http://www.species-id.net/o/media/thumb/e/ef/XmlValidator.jpg/800px-XmlValidator.jpg


You can upload those XML files to Fedora repository from http://<URL of application>.

A form is presented to you (see next image), where you must supply some information:


http://www.species-id.net/o/media/f/f1/FormUploadXML.jpg


  • fedora Host: host name of Fedora application server (localhost if Fedora is installed on same server of XML upload application);
  • fedora Port: port number of Fedora application server;
  • fedora Path: application path of Fedora application server (default fedora);
  • fedora Login and Fedora Password: credential to submit file to Fedora repository (admin credentials);
  • PID: unique identifier to assign to content to be published;
  • XML File: XML file to publish to repository.


After clicking on 'Upload File' button, a page shows server messages indicating the success or failure of operation.

http://www.species-id.net/o/media/5/5e/SuccessFedoraIngest.jpg