@@ -225,21 +225,23 @@ def __call__(self):
225
225
g .add ((catalog_node , DCAT .dataset , dataset_uri ))
226
226
g .add ((dataset_uri , RDF .type , DCATAPIT .Dataset ))
227
227
g .add ((dataset_uri , DCT .identifier , Literal (brain .getURL ())))
228
-
229
- # XXX: verificare il formato iso delle date usato da CKAN
230
228
g .add (
231
229
(
232
230
dataset_uri ,
233
231
DCT .modified ,
234
- Literal (
235
- brain .modified .asdatetime ().isoformat (), datatype = XSD .dateTime
236
- ),
232
+ Literal (obj .last_update_date .isoformat (), datatype = XSD .date ),
233
+ )
234
+ )
235
+ g .add (
236
+ (
237
+ dataset_uri ,
238
+ DCT .issued ,
239
+ Literal (obj .release_date .isoformat (), datatype = XSD .date ),
237
240
)
238
241
)
239
242
g .add ((dataset_uri , DCT .accrualPeriodicity , Literal (obj .frequency )))
240
243
241
244
g .add ((dataset_uri , DCT .title , Literal (obj .Title (), lang = lang )))
242
- # g.add((dataset_uri, DCT.issued, Literal(record['PubDate'], datatype=XSD.dateTime)))
243
245
g .add ((dataset_uri , DCT .description , Literal (obj .Description (), lang = lang )))
244
246
for theme in obj .themes :
245
247
theme_uri = URIRef (theme )
@@ -268,16 +270,6 @@ def __call__(self):
268
270
g .add ((dataset_uri , DCAT .contactPoint , org_node ))
269
271
g .add ((dataset_uri , DCT .publisher , publisher_node ))
270
272
271
- # location_node = BNode()
272
- # g.add((dataset_uri, DCT.spatial, location_node))
273
- # g.add((location_node, RDF.type, DCT.Location))
274
- # g.add((location_node, DCATAPIT.geographicalIdentifier, URIRef("https://www.geonames.org/6538969")))
275
-
276
- # g.add((dataset_uri, DCT.accrualPeriodicity, URIRef("http://publications.europa.eu/resource/authority/frequency/CONT")))
277
- # g.add((dataset_uri, DCT.language, URIRef("http://publications.europa.eu/resource/authority/language/ITA")))
278
- # g.add((dataset_uri, DCT.modified, Literal(record['ModifiedDate'], datatype=XSD.dateTime)))
279
- # g.add((dataset_uri, DCAT.landingPage, URIRef(f"{catalog_uri}/dataset/{record['ID']}")))
280
-
281
273
for file_brain in catalog (path = brain .getPath (), portal_type = "File" ):
282
274
distribution_uri = URIRef (file_brain .getURL ())
283
275
@@ -289,7 +281,8 @@ def __call__(self):
289
281
(
290
282
distribution_uri ,
291
283
DCAT .accessURL ,
292
- # TODO: qui andrebbe messo il filename, anzichè "file", serve la getObject per recuperarlo ?
284
+ # TODO: qui andrebbe messo il filename, anzichè "file",
285
+ # serve la getObject per recuperarlo ?
293
286
URIRef (f"{ file_brain .getURL ()} /@@download/file" ),
294
287
)
295
288
)
@@ -370,15 +363,6 @@ def __call__(self):
370
363
# XXX: per semplicità usiamo il rghtsHolder del dataset
371
364
g .add ((distribution_uri , DCAT .contactPoint , holder_uri ))
372
365
373
- # for keyword in record['Keywords'].split(","):
374
- # g.add((dataset_uri, DCAT.keyword, Literal(keyword.strip())))
375
-
376
- # dataset_uri = URIRef(obj.absolute_url())
377
- # g.add((dataset_uri, DCT.title, Literal(obj.Title())))
378
- # g.add((dataset_uri, DCT.issued, Literal(record['PubDate'])))
379
- # g.add((dataset_uri, DCAT.theme, Literal(record['Theme'])))
380
-
381
- # Salva l'RDF in un file
382
366
out = io .BytesIO ()
383
367
g .serialize (destination = out , format = self .format )
384
368
data = out .getvalue ()
0 commit comments