This is an old revision of the document!


Add metadata format PICO to OAI-PMH

Fedora Commons Sdef object

Ingest new object Sdef (PID openbess:dc2picoSdef) with these DS:

  • DC
  • RELS_EXT
<rdf:RDF xmlns:fedora-model="info:fedora/fedora-system:def/model#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about="info:fedora/openbess:dc2picoSdef">
    <fedora-model:hasModel rdf:resource="info:fedora/fedora-system:ServiceDefinition-3.0"></fedora-model:hasModel>
  </rdf:Description>
</rdf:RDF>
  • METHODMAP
<fmm:MethodMap xmlns:fmm="http://fedora.comm.nsdlib.org/service/methodmap" name="methodmap">
  <fmm:Method operationName="dc2pico"></fmm:Method>
</fmm:MethodMap>

Fedora Commons Sdep object

Ingest new object Sdep (PID openbess:dc2picoSdep-bookCModel) with these DS:

  • DC
  • RELS-EXT
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about="info:fedora/openbess:dc2picoSdep-bookCModel">
    <hasModel xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/fedora-system:ServiceDeployment-3.0"/>
    <isDeploymentOf xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/openbess:dc2picoSdef"/>
    <isContractorOf xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/islandora:bookCModel"/>
  </rdf:Description>
</rdf:RDF>
  • DSINPUTSPEC
<?xml version="1.0"?>
<fbs:DSInputSpec xmlns:fbs="http://fedora.comm.nsdlib.org/service/bindspec" label="dc2picoSdepInputSpec">
  <fbs:DSInput DSMax="1" DSMin="1" DSOrdinality="false" wsdlMsgPartName="DC">
    <fbs:DSInputLabel>DC</fbs:DSInputLabel>
    <fbs:DSMIME>text/xml</fbs:DSMIME>
    <fbs:DSInputInstruction/>
  </fbs:DSInput>
  <fbs:DSInput DSMax="1" DSMin="1" DSOrdinality="false" pid="openbess:dc2picoSdep-bookCModel" wsdlMsgPartName="XSL">
    <fbs:DSInputLabel>XSL</fbs:DSInputLabel>
    <fbs:DSMIME>text/xml</fbs:DSMIME>
    <fbs:DSInputInstruction/>
  </fbs:DSInput>
</fbs:DSInputSpec>
  • WDSL
<?xml version="1.0"?>
<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap" xmlns:soapenc="http://schemas.xmlsoap.org/wsdl/soap/encoding" xmlns:this="dc2picoSdep" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="dc2picoSdep" targetNamespace="dc2picoSdep">
  <wsdl:message name="dc2picoRequestMsg">
    <wsdl:part name="DC" type="xsd:string"/>
    <wsdl:part name="XSL" type="xsd:string"/>
  </wsdl:message>
  <wsdl:message name="response">
    <wsdl:part name="exhibit" type="xsd:base64Binary"/>
  </wsdl:message>
  <wsdl:portType name="dc2pico_portType">
    <wsdl:operation name="dc2pico">
      <wsdl:input message="this:dc2picoRequestMsg"/>
      <wsdl:output message="this:response"/>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:service name="dc2pico_service">
    <wsdl:port binding="this:dc2pico_binding" name="dc2pico_port">
      <http:address location="http://fc1.to.cnr.it:8080/saxon/"/>
    </wsdl:port>
  </wsdl:service>
  <wsdl:binding name="dc2pico_binding" type="this:dc2pico_portType">
    <http:binding verb="GET"/>
    <wsdl:operation name="dc2pico">
      <http:operation location="SaxonServlet?source=(DC)&amp;style=(XSL)&amp;clear-stylesheet-cache=yes"/>
      <wsdl:input>
        <http:urlReplacement/>
      </wsdl:input>
      <wsdl:output>
        <mime:content type="text/xml"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
</wsdl:definitions>
  • METHODMAP
