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 [email protected]. To unsubscribe, send
email to [email protected]. 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 [email protected].
For more options, visit https://groups.google.com/d/optout.