From b82369ca08b2aef3e7359376790911f644d2ec32 Mon Sep 17 00:00:00 2001 From: timgdavies Date: Tue, 20 Oct 2015 15:47:33 -0400 Subject: [PATCH 1/3] Adding company to country linkage --- ontology/resource-projects-ontology.rdf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ontology/resource-projects-ontology.rdf b/ontology/resource-projects-ontology.rdf index ebc0e8e..bb3d67a 100644 --- a/ontology/resource-projects-ontology.rdf +++ b/ontology/resource-projects-ontology.rdf @@ -688,6 +688,12 @@ unknown - + + + + + + true {random} Company is used to represent any kind of organization that can enter into transactions around a resource project, license, contract or site, with the exception of government parties, which are represented by GovernmentParty. From cfbac3589b120d1240a369ee3996ce21ca9a0642 Mon Sep 17 00:00:00 2001 From: timgdavies Date: Wed, 21 Oct 2015 07:44:04 -0400 Subject: [PATCH 2/3] Adding contract and concession relatedProject --- ontology/resource-projects-ontology.rdf | 116 +++++++++++++----------- 1 file changed, 61 insertions(+), 55 deletions(-) diff --git a/ontology/resource-projects-ontology.rdf b/ontology/resource-projects-ontology.rdf index bb3d67a..b6dc377 100644 --- a/ontology/resource-projects-ontology.rdf +++ b/ontology/resource-projects-ontology.rdf @@ -713,8 +713,8 @@ Government owned companies are still represented using Company. - - + + @@ -725,8 +725,14 @@ Government owned companies are still represented using Company. - - + + + + + + + + @@ -747,12 +753,6 @@ Government owned companies are still represented using Company. - - - - - - true Payments made by a company to the government, including: @@ -771,6 +771,12 @@ Payment to governments: Payments to governments are amounts paid, whether in mon Concession + + + + + + @@ -790,8 +796,8 @@ Payment to governments: Payments to governments are amounts paid, whether in mon Contract (resource contract) - - + + @@ -842,14 +848,8 @@ In ResourceProjects.org one or more contracts may be associated with a project: - - - - - - - - + + @@ -864,6 +864,12 @@ In ResourceProjects.org one or more contracts may be associated with a project: + + + + + + @@ -878,8 +884,8 @@ In ResourceProjects.org one or more contracts may be associated with a project: - - + + true @@ -918,14 +924,14 @@ Where several layers of ownership exist, the name of the ultimate parent entity Group membership - - + + - - + + true @@ -1028,18 +1034,6 @@ GroupMemberships can have additional properties to indicate the nature of the me Project - - - - - - - - - - - - @@ -1064,10 +1058,22 @@ GroupMemberships can have additional properties to indicate the nature of the me + + + + + + - + + + + + + + @@ -1079,7 +1085,7 @@ GroupMemberships can have additional properties to indicate the nature of the me - + true @@ -1137,8 +1143,8 @@ Definitions used around the world still differ somewhat but there is increasing - - + + @@ -1149,14 +1155,14 @@ Definitions used around the world still differ somewhat but there is increasing - - + + - + true @@ -1211,20 +1217,20 @@ ResourceProjects.org records point coordinates (in lat-long format) identifying - - + + - - + + - - + + @@ -1285,14 +1291,14 @@ A stake may relate to a company, project, license or contract. - - + + - - + + true From d933e073a8e682606cf3de0e83e8970ff86b3dd3 Mon Sep 17 00:00:00 2001 From: timgdavies Date: Wed, 21 Oct 2015 08:12:26 -0400 Subject: [PATCH 3/3] Handling blank ID for cleanstring. Fixes #58 --- modules/taglifter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/taglifter.py b/modules/taglifter.py index 6cab007..1eaa1ab 100644 --- a/modules/taglifter.py +++ b/modules/taglifter.py @@ -222,7 +222,10 @@ def generate_identifier(self,row,path,entity_type,country = "xx",lang="en"): pattern = pattern.replace("{suffix}",''.join(random.choice('0123456789abcdefghijklmnopqrstuvwxyz') for i in range(6))) if "{cleanstring}" in pattern: - pattern = pattern.replace("{cleanstring}",self.clean_string(row[path]).strip()) + if len(row[path].strip()) > 0: + pattern = pattern.replace("{cleanstring}",self.clean_string(row[path]).strip()) + else: + pattern = pattern.replace("{cleanstring}",random_string()) identifier = pattern