Class RDFLanguages


  • public class RDFLanguages
    extends java.lang.Object
    Central registry of RDF languages and syntaxes.
    See Also:
    RDFParserRegistry, RDFFormat
    • Constructor Detail

      • RDFLanguages

        public RDFLanguages()
    • Method Detail

      • getRegisteredLanguages

        public static java.util.Collection<Lang> getRegisteredLanguages()
      • init

        public static void init()
      • 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​(java.lang.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 java.lang.String getCharsetForContentType​(java.lang.String contentType)
      • shortnameToLang

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

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

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

        public static Lang resourceNameToLang​(java.lang.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​(java.lang.String uriOrFilename)
        Try to map a file name to a Lang; return null on no registered mapping.
      • pathnameToLang

        public static Lang pathnameToLang​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.String resourceName)
      • sameLang

        public static boolean sameLang​(Lang lang1,
                                       Lang lang2)