File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -567,10 +567,10 @@ fn local_name(iri: &str) -> String {
567567/// Normalize a label for comparison: lowercase, split camelCase, trim.
568568fn normalize_label ( label : & str ) -> String {
569569 // Replace underscores and hyphens with spaces, then camelCase split
570- let cleaned = label. replace ( '_' , " " ) . replace ( '-' , " " ) ;
570+ let cleaned = label. replace ( [ '_' , '-' ] , " " ) ;
571571 let mut result = String :: with_capacity ( cleaned. len ( ) + 8 ) ;
572572 for ( i, ch) in cleaned. chars ( ) . enumerate ( ) {
573- if i > 0 && ch. is_uppercase ( ) && !cleaned. as_bytes ( ) . get ( i. wrapping_sub ( 1 ) ) . map_or ( false , |c| c. is_ascii_uppercase ( ) ) {
573+ if i > 0 && ch. is_uppercase ( ) && !cleaned. as_bytes ( ) . get ( i. wrapping_sub ( 1 ) ) . is_some_and ( |c| c. is_ascii_uppercase ( ) ) {
574574 result. push ( ' ' ) ;
575575 }
576576 result. push ( ch) ;
Original file line number Diff line number Diff line change @@ -274,13 +274,11 @@ fn run_count_query(graph: &Arc<GraphStore>, query: &str) -> u64 {
274274 match graph. sparql_select ( query) {
275275 Ok ( json_str) => {
276276 // sparql_select returns {"variables":["c"],"results":[{"c":"\"3\"^^…"}]}
277- if let Ok ( v) = serde_json:: from_str :: < serde_json:: Value > ( & json_str) {
278- if let Some ( row) = v[ "results" ] . as_array ( ) . and_then ( |a| a. first ( ) ) {
279- if let Some ( val) = row[ "c" ] . as_str ( ) {
280- // Oxigraph wraps the value like "\"3\"^^<…integer>"
281- return parse_sparql_integer ( val) ;
282- }
283- }
277+ if let Ok ( v) = serde_json:: from_str :: < serde_json:: Value > ( & json_str)
278+ && let Some ( row) = v[ "results" ] . as_array ( ) . and_then ( |a| a. first ( ) )
279+ && let Some ( val) = row[ "c" ] . as_str ( ) {
280+ // Oxigraph wraps the value like "\"3\"^^<…integer>"
281+ return parse_sparql_integer ( val) ;
284282 }
285283 0
286284 }
You can’t perform that action at this time.
0 commit comments