Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the CollectiveAccess support forum! Here the developers and community answer questions related to use of the software. Please include the following information in every new issue posted here:

  1. Version of the software that is used, along with browser and version

  2. If the issue pertains to Providence, Pawtucket or both

  3. What steps you’ve taken to try to resolve the issue

  4. Screenshots demonstrating the issue

  5. The relevant sections of your installation profile or configuration including the codes and settings defined for your local elements.


If your question pertains to data import or export, please also include:

  1. Data sample

  2. Your mapping


Answers may be delayed for posts that do not include sufficient information.

Export EAD element with rule "RepeatMappings"

Hello,
I'm trying to implement the export mapping for the "icar" which includes:
two elements EAD3, one scons2 and one eac-cpf (attachment icar-import.xsd)

For the EAD map I tried to use the "RepeatMappings" rule
(rif.
http://docs.collectiveaccess.org/wiki/Data_Exporter#Mapping_repitition
https://collectiveaccess.org/support/index.php?p=/discussion/comment/315221#Comment_315221;
)

but it does not seem to work, it always extracts the current object and not the children
(see xml output 1422.xml: line 101-> id 1422; line 195 (c element with rule "RepeatMappings" is always 1422 , but I have tre children for id 1422)

select object_id, parent_id, hier_object_id
from ca_objects where object_id = 1422 or parent_id=1422

object_id parent_id hier_object_id
1422 261232 261232
11215 1422 1422
11216 1422 1422
11217 1422 1422

I attached the map "icar-import-V0.5-child.xlsx", at line 177 there is element c whith the rule "RepeatMappings". Did I do something wrong?

Another question: I don't know how many levels of hierarchy for objects there are because it is a choice of the user how to organize the archive,
but for sure there are up of 3 or 4, also 10 levels....

Is there any method or advice to create a recursive "RepeatMappings"? for example children of children etc?
Also if I use for example ca_objects.hierarchy.object_id or something like this? For example can i switch the context for "hierarchy"?

As always,
thank you very much for your help

Antonio Cassano
CSI Piemonte

CA - PROVIDENCE - v. 1.7.5
PHP v: 7.1.14
MySQL v: 5.6.25

Comments

  • It's hard to say without seeing your set up. It appears you're creating an object export mapping, but typically this is done with collection records -- just making sure you have the correct table and all of the children are also objects?

  • Hi Julia,
    yes, all children are objects, but with different type_id.

    select object_id,parent_id, hier_object_id, type_id
    from ca_objects where object_id = 1422 or parent_id=1422

    object_id parent_id hier_object_id type_id
    1422 261232 261232 187
    11215 1422 1422 192
    11216 1422 1422 192
    11217 1422 1422 192

    I understood why it repeats the current object, in my mapping of last night there is an error, in the source column I also declared the columns that refer to the container tag of the current object.

    I have now tried to use the documentation example (to which I added ca_objects.hierarchy.object_id just for curiosity)
    but the "RepeatMappings" does not extract anything.

    The logic with the export recovers children is based on parent_id, right?
    I can not understand why this happens.

    Thanks,
    Antonio.

  • Your source column has "2.3" but it should be "2,3"

  • Hi, are you sure?

    RepeatMappings 5 4 figlio 2,3 { "context" : "children" }

    Bye :-)

  • Hi all,
    please, I really need help ...

    This is my simple mapping test for get children, works with "ca_objects.children.object_id", not with "RepeatMappings"

    Rule type ID Parent ID Element Source Options
    Mapping 1 tmp_gerarchia
    Mapping 2 1 oggettoid ca_objects.object_id
    Mapping 3 1 titolo ca_objects.preferred_labels
    Mapping 4 1 figli
    RepeatMappings 5 4 figlio 2 { "context" : "children" }
    Mapping 6 4 rel1 ca_objects.children.object_id { "repeat_element_for_multiple_values": "1" }

    The output:

    <?xml version="1.0" encoding="utf-8"?>

    1422
    Fondo Lenci


    1422

    11215
    11216
    11217

    How is it possible? :-(

    Really thanks,
    Antonio.

  • Ok, solved !!! :-)

    I do not know exactly what I did, maybe there was a space in the option column
    or maybe now I saved in excel version 97-2003.

    Now the question is:
    You have advice on how I can use "RepeatMappings" recursively
    or the only way is use "ca_objects.children.children .... object_id"?
    How get related entities on ca_objects.children.object_id?

    Thanks,
    Antonio.

  • No need to use ca_objects.children.object_id. You can continue to add "RepeatMappings" -- see image attached

  • Hello Julia, thank you very much and also for your patience ..

    It works, but I have a problem about how to configure the entities "container tag" with the "restrictToRelationshipTypes" options and with "repeat_element_for_multiple_values" that works on both the current object and children.

    If I use the "switch context" on the container tag (see image1 on "soggetti") it works fine on the current object, but it seems to me that the restrictToRelationshipType is not considered on the children.

    Otherwise

    If I use the context switch (see image2 on "soggettoid" and "soggettotitolo") directly on the single elements of the entities to be extracted, it works well on the children but obviously the repeatability is not managed, also on the father.

    Do you have any examples or some advice?
    Thank you,
    Antonio.

  • In the mapping for the "children" you should simply be able to call the mapping of the enclosing tag that contains the sub-tags and it will bring those into the export as they are at the parent level. For example, in your export you shouldn't need to include 6 and 7 as they are contained within 5.

  • Eureka!!!!
    it works!!!
    Really thanks, Julia!!!! :-)

Sign In or Register to comment.