[Metafacture] how to define a filter,
where the selected value is in a deeper
level than the filter criterias
Thomas Gängler
tgaengler at avantgarde-labs.de
Thu May 8 11:02:03 CEST 2014
Hi all,
we would like to create a filter with metamorph where the selected
values are located in a deeper level than the filter criterias:
1. we have a kind of mabxml, excerpt:
<?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">
<ListRecords>
<record>
<header>
<identifier>libero-publish:13703983</identifier>
</header>
<metadata>
<record xmlns="http://www.ddb.de/professionell/mabxml/mabxml-1.xsd">
<leader>00946nM2.01200024||||||h</leader>
<controlfield tag="LDR">00946nM2.01200024||||||h</controlfield>
<controlfield tag="SYS">13703983</controlfield>
<datafield tag="000" ind1="" ind2="">
<subfield code="a">13703983</subfield>
</datafield>
...
<datafield tag="088" ind1="a" ind2="">
<subfield
code="a">http://digitool.hbz-nrw.de:1801/webclient/DeliveryManager?pid=3597032</subfield>
</datafield>
...
</record>
</metadata>
</record>
</ListRecords>
</OAI-PMH>
2. with a filter statement we can access values for specific mab keys,
e.g., 088a (note a pre-processing-step in our workflow is the RDFization
of the data source (that's why the uris and rdf:value properties))
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<metamorph xmlns="http://www.culturegraph.org/metamorph"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" entityMarker=""
version="1" xsi:schemaLocation="http://www.culturegraph.org/metamorph
metamorph.xsd">
<meta>
<name>mapping1</name>
</meta>
<rules>
<combine name="ok" value="${out}" sameEntity="true" reset="false">
<!-- filter elements -->
<data
source="http://www.openarchives.org/OAI/2.0/metadatahttp://www.ddb.de/professionell/mabxml/mabxml-1.xsd#recordhttp://www.ddb.de/professionell/mabxml/mabxml-1.xsd#datafieldhttp://www.ddb.de/professionell/mabxml/mabxml-1.xsd#tag">
<equals string="088" />
</data>
<data
source="http://www.openarchives.org/OAI/2.0/metadatahttp://www.ddb.de/professionell/mabxml/mabxml-1.xsd#recordhttp://www.ddb.de/professionell/mabxml/mabxml-1.xsd#datafieldhttp://www.ddb.de/professionell/mabxml/mabxml-1.xsd#ind1">
<equals string="a" />
</data>
<!-- value of attribute path that should be selected for further
processing -->
<data name="out"
source="http://www.openarchives.org/OAI/2.0/metadatahttp://www.ddb.de/professionell/mabxml/mabxml-1.xsd#recordhttp://www.ddb.de/professionell/mabxml/mabxml-1.xsd#datafieldhttp://www.ddb.de/professionell/mabxml/mabxml-1.xsd#subfieldhttp://www.w3.org/1999/02/22-rdf-syntax-ns#value"
/>
</combine>
</rules>
</metamorph>
==> to simplify these filter statements we can make use of prefixes for
example (to shorten the attributes of the attribute paths (keys of the
key/value pairs)):
- 1. filter statement:
oai:metadata/mabxml:record/mabxml:datafield/mabxml:tag = "088"
- 2. filter statement:
oai:metadata/mabxml:record/mabxml:datafield/mabxml:ind1 = "a"
==> the value that should be selected is located one level deeper than
the filter statements:
oai:metadata/mabxml:record/mabxml:datafield/mabxml:subfield/rdf:value
====> our tests results are so far that we cannot select values from
deeper level in a a hierarchy than the filter statements (i.e., we can
select, e.g., oai:metadata/mabxml:record/mabxml:datafield/mabxml:ind2,
which is at the same level as the filter statements)
From our knowledge and understanding of Metafacture we know that the
value that we would like to select is in another entity (because it is
located in a deeper hierarchy in the record). So our question is now: Is
Metafacture able to handle filters that make use of attribute paths
across the whole hierarchy of a record?
Thanks a lot in advance for all your help.
Cheers,
Thomas
More information about the Metafacture
mailing list