Hi Adam,

I am very sorry for late reply. I was on vocation, lots of work after 
vacation, and then computer problem.

For me, it works fine. I added tree measurement data, and exported as 
follows:
...
{
          "child_entities": [
            {
              "child_entities": [
                {
                  "child_entities": [],
                  "label": "10",
                  "value": "10",
                  "entitytypeid": "VALUE_OF_MEASUREMENT.E60",
                  "entityid": "142533d8-25b6-4596-b6f5-7a2875092a1d",
                  "property": "P90",
                  "businesstablename": "strings"
                }
              ],
              "label": "meters",
              "value": "120ccba5-1487-4562-9d2f-04fb37ad2779",
              "entitytypeid": "UNIT_OF_MEASUREMENT.E55",
              "entityid": "92a2a28e-83fe-496e-ae84-df16e515842e",
              "property": "P91",
              "businesstablename": "domains"
            }
          ],
          "label": "height",
          "value": "2a9e6675-1f7e-4f40-9ddd-990a34eba0d0",
          "entitytypeid": "MEASUREMENT_TYPE.E55",
          "entityid": "be6fc5c0-e62c-477d-828f-928fe27e79df",
          "property": "P43",
          "businesstablename": "domains"
        },
        {
          "child_entities": [
            {
              "child_entities": [
                {
                  "child_entities": [],
                  "label": "13",
                  "value": "13",
                  "entitytypeid": "VALUE_OF_MEASUREMENT.E60",
                  "entityid": "1e78dc6d-2889-433b-b3e1-d5fd6f9250e2",
                  "property": "P90",
                  "businesstablename": "strings"
                }
              ],
              "label": "inches",
              "value": "c467654f-3d4a-4231-a4ca-ffe2e92e2363",
              "entitytypeid": "UNIT_OF_MEASUREMENT.E55",
              "entityid": "2be6f237-4d56-4d30-9abd-bddc212a6f52",
              "property": "P91",
              "businesstablename": "domains"
            }
          ],
          "label": "length",
          "value": "ce490aa2-4ce6-4384-9e72-a499a6c9afb6",
          "entitytypeid": "MEASUREMENT_TYPE.E55",
          "entityid": "f7c1c8ec-35b3-47db-bb9f-57892dad4529",
          "property": "P43",
          "businesstablename": "domains"
        },
        {
          "child_entities": [
            {
              "child_entities": [
                {
                  "child_entities": [],
                  "label": "20000000000",
                  "value": "20000000000",
                  "entitytypeid": "VALUE_OF_MEASUREMENT.E60",
                  "entityid": "54e0ecd2-2272-4b00-9504-dc5c3c19c811",
                  "property": "P90",
                  "businesstablename": "strings"
                }
              ],
              "label": "grams",
              "value": "36edce54-3bc9-4de6-a674-1ddf66039ead",
              "entitytypeid": "UNIT_OF_MEASUREMENT.E55",
              "entityid": "e9aecf93-0246-4af4-bd91-fd1c133f9dab",
              "property": "P91",
              "businesstablename": "domains"
            }
          ],
          "label": "tonnage",
          "value": "36cf0542-0a07-4d07-97e0-e3d85a0dd4aa",
          "entitytypeid": "MEASUREMENT_TYPE.E55",
          "entityid": "bb67e0d6-310a-44c6-a3ed-1b631590c007",
          "property": "P43",
          "businesstablename": "domains"
        } 
...
 
with the script, they were converted into lines below:

