Difference between revisions of "Metadata XML Schema"

From Biowikifarm Metawiki
Jump to: navigation, search
 
(28 intermediate revisions by 3 users not shown)
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>
+
<table border="1" width="500" style="wikitable">
 +
<TR>
 +
<TH>Type</TH>
 +
<TH>Title</TH>
 +
<TH>Caption</TH>
 +
<TH>Service_Attribution_URI</TH>
 +
<TH>Resource_ID</TH>
 +
<TH>Collection By Resource ID</TH>
 +
<TH>Copyright Statement</TH>
 +
<TH>Creators</TH>
 +
<TH>Language</TH>
 +
<TH>Metadata Language</TH>
 +
<TH>Best_Quality_URI</TH>
 +
<TH>Best_Quality_Availability</TH>
  
<TR style="HEIGHT: 15pt;background-color: #aaaaaa;" >
+
</TR>
<TD style="WIDTH: 96pt; HEIGHT: 15pt" >Type</TD>
+
<TR>
<TD style="WIDTH: 96pt" >Title</TD>
+
<TD>InteractiveResource</TD>
<TD style="WIDTH: 96pt" >Caption</TD>
+
<TD>Ustilago tragopogi-pratensis</TD>
<TD style="WIDTH: 122pt" >Collection By Resource ID</TD>
+
<TD>Ustilago tragopogi-pratensis (Pers.) Roussel;</TD>
<TD style="WIDTH: 98pt" >Copyright_Statement</TD>
+
<TD>http://ServiceProvider/MyDB</TD>
<TD style="WIDTH: 42pt" >Creators</TD>
+
<TD>d1e4</TD>
<TD style="WIDTH: 47pt" >Language</TD>
+
<TD>872783096</TD>
<TD style="WIDTH: 95pt" >Metadata_Language</TD></TR>
+
<TD>© XXX</TD>
<TR style="HEIGHT: 100px;background-color: #eeeeee;" >
+
<TD>Mr Smith</TD>
<TD style=" HEIGHT: 64.5pt" >InteractiveResource</TD>
+
<TD>fr</TD>
<TD >Ustilago tragopogi-pratensis</TD>
+
<TD>fr</TD>
<TD >Ustilago tragopogi-pratensis (Pers.) Roussel;</TD>
+
<TD>URI of InteractiveResource</TD>
<TD  >872783096</TD>
+
<TD>online (free)</TD>
<TD >© XXX</TD>
+
</TR>
<TD >Mr Smith</TD>
+
<TR>
<TD >fr</TD>
+
<TD>Collection</TD>
<TD >fr</TD></TR>
+
<TD>Puccinia coronata</TD>
<TR style="HEIGHT: 100px;background-color: #eeeeee;" >
+
<TD>Puccinia coronata Cda.; sur Alopecurus agrestis L.</TD>
<TD style="HEIGHT: 90pt; BORDER-TOP: medium none" >InteractiveResource</TD>
+
<TD>http://ServiceProvider/MyDB</TD>
<TD " >Puccinia coronata</TD>
+
<TD>d1e5</TD>
<TD >Puccinia coronata Cda.; sur Alopecurus agrestis L.</TD>
+
<TD>872783097</TD>
<TD >872783096</TD>
+
<TD>© ABC</TD>
<TD >© ABC</TD>
+
<TD>Mr Fritz</TD>
<TD >Mr Fritz</TD>
+
<TD>de</TD>
<TD >de</TD>
+
<TD>de</TD>
<TD >de</TD></TR>
+
<TD>&nbsp;</TD>
<TR style="HEIGHT: 100px;background-color: #eeeeee;" >
+
<TD>&nbsp;</TD>
<TD style=" HEIGHT: 128.25pt; " >InteractiveResource</TD>
+
</TR>
<TD >Uromyces arenariae-leptoclados</TD>
+
<TR>
<TD >Uromyces arenariae-leptoclados Vienn.-Bourg.; sur Arenaria leptoclados Guss.</TD>
+
<TD>StillImage</TD>
<TD >872783096</TD>
+
<TD>Uromyces arenariae-leptoclados</TD>
<TD >© ZZZ</TD>
+
<TD>Uromyces arenariae-leptoclados Vienn.-Bourg.; sur Arenaria leptoclados Guss.</TD>
<TD >Mr Fritz</TD>
+
<TD>http://ServiceProvider/MyDB</TD>
<TD >it</TD>
+
<TD>d1e6</TD>
<TD >it</TD></TR></TABLE>
+
<TD>872783098</TD>
 +
