java.lang.Object
org.apache.jena.riot.RDFLanguages
Central registry of RDF languages and syntaxes.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Lang
The standard JSON-LD registration.static final Lang
static final Lang
N3 (treat as Turtle)static final Lang
Alternative constantNQUADS
static final Lang
static final Lang
Alternative constant forNTRIPLES
static final Lang
static final Lang
static final Lang
The "null" languagestatic final Lang
static final Lang
Output-only language for a StreamRDF (for development)static final Lang
The RDF syntax RDF Thriftstatic final Lang
static final Lang
SHACL Compact Syntax (2020-07-01)static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final Lang
Textstatic final Lang
static final Lang
TriXstatic final Lang
Alternative constant forTURTLE
static final Lang
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Lang
contentTypeToLang
(String contentType) Map a content type (without charset) to aLang
static Lang
Map a content type (without charset) to aLang
static Lang
fileExtToLang
(String ext) Try to map a file extension to aLang
; return null on no registered mappingstatic Lang
filenameToLang
(String uriOrFilename) Try to map a file name to aLang
; return null on no registered mapping.static Lang
filenameToLang
(String filename, Lang dftLang) Try to map a file name to aLang
; return the given default where there is no registered mappingstatic String
getCharsetForContentType
(String contentType) static Collection<Lang>
static ContentType
guessContentType
(String resourceName) static boolean
hasRegisteredParser
(Lang lang) return true if the language is registered for parsing as an RDF syntax.static void
init()
System initialization function.static boolean
return true if the language is registered as a quads language.static boolean
isRegistered
(Lang lang) Is this language registered?static boolean
return true if the language is registered as a triples language.static Lang
nameToLang
(String langName) Turn a name for a language into aLang
object.static Lang
pathnameToLang
(String pathname) Try to map a URI or URI path name to aLang
; return null on no registered mapping.static void
Register a language.static Lang
resourceNameToLang
(String resourceName) Try to map a resource name to aLang
; return null on no registered mappingstatic Lang
resourceNameToLang
(String resourceName, Lang dftLang) Try to map a resource name to aLang
; return the given default where there is no registered mappingstatic boolean
static Lang
shortnameToLang
(String label) Map a colloquial name (e.g.static void
unregister
(Lang lang) Remove a registration of a language - this also removes all recorded mapping of content types and file extensions.
-
Field Details
-
strLangRDFXML
- See Also:
-
strLangTurtle
- See Also:
-
strLangNTriples
- See Also:
-
strLangN3
- See Also:
-
strLangRDFJSON
- See Also:
-
strLangJSONLD
- See Also:
-
strLangNQuads
- See Also:
-
strLangTriG
- See Also:
-
strLangCSV
- See Also:
-
strLangTSV
- See Also:
-
strLangTriX
- See Also:
-
strLangRDFPROTO
- See Also:
-
strLangRDFTHRIFT
- See Also:
-
RDFXML
-
TURTLE
-
TTL
Alternative constant forTURTLE
-
N3
N3 (treat as Turtle) -
NTRIPLES
-
NT
Alternative constant forNTRIPLES
-
JSONLD
The standard JSON-LD registration. JSON-LD. -
strLangJSONLD11
- See Also:
-
JSONLD11
-
RDFJSON
-
TRIG
-
NQUADS
-
NQ
Alternative constantNQUADS
-
RDFPROTO
-
RDFTHRIFT
The RDF syntax RDF Thrift -
TEXT
Text -
TRIX
TriX -
RDFNULL
The "null" language -
RDFRAW
Output-only language for a StreamRDF (for development) -
SHACLC
SHACL Compact Syntax (2020-07-01)
-
-
Constructor Details
-
RDFLanguages
public RDFLanguages()
-
-
Method Details
-
getRegisteredLanguages
-
init
public static void init()System initialization function. -
register
Register a language. To create aLang
object useLangBuilder
. See alsoRDFParserRegistry.registerLang(org.apache.jena.riot.Lang, org.apache.jena.riot.ReaderRIOTFactory)
for registering a language and it's RDF parser factory.- See Also:
-
unregister
Remove a registration of a language - this also removes all recorded mapping of content types and file extensions. -
isRegistered
Is this language registered? -
isTriples
return true if the language is registered as a triples language. -
isQuads
return true if the language is registered as a quads language. -
hasRegisteredParser
return true if the language is registered for parsing as an RDF syntax. -
contentTypeToLang
Map a content type (without charset) to aLang
-
contentTypeToLang
Map a content type (without charset) to aLang
-
getCharsetForContentType
-
shortnameToLang
Map a colloquial name (e.g. "Turtle") to aLang
-
fileExtToLang
Try to map a file extension to aLang
; return null on no registered mapping -
resourceNameToLang
Try to map a resource name to aLang
; return null on no registered mapping -
resourceNameToLang
Try to map a resource name to aLang
; return the given default where there is no registered mapping -
filenameToLang
Try to map a file name to aLang
; return null on no registered mapping. -
pathnameToLang
Try to map a URI or URI path name to aLang
; return null on no registered mapping. -
filenameToLang
Try to map a file name to aLang
; return the given default where there is no registered mapping -
nameToLang
Turn a name for a language into aLang
object. The name can be a label, or a content type. -
guessContentType
-
sameLang
-