annajiat / mesh4x

Automatically exported from code.google.com/p/mesh4x
0 stars 0 forks source link

need to enhance rdf schema generation and build a comparator for 2 rdf schema #105

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Currently 2 rdf schema are compared by simply string matching. This is 
creating a problem in some situation when the user tries to sync two 
heterogeneous repository say Mysql and MsExcel.

Let's come up with a problem scenario. Say in mysql the table to sync 
contains a field name Age of type Integer. So, the sync operation, if 
MsExcel uses rdf schema from Mysql (this is for the first time when the 
msexcel file is not available) it works fine, but when MsExcel generates 
its own rdf schema (using method extractRDFSchema() in 
org.mesh4j.sync.adapters.msexcel.MsExcelToRDFMapping.java, version#930), 
it maps that integer type column/field to rdf long type. In fact the 
current implementation of msexcel rdf maps any numeric type (integer, 
long, double) to rdf long type because of the following code snippet.

...
 if(HSSFCell.CELL_TYPE_NUMERIC == cellType){
    if(HSSFDateUtil.isCellDateFormatted(cell)) {
     rdfSchema.addDateTimeProperty(cellName, cellName, "en");
    } else {
     rdfSchema.addLongProperty(cellName, cellName, "en");
    }
 }
...

We need to enhance the schema generation and also come up with a schema 
comparator to determine if 2 rdf schema from different repository are 
compatible for sync operation.

One solution may be we can do the following equality mapping to compare 2 
rdf schema:

 < rdf1 >-------< rdf2 >
-------------------------

 String >-------< String

   date >-------< date

boolean >-------< boolean

integer \_______/ integer
   long /   \ long

  float \_______/ float
 double /   \ double

Original issue reported on code.google.com by auni.ku@gmail.com on 7 May 2009 at 5:28

GoogleCodeExporter commented 9 years ago

Original comment by jtondato@gmail.com on 19 May 2009 at 1:17