<TD>© ZZZ</TD>
 +
<TD>Mr Fritz</TD>
 +
<TD>it</TD>
 +
<TD>it</TD>
 +
<TD>URI of StillImage</TD>
 +
<TD>online (free)</TD>
  
 +
</TR>
 +
<TR>
 +
<TD>Provider</TD>
 +
<TD>My Provider</TD>
 +
<TD>&nbsp;</TD>
 +
<TD>&nbsp;</TD>
 +
<TD>&nbsp;</TD>
 +
<TD>&nbsp;</TD>
 +
<TD>&nbsp;</TD>
 +
<TD>&nbsp;</TD>
 +
<TD>&nbsp;</TD>
 +
<TD>&nbsp;</TD>
 +
<TD>&nbsp;</TD>
 +
<TD>&nbsp;</TD>
  
You have to create three XML file with this content:
+
</TR>
 +
</table>
  
File 1: (demoData1.xml)
+
You have to create XML file with this content:
<pre>
+
 
 +
File 1: (demoData.xml)
 +
<pre><nowiki>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?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">
+
<K2NMetadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.species-id.net/o/media/3/32/K2N.xsd" timestamp="2009-11-04T13:05:01.667+02:00">
 
<InteractiveResource>
 
<InteractiveResource>
 
<!-- Mandatory -->
 
<!-- Mandatory -->
 
<Resource_ID>d1e4</Resource_ID>
 
<Resource_ID>d1e4</Resource_ID>
<Service_Attribution_URI>http://www.keytonature.eu/wiki/</Service_Attribution_URI>
+
<Service_Attribution_URI>http://ServiceProvider/MyDB</Service_Attribution_URI>
 
<Collection_By_Resource_ID>872783096</Collection_By_Resource_ID>
 
<Collection_By_Resource_ID>872783096</Collection_By_Resource_ID>
 
<!-- End Mandatory -->
 
<!-- End Mandatory -->
 
 
<Title>Ustilago tragopogi-pratensis</Title>
 
<Title>Ustilago tragopogi-pratensis</Title>
+
                <Caption>Ustilago tragopogi-pratensis (Pers.) Roussel;</Caption>
 
+
                <Best_Quality_URI>URI of InteractiveResource</Best_Quality_URI>
<Caption>Ustilago tragopogi-pratensis (Pers.) Roussel;</Caption>
+
<Best_Quality_Availability>online (free)</Best_Quality_Availability>
 
+
                <Copyright_Statement>&#64; XXX</Copyright_Statement>
<Copyright_Statement>&#64; XXX</Copyright_Statement>
+
+
 
<Creators>Mr Smith</Creators>
 
<Creators>Mr Smith</Creators>
 
<Language><li>fr</li></Language>
 
<Language><li>fr</li></Language>
 
<Metadata_Language>fr</Metadata_Language>
 
<Metadata_Language>fr</Metadata_Language>
 
</InteractiveResource>
 
</InteractiveResource>
</K2NMetadata>
+
<Collection>
</pre>
+
File 2: (demoData2.xml)
+
<pre>
+
<?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 -->
 
<!-- Mandatory -->
<Resource_ID>d1e4</Resource_ID>
+
<Resource_ID>d1e5</Resource_ID>
<Service_Attribution_URI>http://www.keytonature.eu/wiki/</Service_Attribution_URI>
+
<Service_Attribution_URI>http://ServiceProvider/MyDB</Service_Attribution_URI>
<Collection_By_Resource_ID>872783096</Collection_By_Resource_ID>
+
<Collection_By_Resource_ID>872783097</Collection_By_Resource_ID>
 
