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] error calling getOntModel

Tania Tudorache tudorache at stanford.edu
Wed Jan 9 12:50:33 PST 2008


Steve,

Yes, it is possible by using a ProtegeJob [1].

A ProtegeJob is a piece of code that is executed on the server. The code 
in the run method is execute on the server. In [2] you will see an 
example (look for SaveChangeProjectJob) on how the changes project is 
saved remotely on the server.

In the run method you could do something like:

 Server server = Server.getInstance();
 Project project = server.getProject("MyRemoteProjectName");
project.save(errors)

I'll let Tim add more details.

Tania


[1]: 
http://protege.stanford.edu/doc/pdk/api/edu/stanford/smi/protege/util/ProtegeJob.html
[2]: 
http://smi-protege.stanford.edu/repos/protege/change-management/trunk/changesTab/src/edu/stanford/smi/protegex/changes/ui/ChangeMenu.java

Steve Wilder wrote:
> Tania,
>
> We have access to both the client and the server, is there a way to save
> the ontology from the server end?
>
> Steve
>
> Steve Wilder wrote:
>   
>> Tania,
>>
>> Is there any other way to save this model to a file?
>>
>> Steve
>>
>> Tania Tudorache wrote:
>>     
>>> Steve,
>>>
>>> getOntModel() is not supported in client-server mode in the current 
>>> Protege version. I do have the fix for this, but I did not have time to 
>>> test it enough and commit it.
>>>
>>> We have a very busy period, but I will try to add this fix in the first 
>>> beta release in this year.
>>>
>>> Tania
>>>
>>>
>>>
>>> Steve Wilder wrote:
>>>       
>>>> Hello,
>>>>
>>>> I have a client/server model in Protege 3.4 Build 122:
>>>>
>>>> RemoteProjectManager rpm = RemoteProjectManager.getInstance();
>>>> Project p = rpm.getProject(hostname, username, password, project, true);
>>>> KnowledgeBase kb = p.getKnowledgeBase();
>>>> OWLModel model = (OWLModel) kb;
>>>>
>>>> This model works fine for creating and retrieving data.
>>>>
>>>> What I would like to do is dump the contents of this ontology to a file,
>>>> the code I'm currently trying to use is this:
>>>>
>>>> model.save(new File("myfile.owl").toURI(), FileUtils.langXMLAbbrev, new
>>>> ArrayList());
>>>>
>>>> That code produces the following stack trace:
>>>>
>>>> used by: java.lang.ClassCastException: $Proxy1 cannot be cast to
>>>> edu.stanford.
>>>> smi.protege.model.framestore.InMemoryFrameDb
>>>>         at
>>>> edu.stanford.smi.protegex.owl.jena.triplestore.JenaTripleStore.listTriples(JenaTripleStore.java:54)
>>>>         at
>>>> edu.stanford.smi.protegex.owl.jena.protege2jena.Protege2Jena.copyTriples(Protege2Jena.java:90)
>>>>         at
>>>> edu.stanford.smi.protegex.owl.jena.protege2jena.Protege2Jena.fillModels(Protege2Jena.java:185)
>>>>         at
>>>> edu.stanford.smi.protegex.owl.jena.protege2jena.Protege2Jena.<init>(Protege2Jena.java:85)
>>>>         at
>>>> edu.stanford.smi.protegex.owl.jena.protege2jena.Protege2Jena.createOntModel(Protege2Jena.java:130)
>>>>         at
>>>> edu.stanford.smi.protegex.owl.jena.protege2jena.Protege2Jena.createOntModel(Protege2Jena.java:118)
>>>>         at
>>>> edu.stanford.smi.protegex.owl.jena.protege2jena.Protege2Jena.saveAll(Protege2Jena.java:370)
>>>>         at
>>>> edu.stanford.smi.protegex.owl.jena.JenaOWLModel.save(JenaOWLModel.java:352)
>>>> 													
>>>> Thanks,
>>>> Steve			
>>>>
>>>>
>>>>   
>>>> ------------------------------------------------------------------------
>>>>
>>>> _______________________________________________
>>>> protege-owl mailing list
>>>> protege-owl at lists.stanford.edu
>>>> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>>>>
>>>> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
>>>>   
>>>>         
>>> _______________________________________________
>>> protege-owl mailing list
>>> protege-owl at lists.stanford.edu
>>> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>>>
>>> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
>>>       
>> _______________________________________________
>> protege-owl mailing list
>> protege-owl at lists.stanford.edu
>> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>>
>> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
>>     
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> protege-owl mailing list
> protege-owl at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
>   




More information about the protege-owl mailing list