@@ -81,7 +81,7 @@ def suggestSchema(self):
81
81
columntypes = InterlinkUtils .suggestMappingSchema (layer )
82
82
counter = 0
83
83
for col in columntypes :
84
- if col ["id" ] and not col ["geotype" ]:
84
+ if "id" in col and col ["id" ] and not col ["geotype" ]:
85
85
self .dlg .interlinkTable .item (counter ,1 ).setCheckState (col ["id" ])
86
86
item = QTableWidgetItem ("rdf:type" )
87
87
item .setText ("rdf:type" )
@@ -123,6 +123,8 @@ def loadLayerForInterlink(self):
123
123
if len (self .chooseLayerInterlink ) == 0 :
124
124
return
125
125
layer = self .chooseLayerInterlink .currentLayer ()
126
+ if layer == None :
127
+ return
126
128
self .interlinkNameSpace .setText ("http://www.github.com/sparqlunicorn/data/" + str (layer .name ()).lower ().replace (" " ,"_" )+ "/" )
127
129
try :
128
130
fieldnames = [field .name () for field in layer .fields ()]
@@ -149,15 +151,15 @@ def loadLayerForInterlink(self):
149
151
self .interlinkTable .setItem (row , 1 , item3 )
150
152
self .interlinkTable .setItem (row , 2 , item4 )
151
153
cbox = QComboBox ()
152
- cbox .addItem ("Automatic" )
153
- cbox .addItem ("AnnotationProperty" )
154
- cbox .addItem ("DataProperty" )
155
- cbox .addItem ("ObjectProperty" )
156
- cbox .addItem ("SubClass" )
157
- cbox .addItem ("GeoProperty" )
158
- cbox .addItem ("LabelProperty" )
159
- cbox .addItem ("DescriptionProperty" )
160
- cbox .addItem ("TypeProperty" )
154
+ cbox .addItem (UIUtils . linkeddataicon , "Automatic" )
155
+ cbox .addItem (UIUtils . annotationpropertyicon , "AnnotationProperty" )
156
+ cbox .addItem (UIUtils . datatypepropertyicon , "DataProperty" )
157
+ cbox .addItem (UIUtils . objectpropertyicon , "ObjectProperty" )
158
+ cbox .addItem (UIUtils . subclassicon , "SubClass" )
159
+ cbox .addItem (UIUtils . georelationpropertyicon , "GeoProperty" )
160
+ cbox .addItem (UIUtils . labelannotationpropertyicon , "LabelProperty" )
161
+ cbox .addItem (UIUtils . commentannotationpropertyicon , "DescriptionProperty" )
162
+ cbox .addItem (UIUtils . classicon , "TypeProperty" )
161
163
self .interlinkTable .setCellWidget (row , 5 , cbox )
162
164
currentRowCount = self .interlinkTable .rowCount ()
163
165
row += 1
0 commit comments