Hi Alexei,

somehow this mail does't seem to have made it into the Arches group 
yesterday. Notably, we are using a different package here than in the other 
thread.

Coming back to the issue: If we don't limit the list of resource types in 
settings.py, we are still stuck when running install_packages.sh with a 
different error:


Traceback (most recent call last):
  File "../manage.py", line 28, in <module>
    execute_from_command_line(sys.argv)
  File 
"/arches-web/archesproject/virtualenv/ENV/local/lib/python2.7/site-packages/django/core/management/__init__.py",
 
line 399, in execute_from_command_line
    utility.execute()
  File 
"/arches-web/archesproject/virtualenv/ENV/local/lib/python2.7/site-packages/django/core/management/__init__.py",
 
line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/arches-web/archesproject/virtualenv/ENV/local/lib/python2.7/site-packages/django/core/management/base.py",
 
line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File 
"/arches-web/archesproject/virtualenv/ENV/local/lib/python2.7/site-packages/django/core/management/base.py",
 
line 285, in execute
    output = self.handle(*args, **options)
  File "/arches-web/archesproject/build/management/commands/packages.py", 
line 41, in handle
    self.load_package(package)
  File "/arches-web/archesproject/build/management/commands/packages.py", 
line 46, in load_package
    install(settings.ROOT_DIR)
  File "/arches-web/archesproject/packages/i3mainz/setup.py", line 77, in 
install
    test_data.DataLoader().load(filepath)
  File "/arches-web/archesproject/db/Data/load_from_csv.py", line 95, in 
load
    return self.resourceListToEntities(resourceList)
  File "/arches-web/archesproject/db/Data/load_from_csv.py", line 123, in 
resourceListToEntities
    entity.create_from_mapping(row.resourcetype, 
schema[row.attributename]['steps'], 
row.attributename, row.attributevalue)
KeyError: 'PLACE_CADASTRAL REFERENCE.E53'

The odd underscore/no underscore syntax is consistent with the syntax in 
the files defining the graph.
The error is provoked by an import csv that looks like this (first site):

1|ARCHAEOLOGICAL HERITAGE (SITE).E27|EXTERNAL XREF.E42|1|MONUMENT:1
1|ARCHAEOLOGICAL HERITAGE (SITE).E27|EXTERNAL XREF 
TYPE.E55|EXTERNAL_XREF_TYPE_1000|MONUMENT:1
1|ARCHAEOLOGICAL HERITAGE (SITE).E27|EXTERNAL XREF.E42|853|MONUMENT:1
1|ARCHAEOLOGICAL HERITAGE (SITE).E27|EXTERNAL XREF 
TYPE.E55|EXTERNAL_XREF_TYPE_1001|MONUMENT:1
1|ARCHAEOLOGICAL HERITAGE (SITE).E27|EXTERNAL XREF.E42|5|MONUMENT:1
1|ARCHAEOLOGICAL HERITAGE (SITE).E27|EXTERNAL XREF 
TYPE.E55|EXTERNAL_XREF_TYPE_2000|MONUMENT:1
1|ARCHAEOLOGICAL HERITAGE (SITE).E27|ADDRESS_TOWN/CITY.E45|ALBACH|ADDRESS-0
1|ARCHAEOLOGICAL HERITAGE (SITE).E27|COMPILER.E82|FETSCH|COMPILER.E82-0
1|ARCHAEOLOGICAL HERITAGE (SITE).E27|NAME TYPE.E55|NAME_TYPE_1|NAME.E41-1
1|ARCHAEOLOGICAL HERITAGE (SITE).E27|NAME.E41|Albach|NAME.E41-1
1|ARCHAEOLOGICAL HERITAGE (SITE).E27|SPATIAL COORDINATES_GEOMETRY.E47|POINT 
(8.79912945 50.55867308)|SPATIAL COORDINATES_GEOMETRY.E47-0
1|ARCHAEOLOGICAL HERITAGE (SITE).E27|PLACE_CADASTRAL 
REFERENCE.E53|Reutereck|PLACE_CADASTRAL REFERENCE.E53-0
1|ARCHAEOLOGICAL HERITAGE (SITE).E27|GEOMETRY 
QUALIFIER.E55|GEOMETRY_QUALIFIER_1000|SPATIAL 
COORDINATES_GEOMETRY.E47-0
1|ARCHAEOLOGICAL HERITAGE (SITE).E27|INVESTIGATION 
TYPE.E55|INVESTIGATION_TYPE_2_1_3|INVESTIGATION TYPE.E55-0
1|ARCHAEOLOGICAL HERITAGE (SITE).E27|ARCHAEOLOGICAL COMPONENT 
TYPE.E55|ARCHAEOLOGICAL_COMPONENT_ARCHAEOLOGICAL_
COMPONENT_2100|COMPONENT.E18-0
1|ARCHAEOLOGICAL HERITAGE (SITE).E27|COMPONENT CERTAINTY 
TYPE.E55|COMPONENT_CERTAINTY_1|COMPONENT.E18-0
1|ARCHAEOLOGICAL HERITAGE (SITE).E27|CULTURAL PERIOD.E55|PERIOD_1310213|PHASE 
TYPE ASSIGNMENT.E17-0
1|ARCHAEOLOGICAL HERITAGE (SITE).E27|PHASE TYPE ASSIGNMENT CERTAINTY 
TYPE.E55|PHASE_TYPE_ASSIGNMENT_CERTAINTY_2|PHASE TYPE ASSIGNMENT.E17-0
1|ARCHAEOLOGICAL HERITAGE (SITE).E27|ARCHAEOLOGICAL HERITAGE (SITE) 
TYPE.E55|SITE_7|PHASE TYPE ASSIGNMENT.E17-0
1|ARCHAEOLOGICAL HERITAGE (SITE).E27|SCIENTIFIC DATING 
METHOD.E55|DATING_10002|SCIENTIFIC DATING EVENT.E5-0
1|ARCHAEOLOGICAL HERITAGE (SITE).E27|SUMMARY.E62|Datierendes Material: ; 
|SUMMARY.E62-0

