Package org.aksw.jenax.arq.util.lang
Class RDFLanguagesEx
java.lang.Object
org.aksw.jenax.arq.util.lang.RDFLanguagesEx
Convenience methods related to Jena's
RDFLanguages class.- Author:
- raven
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Set<org.apache.jena.riot.Lang>expandWithSubLangs(Iterable<org.apache.jena.riot.Lang> langs) Return a set of languages which includes all the input ones and in additionstatic org.apache.jena.riot.Langstatic org.apache.jena.riot.LangfindLang(String label, Collection<org.apache.jena.riot.Lang> probeLangs) static org.apache.jena.riot.LangfindLangMatchingAcceptList(org.apache.jena.atlas.web.AcceptList acceptableContentTypes, List<org.apache.jena.riot.Lang> resultSetFormats, org.apache.jena.riot.Lang fallback) static org.apache.jena.riot.RDFFormatfindRdfFormat(String label) Find the first RDFFormat that matches a given labelstatic org.apache.jena.riot.RDFFormatfindRdfFormat(String label, Collection<org.apache.jena.riot.RDFFormat> probeFormats) getAllContentTypes(Iterable<org.apache.jena.riot.Lang> langs) getAllContentTypes(org.apache.jena.riot.Lang lang) Get the set of preferred and alternative content types from a given lang objectgetAllLangNames(org.apache.jena.riot.Lang lang) Get the set of preferred and alternative labels from a given lang objectgetPrimaryContentTypes(Iterable<org.apache.jena.riot.Lang> langs) static List<org.apache.jena.riot.Lang>Returns quad langs first followed by the triple ones.static List<org.apache.jena.riot.Lang>static List<org.apache.jena.riot.Lang>Return the languages available for writing result sets out.static List<org.apache.jena.riot.Lang>Get all registered result set languagesstatic List<org.apache.jena.riot.Lang>Util function that filters out result set langs that are not suitable for probing For example CSV accepts nearly any kind of inputstatic Map<org.apache.jena.riot.Lang,org.apache.jena.riot.Lang> static List<org.apache.jena.riot.Lang>static StringlegacyLabel(String legacyLabel) static Collection<String>static booleanmatchesContentType(org.apache.jena.riot.Lang lang, String label) static booleanmatchesFileExtension(org.apache.jena.riot.Lang lang, String label) static booleanmatchesLang(org.apache.jena.riot.Lang lang, String label) Simple helper to check whether any of a lang's labels match a given one.static booleanmatchFormat(String langOrFormat, String label) static Stream<org.apache.jena.riot.Lang>streamSubLangs(org.apache.jena.riot.Lang lang)
-
Constructor Details
-
RDFLanguagesEx
public RDFLanguagesEx()
-
-
Method Details
-
getSubLangMap
-
streamSubLangs
-
expandWithSubLangs
public static Set<org.apache.jena.riot.Lang> expandWithSubLangs(Iterable<org.apache.jena.riot.Lang> langs) Return a set of languages which includes all the input ones and in addition -
getQuadAndTripleLangs
Returns quad langs first followed by the triple ones. Returned langs are distinct.- Returns:
-
getResultSetProbeLangs
Util function that filters out result set langs that are not suitable for probing For example CSV accepts nearly any kind of input- Returns:
-
getResultSetLangs
Get all registered result set languages- Returns:
-
getResultSetFormats
Return the languages available for writing result sets out. For some reason at least in Jena 3.15.0 the text format is not explicitly registered in the writer registry although it can be used - this seems to be a small bug so -
getTripleLangs
-
getQuadLangs
-
getAllLangNames
Get the set of preferred and alternative labels from a given lang object- Parameters:
lang-- Returns:
-
getAllContentTypes
Get the set of preferred and alternative content types from a given lang object- Parameters:
lang-- Returns:
-
getPrimaryContentTypes
-
getAllContentTypes
-
legacyLabel
-
matchFormat
-
matchesLang
Simple helper to check whether any of a lang's labels match a given one. Returns the first match- Parameters:
lang-label-- Returns:
-
matchesFileExtension
-
matchesContentType
-
findRdfFormat
Find the first RDFFormat that matches a given label- Parameters:
label-- Returns:
-
findRdfFormat
public static org.apache.jena.riot.RDFFormat findRdfFormat(String label, Collection<org.apache.jena.riot.RDFFormat> probeFormats) -
findLang
-
findLang
public static org.apache.jena.riot.Lang findLang(String label, Collection<org.apache.jena.riot.Lang> probeLangs) -
findLangMatchingAcceptList
public static org.apache.jena.riot.Lang findLangMatchingAcceptList(org.apache.jena.atlas.web.AcceptList acceptableContentTypes, List<org.apache.jena.riot.Lang> resultSetFormats, org.apache.jena.riot.Lang fallback) -
listOutFormats
-