Package: rdfvr
RDFVRRDFVR(RDFValidationReport) is a pure Python package to generate readable reports for the validation of RDF graphs against Shapes Constraint Language (SHACL) graphs.InstallationInstall withpip(Python 3 pip installerpip3):$pip3installrdfvrCommand Line Use$rdfvr-f/path/to/rdf_graph-ffrdf_graph_format-spath/to/schema_of_rdf_graph-sfschema_of_rdf_graph_format-mpath/to/mappings-opath/to/report-ofreport_formatWhere-fis the path of the RDF graph file to be validated (also supports multiple files)-ffis the format of the RDF graph file (also supports multiple file formats when we have multiple RDF graph files)-sis the path of the the RDF graph's schema-sfis the format of the RDF graph's schema-mis the path of mappings to shorten the report-ois the path of the validation report without extension (also supports multiple files when we have multiple RDF graph files)-ofis the format of the validation report (also supports multiple file formats when we have multiple RDF graph files)Full CLI Usage Options:$rdfvr-h
usage:rdfvr[-h][--fileFILE][--schemaSCHEMA][--fileformatFILEFORMAT][--schemaformat{xml,n3,turtle,nt,pretty-xml,trix,trig,nquads,json-ld,hext}][--mappingsMAPPINGS][--outputOUTPUT][--outputformatOUTPUTFORMAT]optionalarguments:-h,--helpshowthishelpmessageandexit--fileFILE,-fFILEFile(s)oftheRDFgraph(s)tobevalidated(list[str]|str):pleaseusecomma(nospace)tosplitmultiplefilepaths(e.g.file1,file2,file3).--schemaSCHEMA,-sSCHEMASchemaoftheRDFgraph,i.e.,ShapesConstraintLanguage(SHACL)graph(str):pathofthefile.--fileformatFILEFORMAT,-ffFILEFORMATFileformat(s)oftheRDFgraph(s)tobevalidated(list[str]|str).Ordersshouldbeconsistentwiththeinputof--file.Defaultformatisjson-ld.Ifallinputfileshavethesameformat,onlyneedtowriteonce.--schemaformat{xml,n3,turtle,nt,pretty-xml,trix,trig,nquads,json-ld,hext},-sf{xml,n3,turtle,nt,pretty-xml,trix,trig,nquads,json-ld,hext}Fileformatoftheschema(str).Defaultformatisttl.--mappingsMAPPINGS,-mMAPPINGSFileofthemappingstoshortenthereport(str):pathoftheJSONfile,wherethekeyistheoriginaltextandthevalueistheshortertext.--outputOUTPUT,-oOUTPUTPath(s)ofthevalidationreportwithoutextension(list[str]|str).Ifnovalue,thenoutputwillbeastring.Pleaseusecomma(nospace)tosplitmultiplefilepaths(e.g.file1,file2,file3).--outputformatOUTPUTFORMAT,-ofOUTPUTFORMATFileformat(s)oftheoutput,validationreport(list[str]|str).Ordersshouldbeconsistentwiththeinputof--output.Defaultformatistxt.Eachitemcanonlybeoneof{txt,png,svg,gv}.Pleaseusecomma(nospace)tosplitmultipleformats(e.g.format1,format2,format3).Ifalloutputfileshavethesameformat,onlyneedtowriteonce.Python Module UseYou can call thevalidation_reportfunction of therdfvrmodule as follows:fromrdfvrimportvalidation_reportvalidation_report(file_path,file_format,schema,schema_format,output_path,output_format,mappings)Wherefile_pathis the file path (string) of a RDF graphfile_formatis the format (string) of the RDF graph fileschemais the file path (string) of the RDF graph's schemaschema_formatis the format (string) of the schema fileoutput_pathis the file path (string) of the validation report without extensionoutput_formatis the format (string) of the validation report, i.e.,txtorpngorsvgorgvmappingsis the mappings (dictionary) to shorten the reportThe return value isNone.The output will be either atxtfile, apngfile, asvgfile, agvfile, or astringprint in Bash.