Search Mailing List Archives

Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] Resources downloaded via internet

Timothy Redmond tredmond at
Tue Nov 23 08:29:39 PST 2010

> I would really like to make my application not having to depend on 
> being connected to the internet (or that the 3rd party servers are up, 
> for that matter).

Yes - this is an important and standard requirement.  The answer is to 
use repositories.  Repositories tell Protege where to find copies of 
imported files.

I think that these particular ontologies are all included in the 
standard Protege repositories so I will include using this as one of my 
options.  There are three ways to arrange that you use the appropriate 

Method 1: you can use a creator and explicitly set up the repository 
programatically.  Thus I tested the following code:

     public static void main(String[] args) throws OntologyLoadException {
         OwlProjectFromUriCreator creator = new OwlProjectFromUriCreator();
         LocalFolderRepository repository = new LocalFolderRepository(new File("/home/tredmond/Shared/ontologies/Epoch0.97"), true, true);
         List errors = new ArrayList();
         if (!errors.isEmpty()) {
             throw new RuntimeException("Ontology load failed");
         OWLModel model = creator.getOwlModel();

Sorry for the explicit paths but Epoch is an ontology with many 
imports.  This method of loading the ontology loaded the imports from 
the file system.

Method 2: you can first open the project in Protege and set up the 
repositories in Protege.   When this process is done you will have a 
pprj file and a .repository file.  Then you can open the Project 

    Project p = new Project("...path...");
    OWLModel model = (OWLModel) p.getKnowledgeBase();

Method 3:  In your case I think that this will also work.  If your 
application can somewhere include a Protege distribution then setting 
the protege.dir system variable to point to that location will find the 
standard Protege repositories.  What happens is that it looks in the 

    ...protege distribution.../plugins/edu.stanford.smi.protegex.owl

to find the needed repositories.


On 11/23/2010 01:06 AM, Jon Vassbø wrote:
> Hello,
> I am creating a java application that uses protege and protege-owl 
> libraries (version 3.4.4) for connecting to a Protege instance.
> I have noticed that during Ontology loading, several files are 
> requested via internet in the method 
> AbstractOWLModel.loadImportedAssertions(), more specifically:
> Is there any way to avoid this, and storing these resources locally? I 
> see that the URLs are hardcoded in several java classes, which makes 
> me worry that there is no way around this...
> I would really like to make my application not having to depend on 
> being connected to the internet (or that the 3rd party servers are up, 
> for that matter).
> Any help greatly appreciated!
> -
> Jon Vassbo
> _______________________________________________
> protege-owl mailing list
> protege-owl at
> Instructions for unsubscribing:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the protege-owl mailing list