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

julien lejeune lejeune.j at gmail.com
Wed Feb 7 07:16:07 PST 2007


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-discussion/attachments/20070207/0648b56e/attachment.html>


More information about the protege-discussion mailing list