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] Loading an OWL / RDF database project

Tania Tudorache tudorache at stanford.edu
Wed Sep 13 10:07:27 PDT 2006


Are you sure you are trying to open an OWL project (i.e. a pprj file)?

In the call:

Project prj = Project.loadProjectFromFile(file, errors);

"file" must be the path to the pprj file, not the owl file. So, it 
should look something like this:

Project prj = Project.loadProjectFromFile("c://tmp//foo.pprj", errors);

If you want to load the OWL file, then use the call:

 OWLModel owlModel = ProtegeOWL.createJenaOWLModelFromURI(uri);

The OWL developers guide is very helpful: http://protege.stanford.edu/plugins/owl/api/guide.html

Cheers,
Tania



katja wrote:

>I tried this code, but using  
>
>OWLModel owlModel = (OWLModel)prj.getKnowledgeBase();,
>
>I'm getting a ClassCastException
>(edu.stanford.smi.protege.model.DefaultKnowledgeBase). 
>What am I doing wrong?
>
>Katja
>
>
>
>
>Tania Tudorache wrote:
>  
>
>>Katja,
>>
>>This is true, it doesn't matter whether the ontology is stored in a file 
>>or in a database, the API used for accessing the ontology is the same.
>>You can get an OWLModel object by calling the
>>
>>Project prj = Project.loadProjectFromFile(file, errors);
>>OWLModel owlModel = (OWLModel)prj.getKnowledgeBase();
>>
>>You can call all Protege OWL API methods on the owlModel object. The above
>>methods work both for file and database backend.
>>
>>I hope this helps.
>>
>>Tania
>>
>>
>>
>>katja wrote:
>>
>>    
>>
>>>Hi, 
>>>
>>>I'm trying to load an OWL / RDF database project using the Protege OWL
>>>      
>>>
>API.
>  
>
>>>I tried 
>>>
>>>”Project prj = Project.loadProjectFromFile(file, errors)” 
>>>
>>>as suggested earlier to get the pprj file, but I don't know how to modify
>>>the ontology using the prj object. Don’t I need an instance of OWLModel to
>>>modify the Ontology? Is it possible to use the OWLDatabaseModel Class to
>>>load, change and save the ontology in the database? In the "The
>>>      
>>>
>Protégé-OWL
>  
>
>>>API - Programmer's Guide"
>>>(http://protege.stanford.edu/plugins/owl/api/guide.html) it is said that
>>>while using the OWL Files mode (class JenaOWLModel) or the OWL Database
>>>      
>>>
>mode
>  
>
>>>(class OWLDatabaseModel) which "both operate on the same core interface
>>>OWLModel", the "programmer does not have to care whether the class is
>>>physically created in a database or only kept in memory", but it isn't
>>>      
>>>
>said
>  
>
>>>how to use the class OWLDatabaseModel. 
>>>
>>>Thanks a lot!
>>>Katja
>>>
>>> 
>>>
>>>      
>>>
>>_______________________________________________
>>protege-owl mailing list
>>protege-owl at lists.stanford.edu
>>https://mailman.stanford.edu/mailman/listinfo/protege-owl
>>
>>
>>    
>>
>
>  
>




More information about the protege-owl mailing list