ontolog-forum
[Top] [All Lists]

Re: [ontolog-forum] Ontology-driven software for querying facts in tempo

To: "[ontolog-forum]" <ontolog-forum@xxxxxxxxxxxxxxxx>
From: Piotr Nowara <piotrnowara@xxxxxxxxx>
Date: Fri, 16 Nov 2012 10:57:45 +0100
Message-id: <CAGWzwsb+zuDECL1saVmZS7CjNENZWQEr3NJHXzOij0oCWXPjKw@xxxxxxxxxxxxxx>
Duane,

as you have noticed the transformation is based on processing the strings with a set of regular expressions - in this case OWL axioms are being transformed into text form (Manchester Syntax) by OWL-API. I have decided to use text processing because I wanted my software to be also capable of processing definitions  from sources other than OWL files.

The hard coded part you mentioned contains the base structure of a SQL query with placeholders for mappings provided by the user in a configuration file - for example {TABLE_NAME} is a placeholder for a name of a database table corresponding to a given type of fact defined in the ontology to be substituted during the transformation. The data can be spread across many tables, e.g. one can specify that "Medical procedure" should be mapped to TABLE_A and "Medical diagnosis" to TABLE_B. 

It is also possible to configure mappings for different participants, e.g. relations ”occurs for the same patient between 3 and 5 days before” and “occurs for the same healthcare provider between 3 and 5 days before” can be configure to be produce additional relation-specific SQL conditions like “TABLE_A.PATIENT_ID = TABLE_B.PATIENT_ID”, “TABLE_A.PROVIDER_ID = TABLE_B.PROVIDER_ID”. An configuration file looks like this:

#DomainPropertyMapping-[OWL property name]=table name, column name,[optional parameter for using “LIKE” operator instead default  “=”]
DomainPropertyMapping-medical_procedure_ICD9_code=CODE,ICD9,H 
DomainPropertyMapping-indicated_ICD10_code=CODE,ICD10
DomainPropertyMapping-issued_drug_ATC_code=ATCCODE,DRUGS
DomainPropertyMapping-issued_drug_EAN_code=EANCODE,DRUGS

#DomainPropertyMapping-[OWL class name]=table name
DomainClassMapping-Drug_issuance=DRUGS
DomainClassMapping-Medical_procedure=ICD9
DomainClassMapping-Diagnosis_indication=ICD10
#Specifies the database column to use for date comparisons DateColumn=DATA

#AdditionalCondition-[OWL property name]=column name
AdditionalCondition-healthcare_provider=PROVIDER_ID
AdditionalCondition-patient=PATIENT_ID

#Specifies SQL dialect
SQLType=DB2



In short a deployment scenario looks like this:
1. Creating or choosing a domain ontology
2. Configuring mappings and preparing configuration file.
3. Installing Protégé plugin.

Best regards,

Piotr Nowara


2012/11/16 Duane Nickull <duane@xxxxxxxxxxxxxxxxxxxxxxx>
Peter:

This might be a topic to take offline.  I don't know if the conveners of
the Ontolog Forum ever actually made an enumerated list of acceptable
licenses to define "open" or have passed judgement on them.

IMHO, MPL is fine but there are a host of others.

The only caveat I see here is that the license is declared at the
"project" level.  Assuming a hereditary model, that should cover all
pieces of the project but seasoned developers usually place the license
statement in each class or resource such as done here:

http://svn.apache.org/viewvc/webservices/commons/tags/axiom/1.2.13/src/main
/assembly/bin.xml?view=markup



I'd be willing to help on this if you wanted.

Duane Nickull
***********************************
Technoracle Advanced Systems Inc.
Consulting and Contracting; Proven Results!
i.  Neo4J, PDF, Java, LiveCycle ES, Flex, AIR, CQ5 & Mobile
b. http://technoracle.blogspot.com
t.  @duanechaos
"Don't fear the Graph!  Embrace Neo4J"






On 2012-11-15 3:16 PM, "Peter Yim" <peter.yim@xxxxxxxx> wrote:

