File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424except exceptions .ValidationError as err :
2525 print (f"Validation failed: { err .message } - { err .json_path } " )
2626
27+ with open ('schemas/v1/context.jsonld' , encoding = 'utf-8' ) as f :
28+ local_context = json .load (f )
29+
2730print ("\n --- JSON-LD validation ---" )
31+ doc_json ['@context' ] = local_context ['@context' ]
2832try :
2933 # check if something was not mapped
3034 expanded = jsonld .expand (doc_json )
3135 print ("JSON-LD expansion works" )
3236
3337 nquads = jsonld .normalize (doc_json , {'algorithm' : 'URDNA2015' , 'format' : 'application/n-quads' })
3438 print (f"RFD graph { len (nquads .splitlines ())} triplas." )
35- print (nquads )
3639
37- except Exception as e :
38- print (f"❌ Erro ao processar JSON-LD: { e } " )
40+ except Exception as exception :
41+ print (f"❌ Erro ao processar JSON-LD: { exception } " )
You can’t perform that action at this time.
0 commit comments