Class LangTagX

java.lang.Object
org.apache.jena.langtagx.LangTagX

public class LangTagX extends Object
This class defined the Jena side policies for language tags and maps operations to LangTags.
  • Constructor Details

    • LangTagX

      public LangTagX()
  • Method Details

    • createLanguageTag

      public static org.apache.jena.langtag.LangTag createLanguageTag(String langTagStr)
      Create a LangTag object, using the Jena system default implementation of the LangTag interface. The string must conform to the syntax defined in rules and syntax in RFC 5646
    • formatLanguageTag

      public static String formatLanguageTag(String langTagStr)
      Prepare the language tag - apply formatting normalization, and always return a string. If the input is invalid as a language tag, return the input as-is.
      Throws:
      JenaException - on an all blank string.
    • canonical

      @Deprecated(forRemoval=true) public static String canonical(String langTagStr)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • checkLanguageTag

      public static boolean checkLanguageTag(String langTagStr)
      Check a string is valid as a language tag. This function returns true or false and does not throw an exception.
    • checkLanguageTagBasicSyntax

      public static boolean checkLanguageTagBasicSyntax(String langTagStr)
      Check a language tag string meets the Turtle(etc) and SPARQL grammar rule for a language tag without initial text direction.

      Passing this test does not guarantee the string is valid language tag. Use checkLanguageTag(String) for validity checking.

    • requireValidLanguageTag

      public static void requireValidLanguageTag(String langTagStr)
      Check a string is valid as a language tag. Throw a JenaException if it is not valid.
    • sameLanguageTagAs

      public static boolean sameLanguageTagAs(String langTagStr1, String langTagStr2)
      Is @code{langTagStr1} the same language tag as @code{langTagStr2}?