add Repository

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

add Repository

Daniele De Santis-2
Hi,
 
I use Protégé OWL API to add a Repository and I use this:
 
owlModel.getRepositoryManager().addProjectRepository( 
      new  RelativeFolderRepository(new URL("<A href='http://ai-nlp.info.uniroma2.it/owl-ontologies/reportbase.owl"),"./plugins/it.uniroma2.info.ai-nlp.GeneraReport/bin/'>http://ai-nlp.info.uniroma2.it/owl-ontologies/reportbase.owl"),"./plugins/it.uniroma2.info.ai-nlp.GeneraReport/bin/")  
                                                                       //this is the ontology URI                  ,         this is the location of the ontology who is in $(Protégédir)/plugins/it.uniroma2.info.ai-nlp.GeneraReport/bin/
);
 
 
when I try to import the ontology in this way:
try{
ImportHelper importHelper = new ImportHelper((JenaOWLModel)owlModel);
         importHelper.addImport(new URI("http://ai-nlp.info.uniroma2.it/owl-ontologies/reportbase.owl"));
         owlModel.getNamespaceManager().setPrefix("http://ai-nlp.info.uniroma2.it/owl-ontologies/reportbase.owl#", "report");
           
         importHelper.importOntologies();
}catch (.....){}
 
Protégé tell me to add a Repository, because "Unresolved import":
 
I click on Cancel and I see this in the OWL Repository:
 
 
I save the project and when I reopen it , I don't have problem :|
 
I want to use RelativeFolderRepository because I want to import the file which is in the plugin directory within specify the path, but only using ./plug... a relative path
Reply | Threaded
Open this post in threaded view
|

Re: add Repository

Massimo Coletti
Ciao Daniele,

I think that yous should select [Add Repository] in the "Unresolved
Import" dialog, and there select the relative folder. This is a behavior
that happens when you open a project for the first time with 3.2 beta.

buon lavoro!

Massimo

Daniele De Santis ha scritto:

> Hi,
>  
> I use Protégé OWL API to add a Repository and I use this:
>  
> owlModel.getRepositoryManager().addProjectRepository(
>       new  RelativeFolderRepository(new
> URL("http://ai-nlp.info.uniroma2.it/owl-ontologies/reportbase.owl"),"./plugins/it.uniroma2.info.ai-nlp.GeneraReport/bin/
> <http://ai-nlp.info.uniroma2.it/owl-ontologies/reportbase.owl%22%29,%22./plugins/it.uniroma2.info.ai-nlp.GeneraReport/bin/>")  
>                                                                        
> //this is the ontology URI                  ,         this is the
> location of the ontology who is in
> $(Protégédir)/_plugins/it.uniroma2.info.ai-nlp.GeneraReport/bin/_
> );
>  
>  
> when I try to import the ontology in this way:
> try{
> ImportHelper importHelper = new ImportHelper((JenaOWLModel)owlModel);
>          importHelper.addImport(new
> URI("http://ai-nlp.info.uniroma2.it/owl-ontologies/reportbase.owl"));
>          
> owlModel.getNamespaceManager().setPrefix("http://ai-nlp.info.uniroma2.it/owl-ontologies/reportbase.owl#",
> "report");
>            
>          importHelper.importOntologies();
> }catch (.....){}
>  
> Protégé tell me to add a Repository, because "Unresolved import":
>  
> I click on Cancel and I see this in the OWL Repository:
>  
>  
> I save the project and when I reopen it , I don't have problem :|
>  
> I want to use RelativeFolderRepository because I want to import the
> file which is in the plugin directory within specify the path, but
> only using ./plug... a relative path

-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html

Reply | Threaded
Open this post in threaded view
|

Re: add Repository

Nick Drummond
Daniele,

The relative folder is relative to the base URL you have specified. In
the GUI this base is defined by your current working directory (wherever
you project file is - this is why you cannot use this repository type
until after a save)

public RelativeFolderRepository(URL baseURL, String relativeURL)

So there is probably no advantage using this over a LocalFolderRepository.

You can get the owl plugin folder for this protege installation using
the following and work relative to that.
File pluginsfolder = ProtegeOWL.getPluginFolder();

Or the base protege installation directory from:
File protegefolder = ApplicationProperties.getApplicationDirectory();

Nick

Massimo Coletti wrote:

> Ciao Daniele,
>
> I think that yous should select [Add Repository] in the "Unresolved
> Import" dialog, and there select the relative folder. This is a
> behavior that happens when you open a project for the first time with
> 3.2 beta.
>
> buon lavoro!
>
> Massimo
>
> Daniele De Santis ha scritto:
>
>> Hi,
>>  
>> I use Protégé OWL API to add a Repository and I use this:
>>  
>> owlModel.getRepositoryManager().addProjectRepository(       new  
>> RelativeFolderRepository(new
>> URL("http://ai-nlp.info.uniroma2.it/owl-ontologies/reportbase.owl"),"./plugins/it.uniroma2.info.ai-nlp.GeneraReport/bin/
>> <http://ai-nlp.info.uniroma2.it/owl-ontologies/reportbase.owl%22%29,%22./plugins/it.uniroma2.info.ai-nlp.GeneraReport/bin/>")  
>>                                                                        
>> //this is the ontology URI                  ,         this is the
>> location of the ontology who is in
>> $(Protégédir)/_plugins/it.uniroma2.info.ai-nlp.GeneraReport/bin/_
>> );
>>  
>>  
>> when I try to import the ontology in this way:
>> try{
>> ImportHelper importHelper = new ImportHelper((JenaOWLModel)owlModel);
>>          importHelper.addImport(new
>> URI("http://ai-nlp.info.uniroma2.it/owl-ontologies/reportbase.owl"));
>>          
>> owlModel.getNamespaceManager().setPrefix("http://ai-nlp.info.uniroma2.it/owl-ontologies/reportbase.owl#",
>> "report");
>>                     importHelper.importOntologies();
>> }catch (.....){}
>>  
>> Protégé tell me to add a Repository, because "Unresolved import":
>>  
>> I click on Cancel and I see this in the OWL Repository:
>>  
>>  
>> I save the project and when I reopen it , I don't have problem :|
>>  
>> I want to use RelativeFolderRepository because I want to import the
>> file which is in the plugin directory within specify the path, but
>> only using ./plug... a relative path
>
>
> -------------------------------------------------------------------------
> To unsubscribe go to http://protege.stanford.edu/community/subscribe.html
>
>

--

Nick Drummond

http://www.cs.man.ac.uk/~drummond/ <http://www.cs.man.ac.uk/%7Edrummond/>
-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html