File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ pub fn json_to_rdf(
4343 file_path : & String ,
4444 namespace : & Option < String > ,
4545 output_file : & Option < String > ,
46- ) -> Result < Graph , Error > {
46+ ) -> Result < Option < Graph > , Error > {
4747 let rdf_namespace: String = if namespace. is_some ( ) {
4848 namespace. clone ( ) . unwrap ( )
4949 } else {
@@ -112,9 +112,9 @@ pub fn json_to_rdf(
112112 . expect ( "Error opening file" ) ;
113113
114114 writeln ! ( file, "{}" , graph) . expect ( "Error writing json2rdf data to file" ) ;
115- Ok ( graph )
115+ Ok ( None )
116116 } else {
117- return Ok ( graph) ;
117+ return Ok ( Some ( graph) ) ;
118118 }
119119}
120120
Original file line number Diff line number Diff line change @@ -6,8 +6,7 @@ fn test_graph_triple_count() {
66
77 match triple_count_string {
88 Ok ( res) => {
9- println ! ( "Graph created with {} triples" , res. len( ) ) ;
10- assert_eq ! ( res. len( ) , 23 )
9+ assert_eq ! ( res. unwrap( ) . len( ) , 23 )
1110 }
1211 Err ( e) => eprintln ! ( "Error writing: {}" , e) ,
1312 }
You can’t perform that action at this time.
0 commit comments