wip on transformation used for import of Eagle data to Perseids

These files show the current wip on the import of Eagle data into Perseids.

We had said we wanted to support the following to use cases to start:

1) user submits an edit to an existing translation (thereby creating a new translation)
2) user submits a new translation

I think what these translate to in mediawiki "speak" are:

1) user submits a new claim to a existing item, based upon a previous claim
2) user submits a new claim to an existing item

(The sample links in the Eagle wiki right now include other functionality, such as adding licenses, identifiers, etc. I think these are out of scope for the moment.)

Here's what I've coded so far:

Case 1) :
Eagle wiki link to Perseids looks like:

`http://sosol.perseids.org/sosol/cts_publications/create_from_agent?agent=http://www.eagle-network.eu&id=<EAGLEENTITYID>&filter=<EAGLECLAIMID>`

e.g. so to edit the existing French translation in Q5016 it would be:

`http://sosol.perseids.org/sosol/cts_publications/create_from_agent?agent=http://www.eagle-network.eu&id=q5016&filter=q5016$B6CA42E3-D098-4A6F-9109-E879AE4B8E64`

(these won't work yet, as I have put the code up live -- we can set this up in a staging environment at an alternate url when we're ready to test)

Perseids retrieves the entire item using the following mediawiki api:
http://www.eagle-network.eu/wiki/api.php?action=wbgetentities&ids=q5016&format=xml

And uses eagle-xml-perseids.xsl to transform it to EpiDoc XML in Perseids.

User can make changes to the translation in Perseids, and then submit it to the Eagle Perseids Board.

Case 2) :
Eagle wiki link to Perseids looks like:

`http://sosol.perseids.org/sosol/cts_publications/create_from_agent?agent=http://www.eagle-network.eu&id=<EAGLEENTITYID>&lang=<LANG>`

e.g. so to add a new Italian translation to Q5016 it would be:

`http://sosol.perseids.org/sosol/cts_publications/create_from_agent?agent=http://www.eagle-network.eu&id=q5016&lang=it`

Perseids retrieves the entire item using the following mediawiki api:
http://www.eagle-network.eu/wiki/api.php?action=wbgetentities&ids=q5016&format=xml

And uses eagle-xml-perseids.xsl to transform it to EpiDoc XML in Perseids.

User enters their translation text in Perseids, and then submits it to the Eagle Perseids Board.

Assuming this is all okay so far, I have some questions on what the data sent in the final post of the approved version to the Eagle wiki would look like.

1. I think for either case, we are adding a new Claim to the Eagle wiki item, and I would use the wbsetclaim api call to do this.  Is this correct?
2. Other than the translation itself, the only new data added to the Eagle wiki at this point should be the CTS urn of the new translation, as assigned by Perseids (I think we will stick with CTS urns for now because progress on an alternate syntax has stalled somewhat).  So, sticking with the above example for case 1, the cts urn for the new french translation might be:
    `urn:cts:pdlepi:eagle.tm179252.pdl-fr-2014-1`
    If  desired, we could also add an item level property to represent the cts urn of the notional "work" identifier        
    `urn:cts:pdlepi:eagle.tm179252` 
What is the right way to set  these as properties in the mediawiki claim and item respectively?
3. For case 1) should the source info, if present in the claim on which the new translation is being based, be carried over to the new translation?
4. Is my assumption correct that mediawiki will just automatically assign an id to the new claim in both of these cases, and is that what we want? Or do we want the new claim to be created in mediawiki first before the work starts on the item in Perseids?

Thanks!
Bridget