>Thank you Duane, Jack and again, to Piotr ...
>
>[DN]  I trust that the MPL license is sufficient for Ontolog Forum to
>at least allow discussion here?
>
>[ppy] yes, indeed. In fact, if the code is licensed under anyone of
>the free software or open source licenses (and in the case of content,
>any open content license) would suffice.
>
>Regards. =ppy
>--
>
>
>On Thu, Nov 15, 2012 at 2:42 PM, Duane Nickull
><duane@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
>>
>> Hi:
>>
>> Jumping in late here.  I always look when there is code and it quite
>>clearly states that his code base is subject to the
>>
>> Code license
>> Mozilla Public License 1.1
>>
>> http://code.google.com/p/linked-facts/
>>
>> I also perused the main trunk and all the code is in fact open
>>(although Piotr, you may want to add a header to each source file with a
>>statement of license and link to help others understand this). I trust
>>that the MPL license is sufficient for Ontolog Forum to at least allow
>>discussion here?
>>
>> Assuming it is, the code project appears to be a way to map OWL to SQL.
>> The current code base does this with a lot of hard coded statement
>>constructors and is heavily string based.  Sample:
>>
>>   if(name.equals("occurs_before"))
>>                                 result = "SELECT 1 FROM {TABLE_NAME}
>>{Q2} WHERE "+(additionalCondition != null ? additionalCondition :
>>"")+"{Q1}.{DATE_FIELD} < {Q2}.{DATE_FIELD} ";
>>                         else if(!name.contains("_day"))
>>                                 throw new
>>OwlToSqlTransformationException("Unsupported time unit of a temporal
>>object property: "+name);
>>                         else if(name.contains("between"))
>>                                 result = "SELECT 1 FROM {TABLE_NAME}
>>{Q2} WHERE "+(additionalCondition != null ? additionalCondition :
>>"")+"("+conf.getDBSpecificDateDifference("{Q2}.{DATE_FIELD} -
>>{Q1}.{DATE_FIELD}")+" BETWEEN
>>"+TextProcessingUtils.parseNumberOfDaysBetween(name)+") ";
>>                         else if(name.startsWith("occurs_max"))
>>                                 result = "SELECT 1 FROM {TABLE_NAME}
>>{Q2} WHERE "+(additionalCondition != null ? additionalCondition :
>>"")+"("+conf.getDBSpecificDateDifference("{Q2}.{DATE_FIELD} -
>>{Q1}.{DATE_FIELD}")+" BETWEEN 1 AND
>>"+TextProcessingUtils.parseNumberOfDays(name)+") ";
>>                         else if(name.startsWith("occurs_min"))
>>                                 result = "SELECT 1 FROM {TABLE_NAME}
>>{Q2} WHERE "+(additionalCondition != null ? additionalCondition :
>>"")+conf.getDBSpecificDateDifference("{Q2}.{DATE_FIELD} -
>>{Q1}.{DATE_FIELD}")+" >= "+TextProcessingUtils.parseNumberOfDays(name)+"
>>";
>>                         else
>>if(name.substring(0,8).matches("occurs_[0-9]"))
>>                                 result = "SELECT 1 FROM {TABLE_NAME}
>>{Q2} WHERE "+(additionalCondition != null ? additionalCondition :
>>"")+conf.getDBSpecificDateDifference("{Q2}.{DATE_FIELD} -
>>{Q1}.{DATE_FIELD}")+" = "+TextProcessingUtils.parseNumberOfDays(name)+"
>>";
>>                         else
>>                                 throw new
>>OwlToSqlTransformationException("Unsupported temporal object property:
>>"+name);
>>                 }
>>
>> It looks like an interesting approach although I am not sure how
>>scalable it is the way it is factored.  I applaud someone actually
>>taking ontological concepts and writing code.
>>
>> YAMMV
>>
>> Duane Nickull
>>
>> ***********************************
>> Technoracle Advanced Systems Inc.
>> Consulting and Contracting; Proven Results!
>> i.  Neo4J, PDF, Java, LiveCycle ES, Flex, AIR, CQ5 & Mobile
>> b. http://technoracle.blogspot.com
>> t.  @duanechaos
>> "Don't fear the Graph!  Embrace Neo4J"
>
>
>On 14/11/2012 1:07 PM, Jack Park wrote:
>> Out of curiosity, is the link at the bottom
>> http://code.google.com/p/linked-facts/ the actual code being discussed
>> here?
>>
>> Jack
>
>_________________________________________________________________
>Message Archives: http://ontolog.cim3.net/forum/ontolog-forum/
>Config Subscr: http://ontolog.cim3.net/mailman/listinfo/ontolog-forum/
>Unsubscribe: mailto:ontolog-forum-leave@xxxxxxxxxxxxxxxx
>Shared Files: http://ontolog.cim3.net/file/
>Community Wiki: http://ontolog.cim3.net/wiki/
>To join: http://ontolog.cim3.net/cgi-bin/wiki.pl?WikiHomePage#nid1J
>



_________________________________________________________________
Message Archives: http://ontolog.cim3.net/forum/ontolog-forum/
Config Subscr: http://ontolog.cim3.net/mailman/listinfo/ontolog-forum/
Unsubscribe: mailto:ontolog-forum-leave@xxxxxxxxxxxxxxxx
Shared Files: http://ontolog.cim3.net/file/
Community Wiki: http://ontolog.cim3.net/wiki/
To join: http://ontolog.cim3.net/cgi-bin/wiki.pl?WikiHomePage#nid1J



_________________________________________________________________
Message Archives: http://ontolog.cim3.net/forum/ontolog-forum/  
Config Subscr: http://ontolog.cim3.net/mailman/listinfo/ontolog-forum/  
Unsubscribe: mailto:ontolog-forum-leave@xxxxxxxxxxxxxxxx
Shared Files: http://ontolog.cim3.net/file/
Community Wiki: http://ontolog.cim3.net/wiki/ 
To join: http://ontolog.cim3.net/cgi-bin/wiki.pl?WikiHomePage#nid1J    (01)

<Prev in Thread] Current Thread [Next in Thread>