sadnanalmanir/SQLTemplateQueryManager
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
IMPORTANT: The file "HAI_no_Illegal_Symbols.ontology.cnf.tptp" is basically the translated ontology expressed
into tptp syntax by the so called OWL2TPTP tool. Although here it is stored in resources, in fact it has to be
translated to tptp and stored by a separate java application
#This program copies all necessary files
"vkernel", "extensional_predicates.xml","answer_predicates.xml",
"tohdw_haio_semantic_map.fof.tptp","HAI_no_Illegal_Symbols.ontology.cnf.tptp",
"predicate_views.xml","PredicateViews.xsd"
into a temporary directory System.getProperty("java.io.tmpdir").concat("/SQLTemplateDir") i.e. /tmp/SQLTemplateDir.
This program completes two tasks:
#1. Run command on VampirePrime vkernel to generate schematic answers to the tptp query and write themn
in answer_predicates.xml file. The files to be copied are denoted by binFile (vkernel) and resources (rest of the
above in order). The first four resource files to be used and the command line can be found in ExecutionEngine.java.
If the files are not found, check the path System.getProperty("java.io.tmpdir").concat("/SQLTemplateDir") in
ExecutionEngine and IOUtil java files.
#2. Using external jars (CusionJE, derby, JSAP-2.0a, LogicWarehouseJE, mysql-connector-java-5.0.8-bin), SAILQueryManager
with its bunch of auxiliary java files, reads answer_predicates.xml input passed as a String parameter,
reads (unmarshal) /tmp/predicate_views.xml based on the schema file /tmp/PredicateViews.xsd and generates the SQL qurey.
If the files are not found, check the path of schema in Parser.java file and args in SAILQueryManager.java for the
System.getProperty("java.io.tmpdir").concat("/SQLTemplateDir")+"/"+predicate_views.xml. This way answer_predicates.xml
need NOT be written into the /tmp/SQLTemplateDir directory, rather it can be read as a String directly.
The SQL queries are generated by the block based on the args option ("--output-xml on" or "--output-xml off")
set at the top of the method in SAILQueryManager.java:
// print the sql as xml with reference to the schematic answers
if (outputXML.equals("on"))
System.out.println(q.toStringAsXML());
// print the sql as plain text with reference to the schematic answers
if (outputXML.equals("off"))
System.out.println(q.toString());
// print only the query text
if (outputXML.equals("off"))
System.out.println(q.queryText());
If you want only one of the last two types, disable the other.