When we leave out the PLACE_CADASTRAL REFERENCE.E53 information, 
INVESTIGATION TYPE.E55 throws the same error.

We haven't finished building all authority files for our graph. Is this the 
problem or should the import process already work beforehand?

I don't understand why PLACE_CADASTRAL REFERENCE.E53 causes an error, as it 
is already included in the default graph and shouldn't be affected by the 
authority files.

The third column in the import csv should contain the node's name/label, 
however, and not the ID, correct? (e.g. PLACE_CADASTRAL REFERENCE.E53 
instead of ARCHAEOLOGICAL HERITAGE.E27:PLACE_CADASTRAL REFERENCE.E53)

Thanks for your help!
Tobias


On Saturday, April 12, 2014 4:55:01 AM UTC+2, Alexei Peters wrote:
>
>  Hi Tobias,
> You may have just found a bug that cropped up during the development of 
> version 2.  I haven't had a chance to confirm myself buy I'll let the 
> community know what I find out.
> Cheers,
> Alexei 
>
> Sent from my Windows Phone
>  ------------------------------
> From: Tobias Kohr <javascript:>
> Sent: 4/10/2014 6:36 AM
> To: [email protected] <javascript:>
> Subject: [Arches] Re: Integrating modified Authority Documents
>
> OK, the error did not have anything to do with our modified Authority 
> Documents.
>
> It was caused by the entry to limit Resource Types in the global 
> settings.py:
> LIMIT_ENTITY_TYPES_TO_LOAD = (
>     # override this setting in your packages settings.py file
>     'ARCHAEOLOGICAL HERITAGE (SITE).E27',
> )
>
> I guess this provokes inconsistencies when authority_files.py tries to 
> link data to the entities of the Resource Types that weren't loaded. Is 
> this correct?
>
> Putting the same entry in the settings.py of the package to overwrite the 
> global setting doesn't take any effect. Is there a different syntax needed?
>
> Cheers,
> Tobias
>
>
> On Thursday, April 10, 2014 1:11:16 PM UTC+2, Tobias Kohr wrote:
>>
>> Dear Archeslist,
>>
>> we have extended the ARCHAEOLOGICAL HERITAGE (SITE).E27 Resource Type and 
>> defined our own vocabularies in the according Authority Files.
>>
>> (After running install_arches_db.sh and build.sh), install_packages.sh 
>> loads all Authority Files. However the function 
>> create_link_to_entity_types() in authority_files.py aborts with the 
>> following error:
>>
>> Traceback (most recent call last):
>>   File "../manage.py", line 28, in <module>
>>     execute_from_command_line(sys.argv)
>>   File 
>> "/arches-web/archesproject/virtualenv/ENV/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>>  
>> line 399, in execute_from_command_line
>>     utility.execute()
>>   File 
>> "/arches-web/archesproject/virtualenv/ENV/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>>  
>> line 392, in execute
>>     self.fetch_command(subcommand).run_from_argv(self.argv)
>>   File 
>> "/arches-web/archesproject/virtualenv/ENV/local/lib/python2.7/site-packages/django/core/management/base.py",
>>  
>> line 242, in run_from_argv
>>     self.execute(*args, **options.__dict__)
>>   File 
>> "/arches-web/archesproject/virtualenv/ENV/local/lib/python2.7/site-packages/django/core/management/base.py",
>>  
>> line 285, in execute
>>     output = self.handle(*args, **options)
>>   File "/arches-web/archesproject/build/management/commands/packages.py", 
>> line 47, in handle
>>     self.load_package(package)
>>   File "/arches-web/archesproject/build/management/commands/packages.py", 
>> line 52, in load_package
>>     install(settings.ROOT_DIR)
>>   File "/arches-web/archesproject/packages/i3mainz/setup.py", line 60, in 
>> install
>>     authority_files.load_authority_files(package_settings.ROOT_DIR)
>>   File 
>> "/arches-web/archesproject/packages/i3mainz/install/authority_files.py", 
>> line 24, in load_authority_files
>>     create_link_to_entity_types(cursor, packagepath)
>>   File 
>> "/arches-web/archesproject/packages/i3mainz/install/authority_files.py", 
>> line 125, in create_link_to_entity_types
>>     entity_type = str(cursor.fetchone()[0])
>> TypeError: 'NoneType' object has no attribute '__getitem__'
>>
>> Any ideas what the cause for this could be?
>>
>> What does create_link_to_entity_types() / entity_type = 
>> str(cursor.fetchone()[0]) exactly do?
>>
>> Best,
>> Tobias
>>
>  -- 
> -- To post, send email to [email protected] <javascript:>. To 
> unsubscribe, send email to [email protected] <javascript:>. 
> 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] <javascript:>.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 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.

Reply via email to