<!-- End Mandatory -->
 
<!-- End Mandatory -->
 
 
<Title>Puccinia coronata</Title>
 
<Title>Puccinia coronata</Title>
+
                <Caption>Puccinia coronata Cda.; sur Alopecurus agrestis L.</Caption>
 
+
                <Copyright_Statement>&#64; ABC</Copyright_Statement>
<Caption>Puccinia coronata Cda.; sur Alopecurus agrestis L.</Caption>
+
 
+
<Copyright_Statement>&#64; ABC</Copyright_Statement>
+
+
 
<Creators>Mr Fritz</Creators>
 
<Creators>Mr Fritz</Creators>
 
<Language><li>de</li></Language>
 
<Language><li>de</li></Language>
 
<Metadata_Language>de</Metadata_Language>
 
<Metadata_Language>de</Metadata_Language>
</InteractiveResource>
+
</Collection>
</K2NMetadata>
+
<StillImage>
</pre>
+
File 3: (demoData3.xml)
+
<pre>
+
<?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 -->
 
<!-- Mandatory -->
<Resource_ID>d1e4</Resource_ID>
+
<Resource_ID>d1e6</Resource_ID>
<Service_Attribution_URI>http://www.keytonature.eu/wiki/</Service_Attribution_URI>
+
<Service_Attribution_URI>http://ServiceProvider/MyDB</Service_Attribution_URI>
<Collection_By_Resource_ID>872783096</Collection_By_Resource_ID>
+
<Collection_By_Resource_ID>872783098</Collection_By_Resource_ID>
 
<!-- End Mandatory -->
 
<!-- End Mandatory -->
 
 
<Title>Uromyces arenariae-leptoclados</Title>
 
<Title>Uromyces arenariae-leptoclados</Title>
+
                <Caption>Uromyces arenariae-leptoclados Vienn.-Bourg.; sur Arenaria leptoclados Guss.</Caption>
 
+
                <Best_Quality_URI>URI of StillImage</Best_Quality_URI>
<Caption>Uromyces arenariae-leptoclados Vienn.-Bourg.; sur Arenaria leptoclados Guss.</Caption>
+
<Best_Quality_Availability>online (free)</Best_Quality_Availability>
 
+
                <Copyright_Statement>&#64; ZZZ</Copyright_Statement>
<Copyright_Statement>&#64; ZZZ</Copyright_Statement>
+
+
 
<Creators>Mr Fritz</Creators>
 
<Creators>Mr Fritz</Creators>
 
<Language><li>it</li></Language>
 
<Language><li>it</li></Language>
 
<Metadata_Language>it</Metadata_Language>
 
<Metadata_Language>it</Metadata_Language>
</InteractiveResource>
+
</StillImage>
 +
        <Provider>
 +
<Resource_ID>String</Resource_ID>
 +
<Title>My Provider</Title>
 +
</Provider>
 
</K2NMetadata>
 
</K2NMetadata>
</pre>
+
</nowiki></pre>
 +
 
 +
 
 +
'''NOTE (Gregor): PRESENTLY, THIS EXAMPLE SEEMS INVALID LOGICALLY (ALTHOUGH TECHNICALLY SCHEMA VALID) BECAUSE THE COLLECTION ARE MISSING.'''
 +
 
 +
 
 +
The XML file 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 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.
 +
 
 +
[[File:XmlValidator.jpg|800px]]
 +
 
 +
You can upload those XML files to Fedora repository from <nowiki>http://<URL of application></nowiki>.
  
