org.apache.jena.riot
Class RDFLanguages

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

public class RDFLanguages
extends Object

Central registry of RDF languages and syntaxes.

See Also:
RDFParserRegistry, RDFFormat

Field Summary
static Lang CSV
          CSV - CSV data read into an RDF model with simple conversion : See Jena-625
static Lang JSONLD
          JSON-LD.
static Lang N3
          N3 (treat as Turtle)
static Lang NQ
          Alternative constant NQUADS
static Lang NQUADS
          N-Quads
static Lang NT
          Alternative constant for NTRIPLES
static Lang NTRIPLES
          N-Triples
static Lang RDFJSON
          RDF/JSON.
static Lang RDFNULL
          The "null" language
static Lang RDFXML
          RDF/XML
static String strLangCSV
           
static String strLangJSONLD
           
static String strLangN3
           
static String strLangNQuads
           
static String strLangNTriples
           
static String strLangRDFJSON
           
static String strLangRDFXML
           
static String strLangTriG
           
static String strLangTurtle
           
static Lang TRIG
          TriG
static Lang TTL
          Alternative constant for TURTLE
static Lang TURTLE
          Turtle
 
Constructor Summary
RDFLanguages()
           
 
Method Summary
static Lang contentTypeToLang(ContentType ct)
          Map a content type (without charset) to a Lang
static Lang contentTypeToLang(String contentType)
          Map a content type (without charset) to a Lang
static Lang fileExtToLang(String ext)
          Try to map a file extension to a Lang; return null on no registered mapping
static Lang filenameToLang(String filename)
          Try to map a file name to a Lang; return null on no registered mapping
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
static String getCharsetForContentType(String contentType)
           
static Collection<Lang> getRegisteredLanguages()
           
static ContentType guessContentType(String resourceName)
           
static void init()
           
static boolean isQuads(Lang lang)
          return true if the language is registered as a quads language
static boolean isRegistered(Lang lang)
           
static boolean isTriples(Lang lang)
          return true if the language is registered as a triples language
static Lang nameToLang(String langName)
          Turn a name for a language into a Lang object.
static void register(Lang lang)
          Register a language.
static Lang resourceNameToLang(String resourceName)
          Try to map a resource name to a Lang; return null on no registered mapping
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
static boolean sameLang(Lang lang1, Lang lang2)
           
static Lang shortnameToLang(String label)
          Map a colloquial name (e.g.
static void unregister(Lang lang)
          Remove a regsitration of a language - this also removes all recorded mapping of content types and file extensions.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

strLangRDFXML

public static final String strLangRDFXML
See Also:
Constant Field Values

strLangTurtle

public static final String strLangTurtle
See Also:
Constant Field Values

strLangNTriples

public static final String strLangNTriples
See Also:
Constant Field Values

strLangN3

public static final String strLangN3
See Also:
Constant Field Values

strLangRDFJSON

public static final String strLangRDFJSON
See Also:
Constant Field Values

strLangJSONLD

public static final String strLangJSONLD
See Also:
Constant Field Values

strLangNQuads

public static final String strLangNQuads
See Also:
Constant Field Values

strLangTriG

public static final String strLangTriG
See Also:
Constant Field Values

strLangCSV

public static final String strLangCSV
See Also:
Constant Field Values

RDFXML

public static final Lang RDFXML
RDF/XML


TURTLE

public static final Lang TURTLE
Turtle


TTL

public static final Lang TTL
Alternative constant for TURTLE


N3

public static final Lang N3
N3 (treat as Turtle)


NTRIPLES

public static final Lang NTRIPLES
N-Triples


NT

public static final Lang NT
Alternative constant for NTRIPLES


JSONLD

public static final Lang JSONLD
JSON-LD.


RDFJSON

public static final Lang RDFJSON
RDF/JSON. This is not JSON-LD.


TRIG

public static final Lang TRIG
TriG


NQUADS

public static final Lang NQUADS
N-Quads


NQ

public static final Lang NQ
Alternative constant NQUADS


CSV

public static final Lang CSV
CSV - CSV data read into an RDF model with simple conversion : See Jena-625


RDFNULL

public static final Lang RDFNULL
The "null" language

Constructor Detail

RDFLanguages

public RDFLanguages()
Method Detail

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 fatory.

See Also:
RDFParserRegistry

unregister

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


isRegistered

public static boolean isRegistered(Lang lang)

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


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 filename)
Try to map a file 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)


Licenced under the Apache License, Version 2.0