9|HERITAGE_RESOURCE.E18|VALUE_OF_MEASUREMENT.E60|10|MEASUREMENT_TYPE.E55-1
9|HERITAGE_RESOURCE.E18|UNIT_OF_MEASUREMENT.E55|UNIT_OF_MEASUREMENT:10|MEASUREMENT_TYPE.E55-1
9|HERITAGE_RESOURCE.E18|MEASUREMENT_TYPE.E55|MEASUREMENT_TYPE:6|MEASUREMENT_TYPE.E55-1
9|HERITAGE_RESOURCE.E18|VALUE_OF_MEASUREMENT.E60|13|MEASUREMENT_TYPE.E55-2
9|HERITAGE_RESOURCE.E18|UNIT_OF_MEASUREMENT.E55|UNIT_OF_MEASUREMENT:1|MEASUREMENT_TYPE.E55-2
9|HERITAGE_RESOURCE.E18|MEASUREMENT_TYPE.E55|MEASUREMENT_TYPE:1|MEASUREMENT_TYPE.E55-2
9|HERITAGE_RESOURCE.E18|VALUE_OF_MEASUREMENT.E60|20000000000|MEASUREMENT_TYPE.E55-3
9|HERITAGE_RESOURCE.E18|UNIT_OF_MEASUREMENT.E55|UNIT_OF_MEASUREMENT:12|MEASUREMENT_TYPE.E55-3
9|HERITAGE_RESOURCE.E18|MEASUREMENT_TYPE.E55|MEASUREMENT_TYPE:5|MEASUREMENT_TYPE.E55-3
...
Then they were loaded without problem.

Since Darcy's problem, I changed and simplified the logic for choosing 
GROUPID. 
Could you send me your files (exported JSON + source_data) to me for 
debugging ? 



