AW: [Metafacture] how to define a filter, where the selected value is in a deeper level than the filter criterias

Böhme, Christoph C.Boehme at dnb.de
Fri May 23 17:12:07 CEST 2014


Hi Thomas, hi Pascal,

I think, using Pascal's MabXmlHandler is probably the best solution to the problem (as I suggested already in my response to your other email. I wasn't aware that such a handler exists already, though).

@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? 

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="&#30;"
> > 	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/metadata&#30;http://ww
> w.ddb.de/professionell/mabxml/mabxml-
> 1.xsd#record&#30;http://www.ddb.de/professionell/mabxml/mabxml-
> 1.xsd#datafield&#30;http://www.ddb.de/professionell/mabxml/mabxml-
> 1.xsd#tag">
> > 				<equals string="088" />
> > 			</data>
> > 			<data
> >
> >
> source="http://www.openarchives.org/OAI/2.0/metadata&#30;http://ww
> w.ddb.de/professionell/mabxml/mabxml-
> 1.xsd#record&#30;http://www.ddb.de/professionell/mabxml/mabxml-
> 1.xsd#datafield&#30;http://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/metadata&#30;http://ww
> w.ddb.de/professionell/mabxml/mabxml-
> 1.xsd#record&#30;http://www.ddb.de/professionell/mabxml/mabxml-
> 1.xsd#datafield&#30;http://www.ddb.de/professionell/mabxml/mabxml-
> 1.xsd#subfield&#30;http://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