Class RDFLanguages

java.lang.Object
org.apache.jena.riot.RDFLanguages

public class RDFLanguages extends Object
Central registry of RDF languages and syntaxes.
See Also:
  • Field Details

  • Constructor Details

    • RDFLanguages

      public RDFLanguages()
  • Method Details

    • getRegisteredLanguages

      public static Collection<Lang> getRegisteredLanguages()
    • init

      public static void init()
    • register

      public static void register(Lang lang)
      Register a language. To create a Lang object use LangBuilder. See also RDFParserRegistry.registerLang(org.apache.jena.riot.Lang, org.apache.jena.riot.ReaderRIOTFactory) for registering a language and it's RDF parser factory.
      See Also:
    • unregister

      public static void unregister(Lang lang)
      Remove a registration of a language - this also removes all recorded mapping of content types and file extensions.
    • isRegistered

      public static boolean isRegistered(Lang lang)
      Is this language registered?
    • isTriples

      public static boolean isTriples(Lang lang)
      return true if the language is registered as a triples language.
    • isQuads

      public static boolean isQuads(Lang lang)
      return true if the language is registered as a quads language.
    • hasRegisteredParser

      public static boolean hasRegisteredParser(Lang lang)
      return true if the language is registered for parsing as an RDF syntax.
    • contentTypeToLang

      public static Lang contentTypeToLang(String contentType)
      Map a content type (without charset) to a Lang
    • contentTypeToLang

      public static Lang contentTypeToLang(ContentType ct)
      Map a content type (without charset) to a Lang
    • getCharsetForContentType

      public static String getCharsetForContentType(String contentType)
    • shortnameToLang

      public static Lang shortnameToLang(String label)
      Map a colloquial name (e.g. "Turtle") to a Lang
    • fileExtToLang

      public static Lang fileExtToLang(String ext)
      Try to map a file extension to a Lang; return null on no registered mapping
    • resourceNameToLang

      public static Lang resourceNameToLang(String resourceName)
      Try to map a resource name to a Lang; return null on no registered mapping
    • resourceNameToLang

      public static Lang resourceNameToLang(String resourceName, Lang dftLang)
      Try to map a resource name to a Lang; return the given default where there is no registered mapping
    • filenameToLang

      public static Lang filenameToLang(String uriOrFilename)
      Try to map a file name to a Lang; return null on no registered mapping.
    • pathnameToLang

      public static Lang pathnameToLang(String pathname)
      Try to map a URI or URI path name to a Lang; return null on no registered mapping.
    • filenameToLang

      public static Lang filenameToLang(String filename, Lang dftLang)
      Try to map a file name to a Lang; return the given default where there is no registered mapping
    • nameToLang

      public static Lang nameToLang(String langName)
      Turn a name for a language into a Lang object. The name can be a label, or a content type.
    • guessContentType

      public static ContentType guessContentType(String resourceName)
    • sameLang

      public static boolean sameLang(Lang lang1, Lang lang2)