On Tuesday, May 10, 2016 at 1:23:53 AM UTC+5:45, Adam Cox wrote:
>
> Hi Jae, I'm trying to use this script again and I can confirm that the 
> group ids are not being set correctly.  In my case, I have three different 
> measurement sets (value/type/dimension, i.e. 3 feet tall) and they are all 
> given the same group id.  When I removed these lines from the .arches file, 
> it loaded correctly.
>
> I'm looking at the script and I see that the incrementing is based on the 
> mergenode value that has been stored in the resource graphs.  Intuitively, 
> this makes sense, but unfortunately you can't actually rely on mergenode 
> for this.  If you look at arches HIP resource graphs, you'll see that the 
> mergenode attribute is not used in this manner.  From the Arches HIP 
> documentation: 
>
>
>    - mergenode: defines the upstream node that occurs one time (and only 
>    one time) within a given resource instance. In most cases, that node is 
> the 
>    one that represents the resource itself.
>
> Ultimately, I'm not sure how/where mergenode is used within Arches.  As 
> for group ids, I haven't tested this fully, but I think it would work to 
> assign same groupid to all the child entities of each child entity of the 
> original resource.  I'm inspecting a full resource json object now, and it 
> looks like each child entity of the resource itself is an individual 
> branchlist as defined by the forms.py/js classes.  So if you add an 
> address and address type, they will be stored as child entities of a 
> PLACE.E53 branch list.  If you enter a geometry, it will be stored in a 
> new PLACE.E53 branchlist that is another child entity of the resource 
> itself. In this way you'll end up with multiple PLACE.E53 branch lists, 
> each with one or two of its own child entities--not, as you may be 
> thinking, a single PLACE.E53 branchlist with multiple addresses, multiple 
> geometries, a parcel ID, etc. as child entities.
>
> I don't know if resources/branchlists will be constructed like this in 
> Arches v4.
>
> Adam
>
> On Wednesday, April 13, 2016 at 1:09:38 AM UTC-6, Jae Hun Lee wrote:
>>
>> Hi Darcy,
>>
>> Sorry. I think the script doesn't properly set GROUPID for paired 
>> entities. Could you open the file "sample.arches" and find 
>> "ADDRESS_TYPE.E55" and "PLACE_ADDRESS.E45" pair, and set same value for 
>> their GROUPIDs? and try to load file with "python manage.py packages -o 
>> load_resources..." command?
>>
>>
>>
>>
>>
>> On Wednesday, April 13, 2016 at 12:08:17 PM UTC+5:45, Darcy Christ wrote:
>>>
>>> Hi Jae,
>>>
>>> Thank you for this script. It might help me with a corrupt database. 
>>> Unfortunately, I have run into an error running the import. I fixed all the 
>>> issues in the .arches file, but not I am hitting this:
>>>
>>> LOADING RESOURCES 
>>> (/home/hkarches/hongkong/hongkong/source_data/business_data/sample.arches)
>>>
>>> time to parse 
>>> /home/hkarches/hongkong/hongkong/source_data/business_data/sample resources 
>>> = 0.00739693641663
>>>
>>> Traceback (most recent call last):
>>>
>>>   File "manage.py", line 28, in <module>
>>>
>>>     execute_from_command_line(sys.argv)
>>>
>>>   File 
>>> "/home/hkarches/lib/python2.7/site-packages/django/core/management/__init__.py",
>>>  
>>> line 399, in execute_from_command_line
>>>
>>>     utility.execute()
>>>
>>>   File 
>>> "/home/hkarches/lib/python2.7/site-packages/django/core/management/__init__.py",
>>>  
>>> line 392, in execute
>>>
>>>     self.fetch_command(subcommand).run_from_argv(self.argv)
>>>
>>>   File 
>>> "/home/hkarches/lib/python2.7/site-packages/django/core/management/base.py",
>>>  
>>> line 242, in run_from_argv
>>>
>>>     self.execute(*args, **options.__dict__)
>>>
>>>   File 
>>> "/home/hkarches/lib/python2.7/site-packages/django/core/management/base.py",
>>>  
>>> line 285, in execute
>>>
>>>     output = self.handle(*args, **options)
>>>
>>>   File 
>>> "/home/hkarches/lib/python2.7/site-packages/arches/management/commands/packages.py",
>>>  
>>> line 73, in handle
>>>
>>>     self.install(package_name)
>>>
>>>   File 
>>> "/home/hkarches/lib/python2.7/site-packages/arches/management/commands/packages.py",
>>>  
>>> line 126, in install
>>>
>>>     install() 
>>>
>>>   File "/home/hkarches/hongkong/hongkong/setup.py", line 6, in install
>>>
>>>     setup.install()
>>>
>>>   File "/home/hkarches/lib/python2.7/site-packages/arches_hip/setup.py", 
>>> line 35, in install
>>>
>>>     load_resources()
>>>
>>>   File "/home/hkarches/lib/python2.7/site-packages/arches_hip/setup.py", 
>>> line 85, in load_resources
>>>
>>>     rl.load(f)
>>>
>>>   File 
>>> "/home/hkarches/lib/python2.7/site-packages/arches/app/utils/data_management/resources/importer.py",
>>>  
>>> line 67, in load
>>>
>>>     results = self.resource_list_to_entities(resources, archesjson)
>>>
>>>   File 
>>> "/home/hkarches/lib/python2.7/site-packages/arches/app/utils/data_management/resources/importer.py",
>>>  
>>> line 112, in resource_list_to_entities
>>>
>>>     master_graph.index()
>>>
>>>   File 
>>> "/home/hkarches/lib/python2.7/site-packages/arches/app/models/resource.py", 
>>> line 313, in index
>>>
>>>     geojson_documents = 
>>> self.prepare_documents_for_map_index(geom_entities=document['geometries'])
>>>
>>>   File 
>>> "/home/hkarches/lib/python2.7/site-packages/arches_hip/models/resource.py", 
>>> line 203, in prepare_documents_for_map_index
>>>
>>>     if node.find_entities_by_type_id('ADDRESS_TYPE.E55')[0].label == 
>>> 'Primary':
>>>
>>> IndexError: list index out of range
>>>
>>>
>>> Any idea what is happening?
>>>
>>

-- 
-- To post, send email to archesproject@googlegroups.com. To unsubscribe, send 
email to archesproject+unsubscr...@googlegroups.com. For more information, 
visit https://groups.google.com/d/forum/archesproject?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Arches Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to archesproject+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to