Class OntologyLoader


  • public class OntologyLoader
    extends Object
    Reads ontologies from OWL resources
    Author:
    paul
    • Constructor Detail

      • OntologyLoader

        public OntologyLoader()
    • Method Detail

      • loadMemoryModel

        public static com.hp.hpl.jena.ontology.OntModel loadMemoryModel​(InputStream is,
                                                                        String url)
      • loadMemoryModel

        public static com.hp.hpl.jena.ontology.OntModel loadMemoryModel​(InputStream is,
                                                                        String url,
                                                                        boolean processImports)
        Load an ontology into memory. Use this type of model when fast access is critical and memory is available.
      • loadMemoryModel

        public static com.hp.hpl.jena.ontology.OntModel loadMemoryModel​(String url)
        Load an ontology into memory. Use this type of model when fast access is critical and memory is available.
        See Also:
        loadMemoryModel(String, String, boolean)
      • loadMemoryModel

        public static com.hp.hpl.jena.ontology.OntModel loadMemoryModel​(String url,
                                                                        @Nullable
                                                                        String cacheName)
      • loadMemoryModel

        public static com.hp.hpl.jena.ontology.OntModel loadMemoryModel​(String url,
                                                                        @Nullable
                                                                        String cacheName,
                                                                        boolean processImports)
        Load an ontology into memory. Use this type of model when fast access is critical and memory is available. If load from URL fails, attempt to load from disk cache under @cacheName.

        Uses OntModelSpec.OWL_MEM_TRANS_INF.

        Parameters:
        url - a URL where the OWL file is stored
        cacheName - unique name of this ontology, will be used to load from disk in case of failed url connection
      • hasChanged

        public static boolean hasChanged​(String cacheName)
      • getDiskCachePath

        public static File getDiskCachePath​(String name)
        Obtain the path for the ontology cache.