Class RDFLanguagesEx

java.lang.Object
org.aksw.jenax.arq.util.lang.RDFLanguagesEx

public class RDFLanguagesEx extends Object
Convenience methods related to Jena's RDFLanguages class.
Author:
raven
  • Constructor Details

    • RDFLanguagesEx

      public RDFLanguagesEx()
  • Method Details

    • getSubLangMap

      public static Map<org.apache.jena.riot.Lang,org.apache.jena.riot.Lang> getSubLangMap()
    • streamSubLangs

      public static Stream<org.apache.jena.riot.Lang> streamSubLangs(org.apache.jena.riot.Lang lang)
    • 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

      public static List<org.apache.jena.riot.Lang> getQuadAndTripleLangs()
      Returns quad langs first followed by the triple ones. Returned langs are distinct.
      Returns:
    • getResultSetProbeLangs

      public static List<org.apache.jena.riot.Lang> 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

      public static List<org.apache.jena.riot.Lang> getResultSetLangs()
      Get all registered result set languages
      Returns:
    • getResultSetFormats

      public static List<org.apache.jena.riot.Lang> 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

      public static List<org.apache.jena.riot.Lang> getTripleLangs()
    • getQuadLangs

      public static List<org.apache.jena.riot.Lang> getQuadLangs()
    • getAllLangNames

      public static Set<String> getAllLangNames(org.apache.jena.riot.Lang lang)
      Get the set of preferred and alternative labels from a given lang object
      Parameters:
      lang -
      Returns:
    • getAllContentTypes

      public static Set<String> getAllContentTypes(org.apache.jena.riot.Lang lang)
      Get the set of preferred and alternative content types from a given lang object
      Parameters:
      lang -
      Returns:
    • getPrimaryContentTypes

      public static List<String> getPrimaryContentTypes(Iterable<org.apache.jena.riot.Lang> langs)
    • getAllContentTypes

      public static Set<String> getAllContentTypes(Iterable<org.apache.jena.riot.Lang> langs)
    • legacyLabel

      public static String legacyLabel(String legacyLabel)
    • matchFormat

      public static boolean matchFormat(String langOrFormat, String label)
    • matchesLang

      public static boolean matchesLang(org.apache.jena.riot.Lang lang, String label)
      Simple helper to check whether any of a lang's labels match a given one. Returns the first match
      Parameters:
      lang -
      label -
      Returns:
    • matchesFileExtension

      public static boolean matchesFileExtension(org.apache.jena.riot.Lang lang, String label)
    • matchesContentType

      public static boolean matchesContentType(org.apache.jena.riot.Lang lang, String label)
    • findRdfFormat

      public static org.apache.jena.riot.RDFFormat findRdfFormat(String label)
      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

      public static org.apache.jena.riot.Lang findLang(String label)
    • 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

      public static Collection<String> listOutFormats()