Ok, here's the current issue:

- I'm using the entity enrichment pipeline as part of the CPF
- I would like to use a range index on e:date
- Currently words like "Monday" are being marked up with e:date
- When attempting to load any doc that contains a non-xs:date for an
e:date, I get the exception that the contents are not castable as
xs:date
- Along with fixing up <e:date>, I would also like to removed unused
elements added by the enrichment, such as e:url, e:number, e:title

What is the best approach here?

Starting with the e:date issue, I've tried using my own custom
pipeline to operate after the entity enrichment step, but that fails
with above exception.  I also tried using a post-commit on-update
trigger, but of course also fails the same issue as the document has
been saved by that point.

The most recent attempt is to remove the inbuilt entity enrichment
pipeline from the cpf chain, and then call entity:enrich() in the
trigger, which gives me the chance to remove any e:date's that are not
castable as xs:date before the document is saved.  However, using
xdmp:node-replace on an in-memory tree isn't possible, failing with
the exception "cannot update constructed nodes".

Googling around I've come across this post:

http://xqzone.marklogic.com/pipermail/general/2008-September/001811.html

which links to this module:

http://xqzone.marklogic.com/svn/commons/trunk/memupdate/in-mem-update.xqy

I could use that, but that the standard / best / most appropriate way
to approach this problem?

thanks
andrew


2010/1/22 Danny Sokolsky <[email protected]>:
> You should *not* modify enrich.xqy directly, otherwise your changes will be 
> lost upon upgrade.  Create your own function that does something similar and 
> put it in your own location (for example, under your App Server route).
>
> You can start your new module by copying the code from enrich.xqy, though.
>
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to