<?xml version="1.0"?>
<fmm:MethodMap xmlns:fmm="http://fedora.comm.nsdlib.org/service/methodmap" name="methodmap">
  <fmm:Method operationName="dc2pico" wsdlMsgName="dc2picoRequestMsg" wsdlMsgOutput="response">
    <fmm:DatastreamInputParm parmName="DC" passBy="URL_REF" required="true"/>
    <fmm:DatastreamInputParm parmName="XSL" passBy="URL_REF" required="true"/>
    <fmm:UserInputParm defaultValue="" parmName="uid" passBy="VALUE" required="false"/>
    <fmm:MethodReturnType wsdlMsgName="response" wsdlMsgTOMIME="text/xml"/>
  </fmm:Method>
</fmm:MethodMap>
  • XSL (see next paragraph)

XSLT for DC to PICO transformation

XSL datastream contains xslt transformation:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:foxml="info:fedora/fedora-system:def/foxml#" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:pico="http://purl.org/pico/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="oai_dc fn foxml rdf" version="1.0" xsi:schemaLocation="http://purl.org/pico/1.0/ http://www.culturaitalia.it/opencms/export/sites/culturaitalia/attachments/schemas/1.0/pico.xsd">
  <xsl:output encoding="UTF-8" indent="yes" method="xml"/>
  <xsl:variable name="ns" select="'http://purl.org/pico/1.0/'"/>
  <xsl:variable name="schemaLoc" select="'http://purl.org/pico/1.0/ http://www.culturaitalia.it/opencms/export/sites/culturaitalia/attachments/schemas/1.0/pico.xsd'"/>
  <xsl:template match="/">
    <pico:record>
      <xsl:attribute name="xsi:schemaLocation" namespace="http://www.w3.org/2001/XMLSchema-instance">
        <xsl:value-of select="$schemaLoc"/>
      </xsl:attribute>
      <dc:title>
        <xsl:value-of select="/oai_dc:dc/dc:title"/>
      </dc:title>
      <dc:creator>
        <xsl:value-of select="/oai_dc:dc/dc:creator"/>
      </dc:creator>
      <xsl:apply-templates select="/oai_dc:dc/dc:subject"/>
      <xsl:if test="/oai_dc:dc/dc:description != ''">
        <dc:description>
          <xsl:value-of select="/oai_dc:dc/dc:description"/>
        </dc:description>
      </xsl:if>
      <dc:publisher>
        <xsl:value-of select="/oai_dc:dc/dc:publisher"/>
      </dc:publisher>
      <dc:date>
        <xsl:value-of select="/oai_dc:dc/dc:date"/>
      </dc:date>
      <xsl:apply-templates select="/oai_dc:dc/dc:type"/>
      <xsl:for-each select="/oai_dc:dc/dc:identifier">
        <xsl:choose>
          <xsl:when test="contains(.,'http')">
            <xsl:element name="dcterms:isReferencedBy">
              <xsl:attribute name="xsi:type" namespace="http://www.w3.org/2001/XMLSchema-instance">pico:Anchor</xsl:attribute>
              <xsl:value-of select="'title=visualizza la scheda esterna; url='"/>
              <xsl:value-of select="."/>
            </xsl:element>
            <xsl:element name="pico:preview">
              <xsl:attribute name="xsi:type" namespace="http://www.w3.org/2001/XMLSchema-instance">dcterms:URI</xsl:attribute>
              <xsl:value-of select="."/>
              <xsl:value-of select="'/TN'"/>
            </xsl:element>
          </xsl:when>
          <xsl:otherwise>
            <dc:identifier>
              <xsl:value-of select="."/>
            </dc:identifier>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:for-each>
      <dc:language>
        <xsl:value-of select="/oai_dc:dc/dc:language"/>
      </dc:language>
    </pico:record>
  </xsl:template>
  <xsl:template match="dc:subject">
    <dc:subject>
      <xsl:value-of select="/oai_dc:dc/dc:subject"/>
    </dc:subject>
    <xsl:element name="dc:subject">
      <xsl:attribute name="xsi:type" namespace="http://www.w3.org/2001/XMLSchema-instance">pico:Thesaurus</xsl:attribute>
      <xsl:value-of select="'http://culturaitalia.it/pico/thesaurus/4.2#libri'"/>
    </xsl:element>
  </xsl:template>
  <xsl:template match="dc:type">
    <xsl:element name="dc:type">
      <xsl:attribute name="xsi:type" namespace="http://www.w3.org/2001/XMLSchema-instance">dcterms:DCMIType</xsl:attribute>
      <xsl:value-of select="/oai_dc:dc/dc:type"/>
    </xsl:element>
  </xsl:template>
