Class PrefixMappingUtils
- java.lang.Object
-
- org.apache.jena.util.PrefixMappingUtils
-
public class PrefixMappingUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description PrefixMappingUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PrefixMapping
calcInUsePrefixMapping(Graph graph)
Analyse the graph to see which prefixes of the graph are in use.static PrefixMapping
calcInUsePrefixMapping(Graph graph, PrefixMapping prefixMapping)
Analyse the graph to see which prefixes of the givenPrefixMapping
are in use.static PrefixMapping
calcInUsePrefixMappingTTL(Graph graph)
Analyse the graph to see which prefixes of the graph are in use.static PrefixMapping
calcInUsePrefixMappingTTL(Graph graph, PrefixMapping prefixMapping)
Analyse the graph to see which prefixes of the givenPrefixMapping
are used by the graph triples.static Graph
graphxInUsePrefixMapping(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 bycalcInUsePrefixMapping(Graph, PrefixMapping)
.
-
-
-
Method Detail
-
graphxInUsePrefixMapping
public static Graph graphxInUsePrefixMapping(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 bycalcInUsePrefixMapping(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:
calcInUsePrefixMappingTTL(Graph)
-
calcInUsePrefixMapping
public static PrefixMapping calcInUsePrefixMapping(Graph graph, PrefixMapping prefixMapping)
Analyse the graph to see which prefixes of the givenPrefixMapping
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.
-
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(Graph)
-
calcInUsePrefixMappingTTL
public static PrefixMapping calcInUsePrefixMappingTTL(Graph graph, PrefixMapping prefixMapping)
Analyse the graph to see which prefixes of the givenPrefixMapping
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.
-
-