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
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    add(String prefix, String namespace)
    Programmatically adds a new prefix to be regarded as an "extra" prefix.
    static void
    add(org.apache.jena.rdf.model.Resource resource)
    Attempts to add an extra prefix for a given Resource.
    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).
    static Map<String,String>
    Gets a Map from prefixes to namespaces.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ExtraPrefixes

      public ExtraPrefixes()
  • Method Details

    • 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 add
      namespace - 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

      public static Map<String,String> getExtraPrefixes()
      Gets a Map from prefixes to namespaces. The result should be treated as read-only.
      Returns:
      the extra prefixes