Skip to content

Commit e9b73f6

Browse files
authored
Merge pull request #59 from thingful/thingful/IODLV2
adds IODLV2 Licence
2 parents c6a29b9 + ae276c1 commit e9b73f6

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

data_license.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ const (
9797
// ODbLV1URL is a the URL identifier for the Open Data Commons Open Database
9898
// License.
9999
ODbLV1URL = "https://opendatacommons.org/licenses/odbl/1.0/"
100+
101+
// IODLV2URL is the URL identifier for the Italian Open Data License
102+
IODLV2URL = "https://www.dati.gov.it/content/italian-open-data-license-v20"
100103
)
101104

102105
// DataLicense is struct used to describe data license
@@ -328,6 +331,22 @@ var (
328331
},
329332
Prohibits: []string{},
330333
},
334+
335+
IODLV2URL: DataLicense{
336+
Name: "Italian Open Data License v2.0",
337+
URL: "https://www.dati.gov.it/content/italian-open-data-license-v20",
338+
LegalCodeURL: "https://www.dati.gov.it/content/italian-open-data-license-v20",
339+
Permits: []string{
340+
Reproduction,
341+
Distribution,
342+
DerivativeWorks,
343+
Sharing,
344+
},
345+
Requires: []string{
346+
Attribution,
347+
},
348+
Prohibits: []string{},
349+
},
331350
}
332351
)
333352

data_license_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,26 @@ func TestODbLV1(t *testing.T) {
293293
assert.NotContains(t, license.Prohibits, HighIncomeNationUse)
294294
}
295295

296+
func TestIODLV2URL(t *testing.T) {
297+
298+
license := GetDataLicense(IODLV2URL)
299+
300+
assert.Equal(t, license.Name, "Italian Open Data License v2.0")
301+
assert.Equal(t, license.URL, "https://www.dati.gov.it/content/italian-open-data-license-v20")
302+
assert.Equal(t, license.LegalCodeURL, "https://www.dati.gov.it/content/italian-open-data-license-v20")
303+
// check Permits
304+
assert.Contains(t, license.Permits, Reproduction)
305+
assert.Contains(t, license.Permits, Distribution)
306+
assert.Contains(t, license.Permits, DerivativeWorks)
307+
assert.Contains(t, license.Permits, Sharing)
308+
309+
// check Requires
310+
assert.Contains(t, license.Requires, Attribution)
311+
312+
// check Prohibits
313+
assert.NotContains(t, license.Prohibits, CommercialUse)
314+
assert.NotContains(t, license.Prohibits, HighIncomeNationUse)
315+
}
296316
func TestCustomLicense(t *testing.T) {
297317
thing := Thing{
298318
Title: "Title",

0 commit comments

Comments
 (0)