XML uploaded must must be valid according to the scheme [http://www.species-id.net/o/media/3/32/K2N.xsd K2N.xsd ] and K2NDictionary.xsd.
+
A form is presented to you (see next image), where you must supply some information:
You can check 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 file for validation.
+
If your Xml file is valid, tools reply "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.
+
  
You can upload those xml files to Fedora repository from http://<URL of application>.  
+
[[File:FormUploadXML.jpg]]
  
A form is presented to you, where you must supply some informations (some already filled):
+
* 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.
  
fedora Host: host name of Fedora application server (localhost if Fedora is installed on same server of XML upload application);
+
After clicking on 'Upload File' button, a page shows server messages indicating the success or failure of operation.
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 click on 'Upload File' button, page show server messages indicating the success or failure of operation.
+
[[File:SuccessFedoraIngest.jpg]]

Latest revision as of 10:25, 16 November 2009

Let us suppose we have a database having these data:

Type Title Caption Service_Attribution_URI Resource_ID Collection By Resource ID Copyright Statement Creators Language Metadata Language Best_Quality_URI Best_Quality_Availability
InteractiveResource Ustilago tragopogi-pratensis Ustilago tragopogi-pratensis (Pers.) Roussel; http://ServiceProvider/MyDB d1e4 872783096 © XXX Mr Smith fr fr URI of InteractiveResource online (free)
Collection Puccinia coronata Puccinia coronata Cda.; sur Alopecurus agrestis L. http://ServiceProvider/MyDB d1e5 872783097 © ABC Mr Fritz de de    
StillImage Uromyces arenariae-leptoclados Uromyces arenariae-leptoclados Vienn.-Bourg.; sur Arenaria leptoclados Guss. http://ServiceProvider/MyDB d1e6 872783098 © ZZZ Mr Fritz it it URI of StillImage online (free)
Provider My Provider                    

You have to create XML file with this content:

File 1: (demoData.xml)

<?xml version="1.0" encoding="UTF-8"?>
<K2NMetadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.species-id.net/o/media/3/32/K2N.xsd" timestamp="2009-11-04T13:05:01.667+02:00">
	<InteractiveResource>
		<!-- Mandatory -->
		<Resource_ID>d1e4</Resource_ID>
		<Service_Attribution_URI>http://ServiceProvider/MyDB</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>		
                <Best_Quality_URI>URI of InteractiveResource</Best_Quality_URI>
		<Best_Quality_Availability>online (free)</Best_Quality_Availability>
                <Copyright_Statement>@ XXX</Copyright_Statement>
		<Creators>Mr Smith</Creators>
		<Language><li>fr</li></Language>
		<Metadata_Language>fr</Metadata_Language>
	</InteractiveResource>
	<Collection>
		<!-- Mandatory -->
		<Resource_ID>d1e5</Resource_ID>
		<Service_Attribution_URI>http://ServiceProvider/MyDB</Service_Attribution_URI>
		<Collection_By_Resource_ID>872783097</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>
	</Collection>
	<StillImage>
		<!-- Mandatory -->
		<Resource_ID>d1e6</Resource_ID>
		<Service_Attribution_URI>http://ServiceProvider/MyDB</Service_Attribution_URI>
		<Collection_By_Resource_ID>872783098</Collection_By_Resource_ID>
		<!-- End Mandatory -->		
		<Title>Uromyces arenariae-leptoclados</Title>
                <Caption>Uromyces arenariae-leptoclados Vienn.-Bourg.; sur Arenaria leptoclados Guss.</Caption>	
                <Best_Quality_URI>URI of StillImage</Best_Quality_URI>
		<Best_Quality_Availability>online (free)</Best_Quality_Availability>
                <Copyright_Statement>@ ZZZ</Copyright_Statement>
		<Creators>Mr Fritz</Creators>
		<Language><li>it</li></Language>
		<Metadata_Language>it</Metadata_Language>
	</StillImage>
        <Provider>
		<Resource_ID>String</Resource_ID>
		<Title>My Provider</Title>
	</Provider>
</K2NMetadata>


NOTE (Gregor): PRESENTLY, THIS EXAMPLE SEEMS INVALID LOGICALLY (ALTHOUGH TECHNICALLY SCHEMA VALID) BECAUSE THE COLLECTION ARE MISSING.


The XML file 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.

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:

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.

SuccessFedoraIngest.jpg