Commit ec96d442eded320cb37288c4356bf5dbec58c64d

Authored by Fernando Ribeiro
1 parent 432393d60e
Exists in OPENAIRE5.X

Added a xoai.xml file with the FCT filter already defined and added a informatio…

…n in Readme.md to skip this step. Only is needed this step if someone wants to add a new filter
Readme.md
... ... @@ -113,7 +113,7 @@ At $DSPACE_SRC/config/input-forms.xml after ```<page number="1">``` add:
113 113 <hint>Insira um termo de pesquisa (n&#xFA;mero, nome, acr&#xF3;nimo ou refer&#xea;cia) do projeto financiado (EC, ERC, WT, FCT)gt;</hint>
114 114 </field>
115 115  
116   -## Change xoai.xml configuration (for FCT set filter)
  116 +## Change xoai.xml configuration (for FCT set filter) - You can skip this step if there is a xoai.xml file already with this information, but if needed to add more filters use a similar approach like the one explained bellow
117 117 At $DSPACE_SRC/config/crosswalks/oai/xoai.xml
118 118 Before ```</Contexts>``` add:
119 119  
... ...
setup-data/dspace-source/dspace/config/crosswalks/oai/xoai.xml
... ... @@ -0,0 +1,494 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!--
  3 +
  4 + The contents of this file are subject to the license and copyright
  5 + detailed in the LICENSE and NOTICE files at the root of the source
  6 + tree and available online at
  7 +
  8 + http://www.dspace.org/license/
  9 +
  10 + Developed by DSpace @ Lyncode <dspace@lyncode.com>
  11 + -->
  12 +<Configuration indented="false" maxListIdentifiersSize="100" maxListRecordsSize="100"
  13 + maxListSetsSize="100" stylesheet="static/style.xsl"
  14 + xmlns="http://www.lyncode.com/XOAIConfiguration">
  15 +
  16 + <Contexts>
  17 + <Context baseurl="request" name="Default Context">
  18 + <!-- Restrict access to hidden items by default -->
  19 + <Filter ref="defaultFilter" />
  20 +
  21 + <Format ref="oaidc"/>
  22 + <Format ref="mets"/>
  23 + <Format ref="xoai"/>
  24 + <Format ref="didl"/>
  25 + <Format ref="dim"/>
  26 + <Format ref="ore"/>
  27 + <Format ref="rdf"/>
  28 + <Format ref="etdms"/>
  29 + <Format ref="mods"/>
  30 + <Format ref="qdc"/>
  31 + <Format ref="marc"/>
  32 + <Format ref="uketd_dc"/>
  33 + <!--<Format ref="junii2" />-->
  34 + <Description>
  35 + This is the default context of the DSpace OAI-PMH data provider.
  36 + </Description>
  37 + </Context>
  38 +
  39 + <!--
  40 + Driver Guidelines:
  41 +
  42 + - http://www.driver-support.eu/documents/DRIVER_Guidelines_v2_Final_2008-11-13.pdf
  43 +
  44 + Page 57 - 58
  45 + -->
  46 + <Context baseurl="driver" name="Driver Context">
  47 + <!-- Date format, field prefixes, etc are ensured by the transformer -->
  48 + <Transformer ref="driverTransformer"/>
  49 + <!-- The driver filter -->
  50 + <Filter ref="driverFilter"/>
  51 + <!-- Just an alias, in fact it returns all items within the driver context -->
  52 + <Set ref="driverSet"/>
  53 + <!-- Metadata Formats -->
  54 + <Format ref="oaidc"/>
  55 + <Format ref="mets"/>
  56 + <Format ref="didl"/>
  57 + <Description>
  58 + This contexts complies with Driver rules.
  59 + </Description>
  60 + </Context>
  61 +
  62 + <!--
  63 + OpenAIRE Guidelines 1.1:
  64 +
  65 + - https://guidelines.openaire.eu/en/latest/
  66 +
  67 + There is a limitation over the embargoedEndDate parameter:
  68 +
  69 + - Predefined DSpace fields don't allow to set this up with a default.
  70 + -->
  71 + <Context baseurl="openaire" name="OpenAIRE Context">
  72 + <!-- Date format, field prefixes, etc are ensured by the transformer -->
  73 + <Transformer ref="openaireTransformer"/>
  74 + <!-- OpenAIRE filter -->
  75 + <Filter ref="openAireFilter"/>
  76 + <!-- Just an alias, in fact it returns all items within the driver context -->
  77 + <Set ref="openaireSet"/>
  78 + <!-- Metadata Formats -->
  79 + <Format ref="oaidc"/>
  80 + <Format ref="mets"/>
  81 + <Description>
  82 + This contexts complies with OpenAIRE rules.
  83 + </Description>
  84 + </Context>
  85 + <!-- FCT FILTER -->
  86 + <Context baseurl="fct" name="FCT Context">
  87 + <!-- Date format, field prefixes, etc are ensured by the transformer -->
  88 + <Transformer ref="openaireTransformer"/>
  89 + <!-- OpenAIRE filter -->
  90 + <Filter ref="fctFilter"/>
  91 + <!-- Just an alias, in fact it returns all items within the driver context -->
  92 + <Set ref="fctSet"/>
  93 + <!-- Metadata Formats -->
  94 + <Format ref="oaidc"/>
  95 + <Format ref="mets"/>
  96 + <Description>
  97 + This contexts complies with FCT rules.
  98 + </Description>
  99 + </Context>
  100 + </Contexts>
  101 +
  102 +
  103 + <Formats>
  104 + <Format id="oaidc">
  105 + <Prefix>oai_dc</Prefix>
  106 + <XSLT>metadataFormats/oai_dc.xsl</XSLT>
  107 + <Namespace>http://www.openarchives.org/OAI/2.0/oai_dc/</Namespace>
  108 + <SchemaLocation>http://www.openarchives.org/OAI/2.0/oai_dc.xsd</SchemaLocation>
  109 + </Format>
  110 + <Format id="mets">
  111 + <Prefix>mets</Prefix>
  112 + <XSLT>metadataFormats/mets.xsl</XSLT>
  113 + <Namespace>http://www.loc.gov/METS/</Namespace>
  114 + <SchemaLocation>http://www.loc.gov/standards/mets/mets.xsd</SchemaLocation>
  115 + </Format>
  116 + <!-- Shows the XOAI internal generated XML -->
  117 + <Format id="xoai">
  118 + <Prefix>xoai</Prefix>
  119 + <XSLT>metadataFormats/xoai.xsl</XSLT>
  120 + <Namespace>http://www.lyncode.com/xoai</Namespace>
  121 + <SchemaLocation>http://www.lyncode.com/schemas/xoai.xsd</SchemaLocation>
  122 + </Format>
  123 + <Format id="didl">
  124 + <Prefix>didl</Prefix>
  125 + <XSLT>metadataFormats/didl.xsl</XSLT>
  126 + <Namespace>urn:mpeg:mpeg21:2002:02-DIDL-NS</Namespace>
  127 + <SchemaLocation>http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-21_schema_files/did/didl.xsd
  128 + </SchemaLocation>
  129 + </Format>
  130 + <Format id="dim">
  131 + <Prefix>dim</Prefix>
  132 + <XSLT>metadataFormats/dim.xsl</XSLT>
  133 + <Namespace>http://www.dspace.org/xmlns/dspace/dim</Namespace>
  134 + <SchemaLocation>http://www.dspace.org/schema/dim.xsd</SchemaLocation>
  135 + </Format>
  136 + <Format id="ore">
  137 + <Prefix>ore</Prefix>
  138 + <XSLT>metadataFormats/ore.xsl</XSLT>
  139 + <Namespace>http://www.w3.org/2005/Atom</Namespace>
  140 + <SchemaLocation>http://tweety.lanl.gov/public/schemas/2008-06/atom-tron.sch</SchemaLocation>
  141 + </Format>
  142 + <Format id="rdf">
  143 + <Prefix>rdf</Prefix>
  144 + <XSLT>metadataFormats/rdf.xsl</XSLT>
  145 + <Namespace>http://www.openarchives.org/OAI/2.0/rdf/</Namespace>
  146 + <SchemaLocation>http://www.openarchives.org/OAI/2.0/rdf.xsd</SchemaLocation>
  147 + </Format>
  148 + <Format id="etdms">
  149 + <Prefix>etdms</Prefix>
  150 + <XSLT>metadataFormats/etdms.xsl</XSLT>
  151 + <Namespace>http://www.ndltd.org/standards/metadata/etdms/1.0/</Namespace>
  152 + <SchemaLocation>http://www.ndltd.org/standards/metadata/etdms/1.0/etdms.xsd</SchemaLocation>
  153 + </Format>
  154 + <Format id="mods">
  155 + <Prefix>mods</Prefix>
  156 + <XSLT>metadataFormats/mods.xsl</XSLT>
  157 + <Namespace>http://www.loc.gov/mods/v3</Namespace>
  158 + <SchemaLocation>http://www.loc.gov/standards/mods/v3/mods-3-1.xsd</SchemaLocation>
  159 + </Format>
  160 + <Format id="qdc">
  161 + <Prefix>qdc</Prefix>
  162 + <XSLT>metadataFormats/qdc.xsl</XSLT>
  163 + <Namespace>http://purl.org/dc/terms/</Namespace>
  164 + <SchemaLocation>http://dublincore.org/schemas/xmls/qdc/2006/01/06/dcterms.xsd</SchemaLocation>
  165 + </Format>
  166 + <Format id="marc">
  167 + <Prefix>marc</Prefix>
  168 + <XSLT>metadataFormats/marc.xsl</XSLT>
  169 + <Namespace>http://www.loc.gov/MARC21/slim</Namespace>
  170 + <SchemaLocation>http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd</SchemaLocation>
  171 + </Format>
  172 + <Format id="uketd_dc">
  173 + <Prefix>uketd_dc</Prefix>
  174 + <XSLT>metadataFormats/uketd_dc.xsl</XSLT>
  175 + <Namespace>http://naca.central.cranfield.ac.uk/ethos-oai/2.0/</Namespace>
  176 + <SchemaLocation>http://naca.central.cranfield.ac.uk/ethos-oai/2.0/uketd_dc.xsd</SchemaLocation>
  177 + <Filter ref="uketdDcFilter"/>
  178 + </Format>
  179 + <Format id="junii2">
  180 + <Prefix>junii2</Prefix>
  181 + <XSLT>metadataFormats/junii2.xsl</XSLT>
  182 + <Namespace>http://irdb.nii.ac.jp/oai</Namespace>
  183 + <SchemaLocation>http://irdb.nii.ac.jp/oai/junii2-3-1.xsd</SchemaLocation>
  184 + </Format>
  185 + </Formats>
  186 +
  187 + <Transformers>
  188 + <Transformer id="driverTransformer">
  189 + <XSLT>transformers/driver.xsl</XSLT>
  190 + </Transformer>
  191 + <Transformer id="openaireTransformer">
  192 + <XSLT>transformers/openaire.xsl</XSLT>
  193 + </Transformer>
  194 + </Transformers>
  195 +
  196 +
  197 + <Filters>
  198 + <!-- DRIVER filter for records returned by OAI-PMH.
  199 + By default, return an Item record:
  200 + * If a Title & Author field both exist
  201 + * AND a valid DRIVER Document Type exists
  202 + * AND Item is either publicly accessible OR Withdrawn (for tombstones)
  203 + * AND Driver "open access" condition is specified
  204 + This filter is only used in the DRIVER context ([oai]/driver)
  205 + -->
  206 + <Filter id="driverFilter">
  207 + <Definition>
  208 + <And>
  209 + <LeftCondition>
  210 + <And>
  211 + <LeftCondition>
  212 + <Custom ref="titleExistsCondition"/>
  213 + </LeftCondition>
  214 + <RightCondition>
  215 + <Custom ref="authorExistsCondition"/>
  216 + </RightCondition>
  217 + </And>
  218 + </LeftCondition>
  219 + <RightCondition>
  220 + <And>
  221 + <LeftCondition>
  222 + <Custom ref="driverDocumentTypeCondition"/>
  223 + </LeftCondition>
  224 + <RightCondition>
  225 + <And>
  226 + <LeftCondition>
  227 + <Or>
  228 + <LeftCondition>
  229 + <Custom ref="itemAccessCondition"/>
  230 + </LeftCondition>
  231 + <RightCondition>
  232 + <Custom ref="itemWithdrawnCondition"/>
  233 + </RightCondition>
  234 + </Or>
  235 + </LeftCondition>
  236 + <RightCondition>
  237 + <Custom ref="driverAccessCondition"/>
  238 + </RightCondition>
  239 + </And>
  240 + </RightCondition>
  241 + </And>
  242 + </RightCondition>
  243 + </And>
  244 + </Definition>
  245 + </Filter>
  246 +
  247 + <!-- OpenAIRE filter for records returned by OAI-PMH.
  248 + By default, return an Item record:
  249 + * If a Title & Author field both exist
  250 + * AND a valid DRIVER Document Type exists
  251 + * AND Item is either publicly accessible OR Withdrawn (for tombstones)
  252 + * AND the OpenAIRE "dc.relation" is specified
  253 + This filter is only used in the OpenAIRE context ([oai]/openaire).
  254 + -->
  255 +
  256 + <Filter id="openAireFilter">
  257 + <Definition>
  258 + <And>
  259 + <LeftCondition>
  260 + <And>
  261 + <LeftCondition>
  262 + <Custom ref="titleExistsCondition"/>
  263 + </LeftCondition>
  264 + <RightCondition>
  265 + <Custom ref="authorExistsCondition"/>
  266 + </RightCondition>
  267 + </And>
  268 + </LeftCondition>
  269 + <RightCondition>
  270 + <And>
  271 + <LeftCondition>
  272 + <Custom ref="driverDocumentTypeCondition"/>
  273 + </LeftCondition>
  274 + <RightCondition>
  275 + <And>
  276 + <LeftCondition>
  277 + <Or>
  278 + <LeftCondition>
  279 + <Custom ref="itemAccessCondition"/>
  280 + </LeftCondition>
  281 + <RightCondition>
  282 + <Custom ref="itemWithdrawnCondition"/>
  283 + </RightCondition>
  284 + </Or>
  285 + </LeftCondition>
  286 + <RightCondition>
  287 + <Custom ref="openaireRelationCondition"/>
  288 + </RightCondition>
  289 + </And>
  290 + </RightCondition>
  291 + </And>
  292 + </RightCondition>
  293 + </And>
  294 + </Definition>
  295 + </Filter>
  296 +
  297 + <!-- UKETD Filter for records returned by OAI-PMH.
  298 + By default, return an Item record:
  299 + * If it is a "thesis"
  300 +
  301 + This filter is appended to any existing filter
  302 + when "metadataPrefix=uketd_dc" is specified.
  303 + -->
  304 + <Filter id="uketdDcFilter">
  305 + <Definition>
  306 + <Custom ref="thesisDocumentTypeCondition"/>
  307 + </Definition>
  308 + </Filter>
  309 +
  310 + <!-- Default filter for records returned by OAI-PMH.
  311 + By default, return an Item record:
  312 + * If it is publicly accessible
  313 + * OR it has been withdrawn (in order to display a tombstone record).
  314 + This filter is used by the default context ([oai]/request).
  315 + -->
  316 + <Filter id="defaultFilter">
  317 + <Definition>
  318 + <Or>
  319 + <LeftCondition>
  320 + <Custom ref="itemAccessCondition"/>
  321 + </LeftCondition>
  322 + <RightCondition>
  323 + <Custom ref="itemWithdrawnCondition"/>
  324 + </RightCondition>
  325 + </Or>
  326 + </Definition>
  327 + </Filter>
  328 +
  329 + <!-- FCT FILTER -->
  330 + <Filter id="fctFilter">
  331 + <Definition>
  332 + <And>
  333 + <LeftCondition>
  334 + <And>
  335 + <LeftCondition>
  336 + <Custom ref="titleExistsCondition"/>
  337 + </LeftCondition>
  338 + <RightCondition>
  339 + <Custom ref="authorExistsCondition"/>
  340 + </RightCondition>
  341 + </And>
  342 + </LeftCondition>
  343 + <RightCondition>
  344 + <And>
  345 + <LeftCondition>
  346 + <Custom ref="driverDocumentTypeCondition"/>
  347 + </LeftCondition>
  348 + <RightCondition>
  349 + <And>
  350 + <LeftCondition>
  351 + <Or>
  352 + <LeftCondition>
  353 + <Custom ref="itemAccessCondition"/>
  354 + </LeftCondition>
  355 + <RightCondition>
  356 + <Custom ref="itemWithdrawnCondition"/>
  357 + </RightCondition>
  358 + </Or>
  359 + </LeftCondition>
  360 + <RightCondition>
  361 + <Custom ref="fctRelationCondition"/>
  362 + </RightCondition>
  363 + </And>
  364 + </RightCondition>
  365 + </And>
  366 + </RightCondition>
  367 + </And>
  368 + </Definition>
  369 + </Filter>
  370 +
  371 + <CustomCondition id="fctRelationCondition">
  372 + <Class>org.dspace.xoai.filter.DSpaceAtLeastOneMetadataFilter</Class>
  373 + <Configuration>
  374 + <string name="field">dc.relation</string>
  375 + <string name="operator">starts_with</string>
  376 + <string name="value">info:eu-repo/grantAgreement/FCT</string>
  377 + </Configuration>
  378 + </CustomCondition>
  379 +
  380 + <!-- This condition determines if an Item has a "dc.type" field
  381 + which contains "Thesis". -->
  382 + <CustomCondition id="thesisDocumentTypeCondition">
  383 + <Class>org.dspace.xoai.filter.DSpaceAtLeastOneMetadataFilter</Class>
  384 + <Configuration>
  385 + <string name="field">dc.type</string>
  386 + <string name="operator">contains</string>
  387 + <string name="value">Thesis</string>
  388 + </Configuration>
  389 + </CustomCondition>
  390 +
  391 + <!-- This condition determines if an Item has a "dc.contributor.author" -->
  392 + <CustomCondition id="authorExistsCondition">
  393 + <Class>org.dspace.xoai.filter.DSpaceMetadataExistsFilter</Class>
  394 + <Configuration>
  395 + <string name="field">dc.contributor.author</string>
  396 + </Configuration>
  397 + </CustomCondition>
  398 +
  399 + <!-- This condition determines if an Item has a "dc.title" -->
  400 + <CustomCondition id="titleExistsCondition">
  401 + <Class>org.dspace.xoai.filter.DSpaceMetadataExistsFilter</Class>
  402 + <Configuration>
  403 + <string name="field">dc.title</string>
  404 + </Configuration>
  405 + </CustomCondition>
  406 +
  407 + <!-- This condition determines if an Item has a "dc.type" field
  408 + specifying one of the valid DRIVER document types. -->
  409 + <CustomCondition id="driverDocumentTypeCondition">
  410 + <Class>org.dspace.xoai.filter.DSpaceAtLeastOneMetadataFilter</Class>
  411 + <Configuration>
  412 + <string name="field">dc.type</string>
  413 + <string name="operator">ends_with</string>
  414 + <list name="values">
  415 + <string>article</string>
  416 + <string>bachelorThesis</string>
  417 + <string>masterThesis</string>
  418 + <string>doctoralThesis</string>
  419 + <string>book</string>
  420 + <string>bookPart</string>
  421 + <string>review</string>
  422 + <string>conferenceObject</string>
  423 + <string>lecture</string>
  424 + <string>workingPaper</string>
  425 + <string>preprint</string>
  426 + <string>report</string>
  427 + <string>annotation</string>
  428 + <string>contributionToPeriodical</string>
  429 + <string>patent</string>
  430 + <string>other</string>
  431 + </list>
  432 + </Configuration>
  433 + </CustomCondition>
  434 +
  435 + <!-- This condition determines if an Item has a "dc.rights" field
  436 + specifying "open access", which is required for DRIVER
  437 + OR "openAccess", which is required by OpenAIRE. -->
  438 + <CustomCondition id="driverAccessCondition">
  439 + <Class>org.dspace.xoai.filter.DSpaceAtLeastOneMetadataFilter</Class>
  440 + <Configuration>
  441 + <string name="field">dc.rights</string>
  442 + <string name="operator">contains</string>
  443 + <list name="values">
  444 + <string>open access</string>
  445 + <string>openAccess</string>
  446 + </list>
  447 + </Configuration>
  448 + </CustomCondition>
  449 +
  450 + <!-- This condition determines if an Item is publicly accessible. -->
  451 + <CustomCondition id="itemAccessCondition">
  452 + <Class>org.dspace.xoai.filter.DSpaceAuthorizationFilter</Class>
  453 + </CustomCondition>
  454 +
  455 + <!-- This condition determines if an Item is withdrawn. This condition
  456 + ensures a basic "tombstone" record is shown for withdrawn items,
  457 + as recommended by OAI-PMH spec. This "tombstone" doesn't display
  458 + any metadata or content files. -->
  459 + <CustomCondition id="itemWithdrawnCondition">
  460 + <Class>org.dspace.xoai.filter.DSpaceWithdrawnFilter</Class>
  461 + </CustomCondition>
  462 +
  463 + <!-- This condition determines if an Item has a "dc.relation" field
  464 + which specifies the openAIRE project ID. -->
  465 + <CustomCondition id="openaireRelationCondition">
  466 + <Class>org.dspace.xoai.filter.DSpaceAtLeastOneMetadataFilter</Class>
  467 + <Configuration>
  468 + <string name="field">dc.relation</string>
  469 + <string name="operator">starts_with</string>
  470 + <string name="value">info:eu-repo/grantAgreement</string>
  471 + </Configuration>
  472 + </CustomCondition>
  473 + </Filters>
  474 +
  475 + <Sets>
  476 + <Set id="driverSet">
  477 + <Spec>driver</Spec>
  478 + <Name>Open Access DRIVERset</Name>
  479 + <!-- Just an alias -->
  480 + </Set>
  481 + <Set id="openaireSet">
  482 + <Spec>ec_fundedresources</Spec>
  483 + <Name>EC_fundedresources set</Name>
  484 + <!-- Just an alias -->
  485 + </Set>
  486 + <!-- FCT FILTER -->
  487 + <Set id="fctSet">
  488 + <Spec>fct_fundedresources</Spec>
  489 + <Name>fct_fundedresources set</Name>
  490 + <!-- Just an alias -->
  491 + </Set>
  492 +
  493 + </Sets>
  494 +</Configuration>
... ...