[Metafacture] how to define a filter, where the selected value is
in a deeper level than the filter criterias
Christoph, Pascal
christoph at hbz-nrw.de
Thu Oct 15 15:27:12 CEST 2015
(sorry for double posting - forgot to address this mailinglist )
Hi Christoph and all,
Böhme, Christoph wrote on 05/23/14 17:12 :
> Hi Thomas, hi Pascal,
[...]
> @pascal: I think, it would be good to include the MabXmlHanlder in the metafacture-core package, as it might be of general interest. What do you think?
Sorry, yes, well, the answer on this email took _some_ time...
I started two times to add the Handler but somehow didn't finish it[1] (and
then forgot about it, till the recent email from Günter).
Now I've made a decent enough pull request, I think.[2]
Note that the Handler commonly known as "MabXmlHandler" is renamed to
"AlephMabXmlHandler" because that's more accurate. The Mab-Xml it works with is
some kind of MabXml derivative, it's actually Mab2 stuffed into the exlibris
Aleph "OAI-PMH" MarcXml export routine. It's not the *real* MabXml - but then,
this "Aleph"MabXml is widely used.
If you used the flux command "mab-xml" you don't need to change anything - it
maps to the AlephMabXmlHandler.
best, pascal
[1]https://github.com/culturegraph/metafacture-core/pull/186 and
https://github.com/culturegraph/metafacture-core/pull/202
[2]https://github.com/culturegraph/metafacture-core/pull/243
> Best,
> Christoph
>
>
>> -----Ursprüngliche Nachricht-----
>> Von: metafacture-bounces at lists.dnb.de [mailto:metafacture-
>> bounces at lists.dnb.de] Im Auftrag von Christoph, Pascal
>> Gesendet: Donnerstag, 8. Mai 2014 14:39
>> An: Thomas Gängler; metafacture at lists.dnb.de
>> Betreff: Re: [Metafacture] how to define a filter, where the selected value
>> is in a deeper level than the filter criterias
>>
>> Hi Thomas,
>>
>> not sure exactly what you want, but as I transform this mabxml data with
>> metafacture already (and quite intensively)[1] I might help.
>>
>> 1. filtering
>> Not exactly know what you mean by this. Also, the values you provide in
>> "source" are rather complex. We provide a MabXmlHandler[2] which
>> allows to
>> handle Mab aquivalent to Marc. If you want to get the value "*digitool*"
>> residing in the datastructure:
>>
>> <datafield tag="088" ind1="a" ind2="">
>> <subfield
>> code="a">http://digitool.hbz-
>> nrw.de:1801/webclient/DeliveryManager?pid=3597032</subfield>
>> </datafield>
>>
>>
>> you would simply write:
>>
>> <data source="088a .a">
>>
>> As you could see in [1] we make lots of use of @-recursion which allows
>> to
>> combine data even if this data resides in different entities - however
>> there
>> might be some limits to what you may want to achieve. Let's work that
>> out together.
>>
>> all the best,
>> pascal
>>
>> [1]https://github.com/lobid/lodmill/blob/master/lodmill-
>> rd/src/main/resources/morph-hbz01-to-lobid.xml
>> [2]https://github.com/lobid/lodmill/blob/master/lodmill-
>> rd/src/main/java/org/lobid/lodmill/MabXmlHandler.java
>>
>>
>> Thomas Gängler wrote on 08.05.2014 11:02 :
>>
>> > 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://ww
>> w.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://ww
>> w.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://ww
>> w.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:valu
>> e
>> >
>> > ====> 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
>> > _______________________________________________
>> > Metafacture mailing list
>> > Metafacture at lists.dnb.de
>> > http://lists.dnb.de/mailman/listinfo/metafacture
>> >
>>
>> _______________________________________________
>> Metafacture mailing list
>> Metafacture at lists.dnb.de
>> http://lists.dnb.de/mailman/listinfo/metafacture
>
More information about the Metafacture
mailing list