Package org.topbraid.jenax.util
Class ExtraPrefixes
- java.lang.Object
-
- org.topbraid.jenax.util.ExtraPrefixes
-
public class ExtraPrefixes extends Object
Manages extra prefixes that are always available even if not explicitly declared. Examples include fn and Jena's afn.- Author:
- Holger Knublauch
-
-
Constructor Summary
Constructors Constructor Description ExtraPrefixes()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidadd(String prefix, String namespace)Programmatically adds a new prefix to be regarded as an "extra" prefix.static voidadd(org.apache.jena.rdf.model.Resource resource)Attempts to add an extra prefix for a given Resource.static org.apache.jena.shared.PrefixMappingcreatePrefixMappingWithExtraPrefixes(org.apache.jena.rdf.model.Model model)Creates a PrefixMapping that uses the prefixes from a Model plus any extra prefixes (unless they overlap with those from the Model).static Map<String,String>getExtraPrefixes()Gets a Map from prefixes to namespaces.
-
-
-
Method Detail
-
add
public static void add(String prefix, String namespace)
Programmatically adds a new prefix to be regarded as an "extra" prefix. These are prefixes that are assumed to be valid even if they haven't been declared in the current ontology. This method has no effect if the prefix was already set before.- Parameters:
prefix- the prefix to addnamespace- the namespace to add
-
add
public static void add(org.apache.jena.rdf.model.Resource resource)
Attempts to add an extra prefix for a given Resource. This does nothing if the prefix does not exist or is empty.- Parameters:
resource- the resource to get the namespace of
-
createPrefixMappingWithExtraPrefixes
public static org.apache.jena.shared.PrefixMapping createPrefixMappingWithExtraPrefixes(org.apache.jena.rdf.model.Model model)
Creates a PrefixMapping that uses the prefixes from a Model plus any extra prefixes (unless they overlap with those from the Model).- Parameters:
model- the Model to construct the PrefixMapping from- Returns:
- a new PrefixMapping instance
-
-