Class MultiFunctions


  • public class MultiFunctions
    extends Object
    A singleton managing the (known) MultiFunctions, for example to drive code generators. Any MultiFunction that gets registered will also be installed as a SPARQL property function for Jena.
    Author:
    Holger Knublauch
    • Constructor Detail

      • MultiFunctions

        public MultiFunctions()
    • Method Detail

      • get

        public static MultiFunction get​(String uri)
        Gets a MultiFunction with a given URI.
        Parameters:
        uri - the URI of the MultiFunction to get
        Returns:
        the MultiFunction or null
      • getOrCreate

        public static MultiFunction getOrCreate​(org.apache.jena.rdf.model.Resource multiFunction)
      • register

        public static org.topbraid.shacl.multifunctions.MultiFunctionPropertyFunction register​(MultiFunction multiFunction)
        Registers a MultiFunction and installs a corresponding Jena property function.
        Parameters:
        multiFunction - the MultiFunction
      • registerAll

        public static void registerAll​(org.apache.jena.rdf.model.Model model)
        Registers all declarative MultiFunctions (instances of dash:MultiFunction) from a given Model. This will overwrite any previously known functions and property functions with overlapping URIs.
        Parameters:
        model - the Model to look up the definitions
      • registerAllTemp

        public static Iterable<String> registerAllTemp​(org.apache.jena.rdf.model.Model model)
        Temporarily registers any multi-function that is not registered yet, e.g. for the duration of a test case. Needs to be followed by unregister calls in a finally block.
        Parameters:
        model - the Model to add the MultiFunctions of
        Returns:
        the actually added URIs, needed for the unregister call
      • unregister

        public static void unregister​(String uri)
        Removes a MultiFunction and the corresponding property function.
        Parameters:
        uri - the URI of the multi-function to remove
      • uris

        public static Stream<String> uris()
        Gets a stream of the known URIs, which can then be used by the get function.
        Returns:
        the URIs