collectiveaccess / providence

Cataloguing and data/media management application
GNU General Public License v3.0
290 stars 166 forks source link

skipIfExpression not matching correctly in import mapping #1507

Closed Monica-Wood closed 1 month ago

Monica-Wood commented 9 months ago

I am trying to put a 'skipGroupIfExpression' options on a date, where it will only import it if contains the term 'bulk'

I am using:

{"skipGroupIfExpression":"^/ead/eadheader/filedesc/titlestmt/date !~ /bulk/"} 

This returns as 'true' no matter what the content is and skips it. If I reverse it with a =~ instead, it always returns false and tries to import it.

Example data in this element: 1982-1992 (bulk 1989-1990)

I've also tried with skipIfExpression with the same results. I am not sure if something has broken with this, or it's because of the EAD XML elements, rather than just calling ^1 like you do with a spreadsheet (has worked in the past with spreadsheets).

Branch: dev/php8

collectiveaccess commented 8 months ago

Please try{"skipGroupIfExpression":"^/eadheader/filedesc/titlestmt/date !~ /bulk/"}

Monica-Wood commented 8 months ago

Confirm this worked. Now to remember this for future.

collectiveaccess commented 8 months ago

For XML formats the tag reference structure is "^" + an XPath expression. Those expressions include the root tag. You can alter this by setting a basePath setting on your mapping, if you wish.