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-discussion] Convert Project ( Data in Database ) to format xml-rdf.owl

Tania Tudorache tudorache at stanford.edu
Wed Feb 7 10:36:52 PST 2007


Julien,

So you have a frames project and want to export it as an OWL file, right?

You can use the same code as the one in the method:

edu.stanford.smi.protegex.owl.jena.export.JenaExportPlugin.exportProject(KnowledgeBase, 
String)


You can see the JenaExportPlugin source code here:

http://smi-protege.stanford.edu/svn/owl/trunk/src/edu/stanford/smi/protegex/owl/jena/export/JenaExportPlugin.java?rev=1640&view=markup

Tania




julien lejeune wrote:
> Hi,
>
> I'm trying to convert my project to format xml-rdf.owl.
> I would like only extract data from the database schema of my project 
> and create a file <myproject>.xml-rdf.owl.
>
> In the opposite of the function in the protege menu ( File > Convert 
> project to format ... language = XML/RDF ) I don't want to transform 
> my project on OWL project.
>
> I already try this code :
>             ArrayList errors = new ArrayList();
>            
>             JenaOWLModel owlModel = ProtegeOWL.createJenaOWLModel();
>             JenaKnowledgeBaseFactory factory = 
> (JenaKnowledgeBaseFactory)owlModel.getKnowledgeBaseFactory();
>             project.setKnowledgeBaseFactory(factory);
>             project.createDomainKnowledgeBase(factory,errors,false);
>             JenaOWLModel model = (JenaOWLModel) 
> project.getKnowledgeBase();
>             try {
>                 com.hp.hpl.jena.ontology.OntModel jena = 
> model.getOntModel();
>                 try {
>        
>                     FileOutputStream stream = new 
> FileOutputStream(_strOutputFileRep+"/"+project.getName()+".rdf- xml.owl");
>                     jena.write(stream, "RDF/XML");
>                     stream.close();
>                 } catch (IOException ioe) {
>                     ioe.printStackTrace();
>                 }
>             }
>
> But my file <myproject>.rdf-xml.owl is quite empty ( 1 Ko ). There is 
> only the header of an OWL file :
> <rdf:RDF
>     xmlns:rdf=" http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
>     xmlns:rdfs=" http://www.w3.org/2000/01/rdf-schema#"
>     xmlns:owl="http://www.w3.org/2002/07/owl#"
>     xmlns=" http://www.owl-ontologies.com/unnamed.owl#" >
>   <rdf:Description rdf:about="http://www.owl-ontologies.com/unnamed.owl">
>     <rdf:type rdf:resource=" http://www.w3.org/2002/07/owl#Ontology"/>
>   </rdf:Description>
> </rdf:RDF>
>
> And I have warnings in the DOS windows :
> WARNING : unknown class : mapping set -- Project.loadWidgetDescriptors()
>
> WARNING : unknown class : APPLICATIONS -- Project.loadWidgetDescriptors()
>
> WARNING : unknown class : DOCUMENTS  -- Project.loadWidgetDescriptors()
>
> WARNING : unknown class : INFORMATIONS -- Project.loadWidgetDescriptors()
>
> etc ... (for all classes)
>
>
> Can somebody give me more informations about this subject?
>
> Thanks
>
> Julien
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> protege-discussion mailing list
> protege-discussion at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
>   




More information about the protege-discussion mailing list