Package org.topbraid.jenax.util
Class ExtraPrefixes
java.lang.Object
org.topbraid.jenax.util.ExtraPrefixes
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic voidProgrammatically 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).Gets a Map from prefixes to namespaces.
-
Constructor Details
-
ExtraPrefixes
public ExtraPrefixes()
-
-
Method Details
-
add
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
-
getExtraPrefixes
Gets a Map from prefixes to namespaces. The result should be treated as read-only.- Returns:
- the extra prefixes
-