Anonymous avatar Anonymous committed 82feb14

Rationalised names to match the changes to the compchem convention.

Comments (0)

Files changed (8)

compchem-common/src/main/java/net/chempound/compchem/rdf/CompChemCalculation.java

     
     String getHostname();
     
-    //FIX
-    String getJobTitle();
-    
     String getPackageName();
     
     String getPackageVersion();
 
 
     // Initialization Module
-    String getBasis();
+    String getBasisSetLabel();
     
     Double getCharge();
     
-    String getDftFunctional();
+    String getDftFunctionalLabel();
     
     String getFormula();
     
 
     String getTask();
 
-    String getWavefunction();
+    String getWavefunctionType();
 
     // Finalization Module
-
     Double getFinalEnergy();
+    
 //  boolean hasDiople();
 //  boolean hasMultipole();
 //  boolean hasVirtualorbs();

compchem-common/src/main/java/net/chempound/compchem/rdf/impl/CompChemCalculationImpl.java

         return getPropertyStringValue(CompChem.hostname);
     }
     
-    //FIX
-    @Override
-    public String getJobTitle() {
-        return getPropertyStringValue(CompChem.jobtitle);
-    }
-    
     @Override
     public String getPackageName() {
-        return getPropertyStringValue(CompChem.packageName);
+        return getPropertyStringValue(CompChem.program);
     }
 
     @Override
     public String getPackageVersion() {
-        return getPropertyStringValue(CompChem.packageVersion);
+        return getPropertyStringValue(CompChem.programVersion);
     }
 
     @Override
     
     // Initialization Module
     @Override
-    public String getBasis() {
-        return getPropertyStringValue(CompChem.basis);
+    public String getBasisSetLabel() {
+        return getPropertyStringValue(CompChem.basisSetLabel);
     }
     
     @Override
     }
     
     @Override
-    public String getDftFunctional() {
-        return getPropertyStringValue(CompChem.dftFunctional);
+    public String getDftFunctionalLabel() {
+        return getPropertyStringValue(CompChem.dftFunctionalLabel);
     }
     
     @Override
     }
 
     @Override
