private Map<String,Integer> findLanguageFallbacks(final ServiceParams params){
  List<TermNode> paramNodes=params.get(LANGUAGE_PARAM);
  if (paramNodes.size() < 1) {
    throw new IllegalArgumentException("You must provide the label service a list of languages.");
  }
  Map<String,Integer> fallbacksMap=new HashMap<>();
  int cnt=0;
  for (  TermNode term : paramNodes) {
    if (term.isVariable()) {
      throw new IllegalArgumentException("not a constant");
    }
    final Value v=term.getValue();
    if (!(v instanceof Literal)) {
      throw new IllegalArgumentException("not a literal");
    }
    final String s=v.stringValue();
    if (s.contains(",")) {
      for (      String ls : s.split(",")) {
        fallbacksMap.put(ls.trim(),cnt);
        ++cnt;
      }
    }
 else {
      fallbacksMap.put(s.trim(),cnt);
    }
    ++cnt;
  }
  return fallbacksMap;
}

private Map < String , Integer > findLanguageFallbacks ( final ServiceParams params ) { List < TermNode > paramNodes = params . get ( LANGUAGE_PARAM ) ; if ( paramNodes . size ( ) < 1 ) { throw new IllegalArgumentException ( "You must provide the label service a list of languages." ) ; } Map < String , Integer > fallbacksMap = new HashMap < > ( ) ; int cnt = 0 ; for ( TermNode term : paramNodes ) { if ( term . isVariable ( ) ) { throw new IllegalArgumentException ( "not a constant" ) ; } final Value v = term . getValue ( ) ; if ( ! ( v instanceof Literal ) ) { throw new IllegalArgumentException ( "not a literal" ) ; } final String s = v . stringValue ( ) ; if ( s . contains ( "," ) ) { for ( String ls : s . split ( "," ) ) { fallbacksMap . put ( ls . trim ( ) , cnt ) ; ++ cnt ; } } else { fallbacksMap . put ( s . trim ( ) , cnt ) ; } ++ cnt ; } return fallbacksMap ; }
resolve the language fallbacks from the statement pattern node in the query .
