Class PrefixMappingUtils

java.lang.Object
org.apache.jena.util.PrefixMappingUtils

public class PrefixMappingUtils extends Object
  • Constructor Details

    • PrefixMappingUtils

      public PrefixMappingUtils()
  • Method Details

    • graphInUsePrefixMapping

      public static Graph graphInUsePrefixMapping(Graph graph)
      Return a read-only graph that has the same data (RDF triples) as the one given, but has a prefix mapping that only includes "in use" prefixes as calculated by calcInUsePrefixMapping(Graph, PrefixMapping).

      The prefix mappings of the two graphs are not connected. Later changes to the prefix mapping of the original graph are not reflected in the returned graph. Modifications to the triples contained in the underlying graph are reflected.

    • calcInUsePrefixMapping

      public static PrefixMapping calcInUsePrefixMapping(Graph graph)
      Analyse the graph to see which prefixes of the graph are in use.

      In the case of overlapping prefixes (where one prefix declaration is has an initial URI string which matches another prefix declaration), all are included, though they may not be used when printing (that depends on the output process). In effect, this process has "false positives".

      This function does not calculate new prefixes.

      See Also:
    • calcInUsePrefixMapping

      public static PrefixMapping calcInUsePrefixMapping(Graph graph, PrefixMapping prefixMapping)
      Analyse the graph to see which prefixes of the given PrefixMapping are in use.

      In the case of overlapping prefixes (where one prefix declaration is has an initial URI string which matches another prefix declaration), all are included, though they may not be used when printing (that depends on the output process). In effect, this process has "false positives".

      This function does not calculate new prefixes.

      See Also:
    • calcInUsePrefixMappingTTL

      public static PrefixMapping calcInUsePrefixMappingTTL(Graph graph)
      Analyse the graph to see which prefixes of the graph are in use.

      This function attempts to process each URI in the graph as if it were to be printed in Turtle. Only prefixes that lead to valid output strings are returned. This is more expensive than calcInUsePrefixMapping(Graph).

      This function does not calculate new prefixes.

      See Also:
    • calcInUsePrefixMappingTTL

      public static PrefixMapping calcInUsePrefixMappingTTL(Graph graph, PrefixMapping prefixMapping)
      Analyse the graph to see which prefixes of the given PrefixMapping are used by the graph triples.

      This function attempts to process each URI in the graph as if it were to be printed in Turtle. Only prefixes that lead to valid output strings are returned. This is more expensive than calcInUsePrefixMapping(Graph, PrefixMapping).

      This function does not calculate new prefixes.

      See Also: