Mediaflux example: tcl script to repair metadata with empty string as attribute

foreach id [xvalues id [asset.query :where xpath(daris:pssd-derivation/input/@vid)='' :size infinity]] {

    set args ":id ${id} :meta -action remove < :daris:pssd-derivation > :meta < :daris:pssd-derivation"

    set doc [xelement asset/meta/daris:pssd-derivation [asset.get :id ${id}]]

    set doc_id [xvalue daris:pssd-derivation/@id ${doc}]

    set args "$args -id ${doc_id} < "

    set processed [xvalue daris:pssd-derivation/processed ${doc}]

    set args "$args :processed ${processed}"

    foreach input [xvalues daris:pssd-derivation/input ${doc}] {

        set vid [xvalue asset/@vid [asset.get :cid ${input}]]

        set args "$args :input -vid ${vid} ${input}"


    set method [xvalue daris:pssd-derivation/method ${doc}]

    set step [xvalue daris:pssd-derivation/method/@step ${doc}]

    set args "$args :method -step ${step} ${method}"

    set args "$args > >"

    puts "asset.set $args"
    asset.set $args


No comments:

Post a Comment