Skip to content

Commit cac9719

Browse files
committed
icons in interlink dialog
1 parent bddb2cb commit cac9719

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

tabs/interlinkingtab.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def suggestSchema(self):
8181
columntypes=InterlinkUtils.suggestMappingSchema(layer)
8282
counter=0
8383
for col in columntypes:
84-
if col["id"] and not col["geotype"]:
84+
if "id" in col and col["id"] and not col["geotype"]:
8585
self.dlg.interlinkTable.item(counter,1).setCheckState(col["id"])
8686
item = QTableWidgetItem("rdf:type")
8787
item.setText("rdf:type")
@@ -123,6 +123,8 @@ def loadLayerForInterlink(self):
123123
if len(self.chooseLayerInterlink) == 0:
124124
return
125125
layer=self.chooseLayerInterlink.currentLayer()
126+
if layer==None:
127+
return
126128
self.interlinkNameSpace.setText("http://www.github.com/sparqlunicorn/data/"+str(layer.name()).lower().replace(" ","_")+"/")
127129
try:
128130
fieldnames = [field.name() for field in layer.fields()]
@@ -149,15 +151,15 @@ def loadLayerForInterlink(self):
149151
self.interlinkTable.setItem(row, 1, item3)
150152
self.interlinkTable.setItem(row, 2, item4)
151153
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")
161163
self.interlinkTable.setCellWidget(row, 5, cbox)
162164
currentRowCount = self.interlinkTable.rowCount()
163165
row += 1

util/interlinkutils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
class InterlinkUtils:
1010

1111
geoterms=["POINT","POLYGON","LINESTRING","LINE","BBOX","GEOMETRY"]
12-
geofieldnames=["GEOMETRY","X","Y","Z","LAT","LATITUDE","LON","LONG","LONGITUDE"]
13-
idfieldnames=["ID"]
12+
geofieldnames=["GEOMETRY","X","Y","Z","THE_GEOM","GEO","LAT","LATITUDE","LON","LONG","LONGITUDE"]
13+
idfieldnames=["ID","IDENTIFIER"]
1414
labelfieldnames=["NAME","TITLE","LABEL"]
1515
descriptorfieldnames = ["DESCRIPTION", "COMMENT", "REMARK", "DEFINITION", "CONTENT","ABSTRACT"]
16-
subclassterms=["TYPE","SUB"]
16+
subclassterms=["TYP","TYPE","SUB"]
1717

1818
@staticmethod
1919
def readXMLMappingToDict(filename):

0 commit comments

Comments
 (0)