Commits

Sam Adams committed 98f8910

Fixes to crystal splash page

Comments (0)

Files changed (4)

crystallography-common/src/main/java/uk/ac/cam/ch/wwmm/chempound/crystal/rdf/CifDict.java

     public static final String NS = "http://www.xml-cml.org/dictionary/cif/";
 
 
-    public static final Property diffrnAmbientTemperature = m_model.createProperty(NS, "diffrnAmbientTemperature");
-    public static final Property chemicalFormulaMoiety = m_model.createProperty(NS, "chemicalFormulaMoiety");
-    public static final Property chemicalFormulaSum = m_model.createProperty(NS, "chemicalFormulaSum");
-    public static final Property chemicalFormulaWeight = m_model.createProperty(NS, "chemicalFormulaWeight");
+    public static final Property diffrnAmbientTemperature = m_model.createProperty(NS, "diffrn_ambient_temperature");
+    public static final Property chemicalFormulaMoiety = m_model.createProperty(NS, "chemical_formula_moiety");
+    public static final Property chemicalFormulaSum = m_model.createProperty(NS, "chemical_formula_sum");
+    public static final Property chemicalFormulaWeight = m_model.createProperty(NS, "chemical_formula_weight");
 
-    public static final Property symmetryCellSetting = m_model.createProperty(NS, "symmetryCellSetting");
-    public static final Property symmetrySpaceGroupNameHM = m_model.createProperty(NS, "symmetrySpaceGroupNameHM");
-    public static final Property symmetrySpaceGroupNameHall = m_model.createProperty(NS, "symmetrySpaceGroupNameHall");
+//    public static final Property symmetryCellSetting = m_model.createProperty(NS, "symmetry_cell_setting");
+    public static final Property spaceGroupCrystalSystem = m_model.createProperty(NS, "space_group_crystal_system");
+    public static final Property symmetrySpaceGroupNameHM = m_model.createProperty(NS, "space_group_name_h-m_alt");
+    public static final Property symmetrySpaceGroupNameHall = m_model.createProperty(NS, "space_group_name_hall");
 
-    public static final Property publContactAuthorName = m_model.createProperty(NS, "publContactAuthorName");
-    public static final Property publContactAuthorEmail = m_model.createProperty(NS, "publContactAuthorEmail");
-    public static final Property publSectionTitle = m_model.createProperty(NS, "publSectionTitle");
-    public static final Property publAuthorName = m_model.createProperty(NS, "publAuthorName");
+    public static final Property publContactAuthorName = m_model.createProperty(NS, "publ_contact_author_name");
+    public static final Property publContactAuthorEmail = m_model.createProperty(NS, "publ_contact_author_email");
+    public static final Property publSectionTitle = m_model.createProperty(NS, "publ_section_title");
+    public static final Property publAuthorName = m_model.createProperty(NS, "publ_author_name");
 
-    public static final Property journalNameFull = m_model.createProperty(NS, "journalNameFull");
-    public static final Property journalYear = m_model.createProperty(NS, "journalYear");
-    public static final Property journalVolume = m_model.createProperty(NS, "journalVolume");
-    public static final Property journalIssue = m_model.createProperty(NS, "journalIssue");
+    public static final Property journalNameFull = m_model.createProperty(NS, "journal_name_full");
+    public static final Property journalYear = m_model.createProperty(NS, "journal_year");
+    public static final Property journalVolume = m_model.createProperty(NS, "journal_volume");
+    public static final Property journalIssue = m_model.createProperty(NS, "journal_issue");
 
-    public static final Property refineLsRFactorGt = m_model.createProperty(NS, "refineLsRFactorGt");
-    public static final Property refineLsRFactorAll = m_model.createProperty(NS, "refineLsRFactorAll");
+    public static final Property refineLsRFactorGt = m_model.createProperty(NS, "refine_ls_r_factor_gt");
+    public static final Property refineLsRFactorAll = m_model.createProperty(NS, "refine_ls_r_factor_all");
 
-    public static final Property refineLsWrFactorGt = m_model.createProperty(NS, "refineLsWrFactorGt");
-    public static final Property refineLsWrFactorRef = m_model.createProperty(NS, "refineLsWrFactorRef");
+    public static final Property refineLsWrFactorGt = m_model.createProperty(NS, "refine_ls_wr_factor_gt");
+    public static final Property refineLsWrFactorRef = m_model.createProperty(NS, "refine_ls_wr_factor_ref");
 
     public static final Property z = m_model.createProperty(NS, "z");
     public static final Property zPrime = m_model.createProperty(NS, "zPrime");

crystallography-handler/src/main/resources/uk/ac/cam/ch/wwmm/chempound/templates/crystal/crystal.ftl

             <dt>Chemical formula moiety</dt>
             <dd property="${IUCR.chemicalFormulaMoiety}">${cryst.getString(IUCR.chemicalFormulaMoiety)!}</dd>
             <dt>Crystal system</dt>
-            <dd property="${IUCR.symmetryCellSetting}">${cryst.getString(IUCR.symmetryCellSetting)!}</dd>
+            <dd property="${IUCR.symmetryCellSetting}">${cryst.getString(IUCR.spaceGroupCrystalSystem)!}</dd>
             <dt>Space group H-M</dt>
             <dd property="${IUCR.symmetrySpaceGroupNameHM}">${cryst.getString(IUCR.symmetrySpaceGroupNameHM)!}</dd>
             <dt>Space group Hall</dt>

crystallography-importer/src/main/java/uk/ac/cam/ch/wwmm/chempound/crystal/importer/CrystalCml2RdfConverter.java

         for (int i = 0; i < formulaElements.size(); i++) {
             CMLFormula formula = (CMLFormula)formulaElements.get(i);
             String dictRef = formula.getDictRef();
-            String alteredDictRef = createIucrPredicate(getDictRefPostfix(dictRef));
-            Property prop = model.createProperty(CifDict.NS, alteredDictRef);
-            thisCryst.addProperty(prop, model.createTypedLiteral(formula.getInline(), XSDDatatype.XSDstring));
+            if (dictRef.startsWith("iucr:")) {
+                Property prop = model.createProperty(CifDict.NS, dictRef.substring(5));
+                thisCryst.addProperty(prop, model.createTypedLiteral(formula.getInline(), XSDDatatype.XSDstring));
+            }
         }
 
         List<Node> arrays = CMLUtil.getQueryNodes(experimentModule, ".//cml:array[@dictRef]", CML_XPATH);

crystallography-test-harness/src/test/java/uk/ac/cam/ch/wwmm/chempound/crystal/CrystalIntegrationTest.java

         CrystalStructureImporter importer = new CrystalStructureImporter();
         DefaultContentLoadRequest request = importer.generateDepositRequest(cif, "wn2432");
 
-        for (AggregatedResource r : request.getAggregatedResources()) {
-            File f = new File(r.getUri().toString());
-            FileUtils.copyInputStreamToFile(r.openInputStream(), f);
-        }
-
         Model model = request.getMetadataModel();
         CrystalStructure crystalStructure = new CrystalStructure(model.getResource(""));
         assertTrue(crystalStructure.listProperties().hasNext());