3

I have an ontology file developed with Protege that I need to convert into MySQL database to represent it on a website. Could you please suggest me the easiest way to do that?

I tried to follow Protege's wiki, but no success.

https://protegewiki.stanford.edu/wiki/ConvertToDBScript

I am constantly getting an error, even though I've tried to change build config ,so patches match windows "\" slash.

Fail Image...

Thanks in advance

enter code here

<?xml version = "1.0" encoding = "utf-8"?>
<project name = "Convert OWL to DB" default = "run">    
   <property file="convert.properties"/>  
   <property name = "owl.path"         value = "edu.stanford.smi.protegex.owl"/>
   <property name = "owl.plugin.path"  value = "${protege.home}\plugins\${owl.path}"/>

   <!-- 
     #  ********** Finding Protege Libraries. *************
   -->

   <target name="checkProtegeHome">
       <condition property="protege.home.set">
           <available file="${protege.home}\protege.jar" type="file"/>
       </condition>
   </target>

   <target name="useProtegeHome" depends="checkProtegeHome" if="protege.home.set">
       <echo message="Using Protege Home = ${protege.home} to find protege jars"/>
       <property name="protege.lib" value="${protege.home}\protege.jar"/>
       <property name="protege.owl.lib" value="${protege.home}\plugins\${owl.path}\protege-owl.jar"/>
   </target>


    <target name = "checkProtegeLibs" depends="useProtegeHome">
      <condition property="libs.found">
        <and>
          <available file="${protege.lib}" type = "file"/>
          <available file="${protege.owl.lib}" type = "file"/>
        </and>
      </condition>
      <path id = "project.classpath">    
        <pathelement location = "${protege.lib}"/>
        <pathelement location = "${protege.home}\driver.jar"/>
        <fileset dir="${owl.plugin.path}"/>
        <pathelement location = "convertToDb.jar"/>
      </path>

    </target>

    <target name="checkProtegeLibsAndReport" depends="checkProtegeLibs"
            unless="libs.found">
      <echo message="Missing protege libraries.  You need to set "/>
      <echo message="the PROTEGE_HOME environment variable to a"/>
      <echo message="protege installation directory where the"/>
      <echo message="appropriate plugins have been installed."/>
      <echo message="Alternatively set the jar libs in local.properties (protege.lib=...)"/>
      <echo message="Use the -v option to ant to see what jars are missing."/>
      <fail message = "missing protege libraries"/>
    </target>


     <target name="run" depends="checkProtegeLibsAndReport">
            <java 
            fork="true" 
                dir="${protege.home}" 
                    classname="edu.stanford.smi.protegex.util.ConvertToDb"
                        maxmemory="${heap.size.max}">
                <classpath refid = "project.classpath"/>                
            <arg value="${convert.mode}"/>
            <arg value="${owl.file}"/>
            <arg value="${db.driver}"/>
            <arg value="${db.url}"/>                
            <arg value="${db.table}"/>
            <arg value="${db.user}"/>
            <arg value="${db.password}"/>
            </java>
     </target>

</project>
Alex2452
  • 324
  • 1
  • 10
  • [Some theory](http://www.isca.in/rjrs/archive/v4/i4/12.ISCA-RJRS-2013-488.pdf). [Protégé plugin](https://protegewiki.stanford.edu/wiki/OWL2ToRDB). – Stanislav Kralin Jun 27 '17 at 08:12
  • not working for me for some reason, I just see a blank window – Alex2452 Jun 27 '17 at 09:17
  • See [this link](https://www.laptopmag.com/articles/how-to-windows-10-command-prompt-copy) for copying/pasting the error message. (Will help future readers get to this page.) – Blue Jun 27 '17 at 10:35
  • 1
    In which way do you wish to present the ontology on a web page? – Ignazio Jun 27 '17 at 18:49
  • I wanted to map .owl into MySQL relational database, then convert 4 main classes into separate post types that will represent the rest of the data. – Alex2452 Jun 28 '17 at 05:28

0 Answers0