</xsl:stylesheet>

Fedora Commons bookCModel

Add the new service to RELS-EXT datastream:

<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about="info:fedora/islandora:bookCModel">
    <hasModel xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/fedora-system:ContentModel-3.0"/>
    <hasService xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/islandora:viewerSdef"/>
    <hasService xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/openbess:dc2picoSdef"/>
  </rdf:Description>
</rdf:RDF>

Oaiprovider (proai) configuration

Add new metada format to proai.properties:

...
driver.fedora.md.formats = oai_dc pico
driver.fedora.md.format.oai_dc.loc = http://www.openarchives.org/OAI/2.0/oai_dc.xsd
driver.fedora.md.format.pico.loc = http://www.culturaitalia.it/opencms/export/sites/culturaitalia/attachments/schemas/1.0/pico.xsd
driver.fedora.md.format.oai_dc.uri = http://www.openarchives.org/OAI/2.0/oai_dc/
driver.fedora.md.format.pico.uri = http://purl.org/pico/1.0/
driver.fedora.md.format.oai_dc.dissType = info:fedora/*/DC
driver.fedora.md.format.pico.dissType = info:fedora/*/openbess:dc2picoSdef/dc2pico
...

Result example

Harvesting fron this URL

http://fc1.to.cnr.it/oaiprovider/?verb=GetRecord&identifier=oai:fc1.to.cnr.it:openbess:TO043-00057&metadataPrefix=pico 

return this:

<?xml version="1.0" encoding="UTF-8"?>
<OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/                              http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd">
  <responseDate>2012-07-11T10:03:19Z</responseDate>
  <request verb="GetRecord" identifier="oai:fc1.to.cnr.it:openbess:TO043-00057" metadataPrefix="pico">http://fc1.to.cnr.it/oaiprovider/</request>
  <GetRecord>
    <record>
      <header>
        <identifier>oai:fc1.to.cnr.it:openbess:TO043-00057</identifier>
        <datestamp>2012-07-11T10:02:03Z</datestamp>
        <setSpec>digibess:openbess:cognetti:directors</setSpec>
      </header>
      <metadata>
        <pico:record xmlns:pico="http://purl.org/pico/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xsi:schemaLocation="http://purl.org/pico/1.0/ http://www.culturaitalia.it/opencms/export/sites/culturaitalia/attachments/schemas/1.0/pico.xsd">
          <dc:title>Monografie di soci e allievi del laboratorio di economia politica : 1909-911</dc:title>
          <dc:creator>R. Università di Torino</dc:creator>
          <dc:subject>Economia, lavoro, società</dc:subject>
          <dc:subject xsi:type="pico:Thesaurus">http://culturaitalia.it/pico/thesaurus/4.2#libri</dc:subject>
          <dc:publisher>s.n.</dc:publisher>
          <dc:date>2012-01-16</dc:date>
          <dc:type xsi:type="dcterms:DCMIType">Text</dc:type>
          <dc:identifier>openbess:TO043-00057</dc:identifier>
          <dcterms:isReferencedBy xsi:type="pico:Anchor">title=visualizza la scheda esterna; url=http://www.digibess.it/fedora/repository/openbess:TO043-00057</dcterms:isReferencedBy>
          <pico:preview xsi:type="dcterms:URI">http://www.digibess.it/fedora/repository/openbess:TO043-00057/TN</pico:preview>
          <dc:language>it</dc:language>
        </pico:record>
      </metadata>
    </record>
  </GetRecord>
</OAI-PMH>
 
 
repo/pico.1342008088.txt.gz · Last modified: 2012/07/11 14:01 by giancarlo

Developers: CNR IRCrES IT Office and Library
Giancarlo Birello (giancarlo.birello _@_ ircres.cnr.it) and Anna Perin (anna.perin _@_ ircres.cnr.it)
DigiBess is licensed under: Creative Commons License
Recent changes RSS feed Creative Commons License Valid XHTML 1.0 Valid CSS Driven by DokuWiki
Drupal Garland Theme for Dokuwiki