-    public String getWavefunction() {
-        return getPropertyStringValue(CompChem.wavefunction);
+    public String getWavefunctionType() {
+        return getPropertyStringValue(CompChem.waveFunctionType);
     }
 
 

compchem-common/src/main/java/net/chempound/compchem/rdf/ont/CompChem.java

     // Environment Module
     
     public static final Property hostname = m_model.createProperty(NS + "hostname");
-    // FIX
-    public static final Property jobtitle = m_model.createProperty(NS + "title");
 
-    public static final Property packageName = m_model.createProperty(NS + "program");
+    public static final Property program = m_model.createProperty(NS + "program");
 
-    public static final Property packageVersion = m_model.createProperty(NS + "program_version");
+    public static final Property programVersion = m_model.createProperty(NS + "programVersion");
 
-    public static final Property runDate = m_model.createProperty(NS + "date");
+    public static final Property runDate = m_model.createProperty(NS + "runDate");
     
     public static final Property title = m_model.createProperty(NS + "title");
 
     
     // Initialization Module
-    public static final Property basis = m_model.createProperty(NS + "basis");
+    public static final Property basisSetLabel = m_model.createProperty(NS + "basisSetLabel");
     
     public static final Property charge = m_model.createProperty(NS + "charge");
     
-    public static final Property dftFunctional = m_model.createProperty(NS + "dftFunctional");
+    public static final Property dftFunctionalLabel = m_model.createProperty(NS + "dftFunctionalLabel");
     
     // public static final Property electronicState = m_model.createProperty(NS + "electronicstate");
     
     
     public static final Property method = m_model.createProperty(NS + "method");
     
-    public static final Property pointGroup = m_model.createProperty(NS + "pointgroup");
+    public static final Property pointGroup = m_model.createProperty(NS + "pointGroup");
     
     public static final Property task = m_model.createProperty(NS + "task");
 
-    public static final Property wavefunction = m_model.createProperty(NS + "wavefunction_type");
+    public static final Property waveFunctionType = m_model.createProperty(NS + "wavefunctionType");
     
     
    // Finalization Module
-    
-    public static final Property nuclearEnergy = m_model.createProperty(NS + "nuclear_repulsion_energy");
-
-    public static final Property totalEnergy = m_model.createProperty(NS + "total_energy");
+    public static final Property totalEnergy = m_model.createProperty(NS + "totalEnergy");
 
 //    public static final Property hasDipole = m_model.createProperty(NS + "hasDipole");
 //

compchem-handler/src/main/java/net/chempound/compchem/search/CompChemSearchProvider.java

         final CompChemSparqlBuilder queryString = new CompChemSparqlBuilder();
 
         processScalar(form, METHOD, CompChem.method, queryString);
-        processScalar(form, BASIS, CompChem.basis, queryString);
+        processScalar(form, BASIS, CompChem.basisSetLabel, queryString);
         processScalar(form, POINT_GROUP, CompChem.pointGroup, queryString);
         processDouble(form, TOTAL_ENERGY, TOTAL_ENERGY + OP, CompChem.totalEnergy, queryString);
         processInchi(form, INCHI, queryString);

compchem-handler/src/main/resources/net/chempound/compchem/templates/comp.ftl

         <dd>${calculation.task!"<i>unknown</i>"}</dd>
         <dt>Method</dt>
         <dd>${calculation.method!"<i>unknown</i>"}</dd>
+        <#if calculation.method == "dft" >
+            <dt>DFT Functional</dt>
+            <dd>${calculation.dftFunctional!"<i>unknown</i>"}</dd>
+        </#if>
         <dt>Basis Set</dt>
-        <dd>${calculation.basis!"<i>unknown</i>"}</dd>
+        <dd>${calculation.basisSetLabel!"<i>unknown</i>"}</dd>
     </dl>
 
 
         <dt>Point Group</dt>
         <dd>${calculation.pointGroup!"<i>unknown</i>"}</dd>
         <dt>Wavefunction</dt>
-        <dd>${calculation.wavefunction!"<i>unknown</i>"}</dd>
+        <dd>${calculation.wavefunctionType!"<i>unknown</i>"}</dd>
         <dt>Charge</dt>
         <dd>${calculation.charge!"<i>unknown</i>"}</dd>
 <!--
     <dl class="data">
         <dt>Hostname</dt>
         <dd>${calculation.hostname!"<i>unknown</i>"}</dd>
+        <#--
         <dt>Job title</dt>
         <dd>${calculation.jobTitle!"<i>unknown</i>"}</dd>
+        -->
         <dt>Run Date</dt>
         <dd>${calculation.runDate!"<i>unknown</i>"}</dd>
     </dl>

compchem-importer/src/main/java/net/chempound/compchem/CmlComp2RdfConverter.java

 //            if (finalization.query("cml:molecule/cml:atomArray/cml:atom/cml:property[@dictRef = 'cc:mulliken']", CML_XPATH).size() != 0) {
 //                thisCalculation.addLiteral(CompChem.hasMullikenPops, true);
 //            }
-            if (initialisation.query("cml:list[@dictRef='compchem:basis_set']/cml:scalar[@dictRef = 'compchem:basis_set_title']", CML_XPATH).size() != 0) {
-                thisCalculation.addLiteral(CompChem.basis,
-                        initialisation.query("cml:list[@dictRef='compchem:basis_set']/cml:scalar[@dictRef = 'compchem:basis_set_title']/text()",CML_XPATH).get(0).getValue());
+            if (initialisation.query("cml:list[@dictRef='compchem:basisSet']/cml:scalar[@dictRef = 'compchem:basisSetLabel']", CML_XPATH).size() != 0) {
+                thisCalculation.addLiteral(CompChem.basisSetLabel,
+                        initialisation.query("cml:list[@dictRef='compchem:basisSet']/cml:scalar[@dictRef = 'compchem:basisSetLabel']/text()",CML_XPATH).get(0).getValue());
             }
-            if (initialisation.query("cml:list[@dictRef='compchem:dft_functional']/cml:scalar[@dictRef = 'compchem:dft_functional_title']", CML_XPATH).size() != 0) {
-                thisCalculation.addLiteral(CompChem.dftFunctional,
-                        initialisation.query("cml:list[@dictRef='compchem:dft_functional']/cml:scalar[@dictRef = 'compchem:dft_functional_title']/text()",CML_XPATH).get(0).getValue());
+            if (initialisation.query("cml:list[@dictRef='compchem:dftFunctional']/cml:scalar[@dictRef = 'compchem:dftFunctionalLabel']", CML_XPATH).size() != 0) {
+                thisCalculation.addLiteral(CompChem.dftFunctionalLabel,
+                        initialisation.query("cml:list[@dictRef='compchem:dftFunctional']/cml:scalar[@dictRef = 'compchem:dftFunctionalLabel']/text()",CML_XPATH).get(0).getValue());
             }
         }
 

compchem-importer/src/test/java/net/chempound/compchem/GaussianImporterTest.java

         CompChemCalculation calc = model.getResource("").as(CompChemCalculation.class);
 
         assertEquals("Gaussian 03", calc.getPackageName());
-//        assertEquals("x86-Linux-G03RevB.04", calc.getPackageVersion());
+        assertEquals("x86-Linux-G03RevB.04", calc.getPackageVersion());
 
         assertEquals("RB3LYP", calc.getMethod());
-// Need to update model with basis set
-//        assertEquals("6-31G(d)", calc.getBasis());
+        assertEquals("6-31G(d)", calc.getBasisSetLabel());
 
         assertEquals("GINC-DEEPTHOUGHT", calc.getHostname());
 //        assertEquals("WWW-DATA", calc.getJobName());
-//        assertEquals("WWW-DATA", calc.getJobTitle());
-        assertEquals("Mon Nov 20 00:00:00 GMT 2006", calc.getRunDate());
+//        assertEquals("WWW-DATA", calc.getJobName());
+        assertEquals("20-Nov-2006", calc.getRunDate());
 
 //        assertEquals("CH4", calc.getFormula());
         assertEquals("TD", calc.getPointGroup());
 //        assertEquals("1-A1", calc.getElectronicState());
 
-//        assertNotNull(calc.getFinalEnergy());
-//        assertEquals(-40.5183892, calc.getFinalEnergy(), 0.0000001);
+        assertNotNull(calc.getFinalEnergy());
+        assertEquals(-40.5183892, calc.getFinalEnergy(), 0.0000001);
 
     }
 

compchem-importer/src/test/java/net/chempound/compchem/NWChemImporterTest.java

 
         assertEquals("scf", calc.getMethod());
         assertEquals("energy", calc.getTask());
-        assertEquals("6-31g*", calc.getBasis());
+        assertEquals("6-31g*", calc.getBasisSetLabel());
 
         assertEquals("jmhts-MacBook-Air.local", calc.getHostname());
-        assertEquals("HF SCF calculation on water with 6-31G* basis", calc.getJobTitle());
+        assertEquals("HF SCF calculation on water with 6-31G* basis", calc.getTitle());
         assertEquals("Sun Apr  1 13:56:19 2012", calc.getRunDate());
 
         assertEquals("H 2 O 1", calc.getFormula());
         assertEquals("C2v", calc.getPointGroup());
-        assertEquals("RHF", calc.getWavefunction());
+        assertEquals("RHF", calc.getWavefunctionType());
         assertEquals(0.0, calc.getCharge(), 0.1);
 
         assertNotNull(calc.getFinalEnergy());
         assertEquals("NWChem", calc.getPackageName());
         assertEquals("6.1", calc.getPackageVersion());
         
-        /* 
-         * Currently can't test this as the way we extract the MP2 method in the converters
-         * is a bit of a hack, so that both scf & mp2 are present in the parameter list. Need
-         * to add the if construct to the converters before we can do this properly.
-         */
-        
-        //assertEquals("mp2", calc.getMethod());
+        assertEquals("mp2", calc.getMethod());
         assertEquals("energy", calc.getTask());
-        assertEquals("3-21g", calc.getBasis());
+        assertEquals("3-21g", calc.getBasisSetLabel());
         
         assertEquals("jmhts-MacBook-Air.local", calc.getHostname());
-        assertEquals("MP2 calculation on benzene with 3-21g basis", calc.getJobTitle());
+        assertEquals("MP2 calculation on benzene with 3-21g basis", calc.getTitle());
         assertEquals("Sun Apr  1 14:08:47 2012", calc.getRunDate());
         
         assertEquals("C 6 H 6", calc.getFormula());
         assertEquals("D6h", calc.getPointGroup());
-        assertEquals("RHF", calc.getWavefunction());
+        assertEquals("RHF", calc.getWavefunctionType());
         assertEquals(0.0, calc.getCharge(), 0.1);
         
         assertNotNull(calc.getFinalEnergy());
         
         assertEquals("dft", calc.getMethod());
         assertEquals("geometry_optimization", calc.getTask());
-        assertEquals("sto-3g", calc.getBasis());
-        assertEquals("B3LYP", calc.getDftFunctional());
+        assertEquals("sto-3g", calc.getBasisSetLabel());
+        assertEquals("B3LYP", calc.getDftFunctionalLabel());
         
         assertEquals("jmhts-MacBook-Air.local", calc.getHostname());
-        assertEquals("DFT B3LYP calculation on water with STO-3G basis", calc.getJobTitle());
+        assertEquals("DFT B3LYP calculation on water with STO-3G basis", calc.getTitle());
         assertEquals("Wed Mar 28 22:51:21 2012", calc.getRunDate());
         
         assertEquals("H 2 O 1", calc.getFormula());
         assertEquals("C2v", calc.getPointGroup());
-        assertEquals("closed shell", calc.getWavefunction());
+        assertEquals("closed shell", calc.getWavefunctionType());
         assertEquals(0.0, calc.getCharge(), 0.1);
         
         assertNotNull(calc.getFinalEnergy());
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.