[Mapbender-commits] r9648 - in trunk/mapbender/http: classes geoportal/metadata_templates php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Jan 12 07:54:57 PST 2017


Author: armin11
Date: 2017-01-12 07:54:57 -0800 (Thu, 12 Jan 2017)
New Revision: 9648

Added:
   trunk/mapbender/http/geoportal/metadata_templates/mb_dataqualityreport.xml
Modified:
   trunk/mapbender/http/classes/class_iso19139.php
   trunk/mapbender/http/php/mod_dataISOMetadata.php
   trunk/mapbender/http/php/mod_layerISOMetadata.php
Log:
New possibility for generating conformancy declarations in iso19139 xml documents directly from an integrated inspire_legislation config file - make many things easier to maintain ;-)

Modified: trunk/mapbender/http/classes/class_iso19139.php
===================================================================
--- trunk/mapbender/http/classes/class_iso19139.php	2017-01-12 09:33:13 UTC (rev 9647)
+++ trunk/mapbender/http/classes/class_iso19139.php	2017-01-12 15:54:57 UTC (rev 9648)
@@ -2461,9 +2461,8 @@
 						return $result;
 					} else {
 						$this->insertKeywordsAndCategoriesIntoDB($metadataId,$resourceType,$resourceId);	
-						//inherit licence info and contact info from coupled service if this is wished so - that will override and/or extent the original metadata!!!
+						//inherit licence info and contact info from coupled service if this is wished so - that will override and/or extent the original metadata!!! 
 						$this->inheritContactAndLicenceInformation($metadataId,$resourceType,$resourceId,$inheritContactInfo,$inheritLicenceInfo);
-						
 						//TODO: if this was ok, let the resource (layer/featuretype) inherit the classification from the coupled metadata to support better catalogue search
 					}
 				} 
@@ -2471,9 +2470,8 @@
 			$result['value'] = true;
 			$result['message'] = "Insert metadata successfully into database!";
 			return $result;
-		}
-		
+		}	
 	}
-	
+
 }
 ?>

Added: trunk/mapbender/http/geoportal/metadata_templates/mb_dataqualityreport.xml
===================================================================
--- trunk/mapbender/http/geoportal/metadata_templates/mb_dataqualityreport.xml	                        (rev 0)
+++ trunk/mapbender/http/geoportal/metadata_templates/mb_dataqualityreport.xml	2017-01-12 15:54:57 UTC (rev 9648)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mb:dataqualityreport xmlns:mb="http://www.mapbender.org/metadata/dataqualityreport" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <gmd:report>
+    <gmd:DQ_DomainConsistency xsi:type="gmd:DQ_DomainConsistency_Type">
+      <gmd:result>
+        <gmd:DQ_ConformanceResult xsi:type="gmd:DQ_ConformanceResult_Type">
+          <gmd:specification>
+            <gmd:CI_Citation>
+              <gmd:title>
+                <gco:CharacterString>Verordnung (EG) Nr. 1205/2008 der Kommission vom 3. Dezember 2008 zur Durchführung der Richtlinie 2007/2/EG des Europäischen Parlaments und des Rates hinsichtlich Metadaten</gco:CharacterString>
+              </gmd:title>
+              <gmd:date>
+                <gmd:CI_Date>
+                  <gmd:date>
+                    <gco:Date>2008-12-04</gco:Date>
+                  </gmd:date>
+                  <gmd:dateType>
+                    <gmd:CI_DateTypeCode codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#CI_DateTypeCode" codeListValue="publication">publication</gmd:CI_DateTypeCode>
+                  </gmd:dateType>
+                </gmd:CI_Date>
+              </gmd:date>
+            </gmd:CI_Citation>
+          </gmd:specification>
+          <gmd:explanation>
+            <gco:CharacterString>No explanation available</gco:CharacterString>
+          </gmd:explanation>
+          <gmd:pass>
+            <gco:Boolean>false</gco:Boolean>
+          </gmd:pass>
+        </gmd:DQ_ConformanceResult>
+      </gmd:result>
+    </gmd:DQ_DomainConsistency>
+  </gmd:report>
+</mb:dataqualityreport>

Modified: trunk/mapbender/http/php/mod_dataISOMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_dataISOMetadata.php	2017-01-12 09:33:13 UTC (rev 9647)
+++ trunk/mapbender/http/php/mod_dataISOMetadata.php	2017-01-12 15:54:57 UTC (rev 9648)
@@ -32,6 +32,7 @@
 require_once(dirname(__FILE__) . "/../php/mod_validateInspire.php");
 require_once(dirname(__FILE__) . "/../classes/class_iso19139.php");
 require_once(dirname(__FILE__)."/../classes/class_owsConstraints.php"); 
+require_once(dirname(__FILE__)."/../classes/class_qualityreport.php");
 
 $con = db_connect(DBSERVER,OWNER,PW);
 db_select_db(DB,$con);
@@ -288,7 +289,7 @@
 				}
 			}
 		}
-		// licenses
+		//licenses
 		//pull licence information
 		$constraints = new OwsConstraints();
 		$constraints->languageCode = "de";
@@ -1625,13 +1626,7 @@
 	$LI_Lineage->appendChild($statement);
 	$statement->appendChild($statement_cs);
 	$statement_cs->appendChild($statementText);
-	
 
-	//gmd:report in dataQualityInfo
-	$gmd_report=$iso19139->createElement("gmd:report");
-	$DQ_DomainConsistency=$iso19139->createElement("gmd:DQ_DomainConsistency");
-        $DQ_DomainConsistency->setAttribute("xsi:type","gmd:DQ_DomainConsistency_Type");
-
 	//rs identifier - why?
 	//<gmd:measureIdentification>
 /*	$measureIdentification=$iso19139->createElement("gmd:measureIdentification");
@@ -1657,126 +1652,18 @@
 	$measureIdentification->appendChild($rs_identifier);
 */
 
+	//new from january 2017 - create conformance table from inspire_legislation config file - for interoperable datasets set all conformancy declarations to true for non interoperable set only the metadata conformance to true
+	//get conformancy declarations from class
+	$qualityReport = new QualityReport();
+	$inputXml = $qualityReport->getIso19139Representation("dataset", $md_metadata['inspire_interoperability']);
+	$reportDomObject = new DOMDocument();
+	$reportDomObject->loadXML($inputXml);
+	$xpathInput = new DOMXpath($reportDomObject);
+	$inputNodeList = $xpathInput->query('/mb:dataqualityreport/gmd:report');
+	for ($i = ($inputNodeList->length)-1; $i >= 0; $i--) {
+		$DQ_DataQuality->appendChild($iso19139->importNode($inputNodeList->item($i), true));
+	}
 
-	$gmd_result=$iso19139->createElement("gmd:result");
-	$DQ_ConformanceResult=$iso19139->createElement("gmd:DQ_ConformanceResult");
-        $DQ_ConformanceResult->setAttribute("xsi:type","gmd:DQ_ConformanceResult_Type");
-	$gmd_specification=$iso19139->createElement("gmd:specification");
-	$CI_Citation=$iso19139->createElement("gmd:CI_Citation");
-	$gmd_title=$iso19139->createElement("gmd:title");
-	$gmd_title_cs=$iso19139->createElement("gco:CharacterString");
-	$gmd_titleText=$iso19139->createTextNode("VERORDNUNG (EG) Nr. 1089/2010 DER KOMMISSION vom 23. November 2010 zur Durchführung der Richtlinie 2007/2/EG des Europäischen Parlaments und des Rates hinsichtlich der Interoperabilität von Geodatensätzen und -diensten"); //TODO put in the inspire test suites from mb database!
-	$gmd_date=$iso19139->createElement("gmd:date");
-	$CI_Date=$iso19139->createElement("gmd:CI_Date");
-	$gmd_date_2=$iso19139->createElement("gmd:date");
-	$gco_Date=$iso19139->createElement("gco:Date");
-	$gco_DateText=$iso19139->createTextNode("2010-12-08"); //TODO put in the info from database
-	
-	$gmd_dateType=$iso19139->createElement("gmd:dateType");
-	$CI_DateTypeCode=$iso19139->createElement("gmd:CI_DateTypeCode");
-	$CI_DateTypeCode->setAttribute("codeList","http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/codelist/ML_gmxCodelists.xml#CI_DateTypeCode");
-	$CI_DateTypeCode->setAttribute("codeListValue","publication");
-	$CI_DateTypeCodeText=$iso19139->createTextNode("publication");
-	
-	$gmd_explanation=$iso19139->createElement("gmd:explanation");
-	$gmd_explanation_cs=$iso19139->createElement("gco:CharacterString");
-	$gmd_explanationText=$iso19139->createTextNode("No explanation available");
-		
-	$gmd_pass=$iso19139->createElement("gmd:pass");
-	$gco_Boolean=$iso19139->createElement("gco:Boolean");
-	$gco_BooleanText=$iso19139->createTextNode("false"); //TODO maybe set here a string cause it can be unevaluated!! See Implementing Rules
-	//generate XML objects
-	$gco_Date->appendChild($gco_DateText);
-	$gmd_date->appendChild($gco_Date);
-	
-	$CI_DateTypeCode->appendChild($CI_DateTypeCodeText);
-	$gmd_dateType->appendChild($CI_DateTypeCode);
-	$CI_Date->appendChild($gmd_date);
-	$CI_Date->appendChild($gmd_dateType);
-	$gmd_date_2->appendChild($CI_Date);
-	$gmd_title_cs->appendChild($gmd_titleText);
-	$gmd_title->appendChild($gmd_title_cs);
-	$CI_Citation->appendChild($gmd_title);
-	$CI_Citation->appendChild($gmd_date_2);
-	$gmd_specification->appendChild($CI_Citation);
-	$gmd_explanation_cs->appendChild($gmd_explanationText);
-	$gmd_explanation->appendChild($gmd_explanation_cs);
-	$gco_Boolean->appendChild($gco_BooleanText);
-	$gmd_pass->appendChild($gco_Boolean);
-	$DQ_ConformanceResult->appendChild($gmd_specification);
-	$DQ_ConformanceResult->appendChild($gmd_explanation);
-	$DQ_ConformanceResult->appendChild($gmd_pass);
-
-//$DQ_DomainConsistency->appendChild($measureIdentification);
-
-	$gmd_result->appendChild($DQ_ConformanceResult);
-	$DQ_DomainConsistency->appendChild($gmd_result);
-
-	$gmd_report->appendChild($DQ_DomainConsistency);
-	$DQ_DataQuality->appendChild($gmd_report);
-
-	//next report
-	//gmd:report in dataQualityInfo
-	$gmd_report=$iso19139->createElement("gmd:report");
-	$DQ_DomainConsistency=$iso19139->createElement("gmd:DQ_DomainConsistency");
-        $DQ_DomainConsistency->setAttribute("xsi:type","gmd:DQ_DomainConsistency_Type");
-	$gmd_result=$iso19139->createElement("gmd:result");
-	$DQ_ConformanceResult=$iso19139->createElement("gmd:DQ_ConformanceResult");
-        $DQ_ConformanceResult->setAttribute("xsi:type","gmd:DQ_ConformanceResult_Type");
-	$gmd_specification=$iso19139->createElement("gmd:specification");
-	$CI_Citation=$iso19139->createElement("gmd:CI_Citation");
-	$gmd_title=$iso19139->createElement("gmd:title");
-	$gmd_title_cs=$iso19139->createElement("gco:CharacterString");
-	$gmd_titleText=$iso19139->createTextNode("Verordnung (EG) Nr. 1205/2008 der Kommission vom 3. Dezember 2008 zur Durchführung der Richtlinie 2007/2/EG des Europäischen Parlaments und des Rates hinsichtlich Metadaten"); //TODO put in the inspire test suites from mb database!
-	$gmd_date=$iso19139->createElement("gmd:date");
-	$CI_Date=$iso19139->createElement("gmd:CI_Date");
-	$gmd_date_2=$iso19139->createElement("gmd:date");
-	$gco_Date=$iso19139->createElement("gco:Date");
-	$gco_DateText=$iso19139->createTextNode("2008-12-03"); //TODO put in the info from database
-	
-	$gmd_dateType=$iso19139->createElement("gmd:dateType");
-	$CI_DateTypeCode=$iso19139->createElement("gmd:CI_DateTypeCode");
-	$CI_DateTypeCode->setAttribute("codeList","http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/codelist/ML_gmxCodelists.xml#CI_DateTypeCode");
-	$CI_DateTypeCode->setAttribute("codeListValue","publication");
-	$CI_DateTypeCodeText=$iso19139->createTextNode("publication");
-	
-	$gmd_explanation=$iso19139->createElement("gmd:explanation");
-	$gmd_explanation_cs=$iso19139->createElement("gco:CharacterString");
-	$gmd_explanationText=$iso19139->createTextNode("No explanation available");
-		
-	$gmd_pass=$iso19139->createElement("gmd:pass");
-	$gco_Boolean=$iso19139->createElement("gco:Boolean");
-	$gco_BooleanText=$iso19139->createTextNode("true"); //TODO maybe set here a string cause it can be unevaluated!! See Implementing Rules
-	//generate XML objects
-	$gco_Date->appendChild($gco_DateText);
-	$gmd_date->appendChild($gco_Date);
-	
-	$CI_DateTypeCode->appendChild($CI_DateTypeCodeText);
-	$gmd_dateType->appendChild($CI_DateTypeCode);
-	$CI_Date->appendChild($gmd_date);
-	$CI_Date->appendChild($gmd_dateType);
-	$gmd_date_2->appendChild($CI_Date);
-	$gmd_title_cs->appendChild($gmd_titleText);
-	$gmd_title->appendChild($gmd_title_cs);
-	$CI_Citation->appendChild($gmd_title);
-	$CI_Citation->appendChild($gmd_date_2);
-	$gmd_specification->appendChild($CI_Citation);
-	$gmd_explanation_cs->appendChild($gmd_explanationText);
-	$gmd_explanation->appendChild($gmd_explanation_cs);
-	$gco_Boolean->appendChild($gco_BooleanText);
-	$gmd_pass->appendChild($gco_Boolean);
-	$DQ_ConformanceResult->appendChild($gmd_specification);
-	$DQ_ConformanceResult->appendChild($gmd_explanation);
-	$DQ_ConformanceResult->appendChild($gmd_pass);
-
-//$DQ_DomainConsistency->appendChild($measureIdentification);
-
-	$gmd_result->appendChild($DQ_ConformanceResult);
-	$DQ_DomainConsistency->appendChild($gmd_result);
-
-	$gmd_report->appendChild($DQ_DomainConsistency);
-	$DQ_DataQuality->appendChild($gmd_report);
-
 	$DQ_DataQuality->appendChild($lineage);
 	$gmd_dataQualityInfo->appendChild($DQ_DataQuality);
 	//$MD_ScopeCode->setAttribute("codeListValue", "service");

Modified: trunk/mapbender/http/php/mod_layerISOMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_layerISOMetadata.php	2017-01-12 09:33:13 UTC (rev 9647)
+++ trunk/mapbender/http/php/mod_layerISOMetadata.php	2017-01-12 15:54:57 UTC (rev 9648)
@@ -18,7 +18,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-//Script to generate a conformant ISO19139 service metadata record for a wms layer which is registrated in the mapbender database. It works as a webservice
+//Script to generate a conformant ISO19139 view service metadata record for a wms layer which is registrated in the mapbender database. It works as a webservice
 //The record will be fulfill the demands of the INSPIRE metadata regulation from 03.12.2008 and the iso19139
 require_once(dirname(__FILE__) . "/../../core/globalSettings.php");
 require_once(dirname(__FILE__) . "/../classes/class_connector.php");
@@ -26,6 +26,7 @@
 require_once(dirname(__FILE__) . "/../php/mod_validateInspire.php");
 require_once(dirname(__FILE__) . "/../classes/class_iso19139.php");
 require_once(dirname(__FILE__)."/../classes/class_owsConstraints.php");
+require_once(dirname(__FILE__)."/../classes/class_qualityReport.php");
 
 $con = db_connect(DBSERVER,OWNER,PW);
 db_select_db(DB,$con);
@@ -864,61 +865,19 @@
 	$gmd_scope->appendChild($DQ_Scope);
 	$DQ_DataQuality->appendChild($gmd_scope);
 
-	//gmd:report in dataQualityInfo
-	$gmd_report=$iso19139->createElement("gmd:report");
-	$DQ_DomainConsistency=$iso19139->createElement("gmd:DQ_DomainConsistency");
-	$DQ_DomainConsistency->setAttribute("xsi:type","gmd:DQ_DomainConsistency_Type");
-	$gmd_result=$iso19139->createElement("gmd:result");
-	$DQ_ConformanceResult=$iso19139->createElement("gmd:DQ_ConformanceResult");
-	$gmd_specification=$iso19139->createElement("gmd:specification");
-	$CI_Citation=$iso19139->createElement("gmd:CI_Citation");
-	$gmd_title=$iso19139->createElement("gmd:title");
-	$gmd_title_cs=$iso19139->createElement("gco:CharacterString");
-	$gmd_titleText=$iso19139->createTextNode("Service Abstract Suite"); //TODO put in the inspire test suites from mb database!
-	$gmd_date=$iso19139->createElement("gmd:date");
-	$CI_Date=$iso19139->createElement("gmd:CI_Date");
-	$gmd_date_2=$iso19139->createElement("gmd:date");
-	$gco_Date=$iso19139->createElement("gco:Date");
-	$gco_DateText=$iso19139->createTextNode("2010-03-10"); //TODO put in the info from database
-	
-	$gmd_dateType=$iso19139->createElement("gmd:dateType");
-	$CI_DateTypeCode=$iso19139->createElement("gmd:CI_DateTypeCode");
-	$CI_DateTypeCode->setAttribute("codeList","http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/codelist/ML_gmxCodelists.xml#CI_DateTypeCode");
-	$CI_DateTypeCode->setAttribute("codeListValue","publication");
-	$CI_DateTypeCodeText=$iso19139->createTextNode("publication");
-	
-	$gmd_explanation=$iso19139->createElement("gmd:explanation");
-	$gmd_explanation_cs=$iso19139->createElement("gco:CharacterString");
-	$gmd_explanationText=$iso19139->createTextNode("No explanation available");
-		
-	$gmd_pass=$iso19139->createElement("gmd:pass");
-	$gco_Boolean=$iso19139->createElement("gco:Boolean");
-	$gco_BooleanText=$iso19139->createTextNode("true"); //TODO maybe set here a string cause it can be unevaluated!! See Implementing Rules
-	//generate XML objects
-	$gco_Date->appendChild($gco_DateText);
-	$gmd_date->appendChild($gco_Date);
-	
-	$CI_DateTypeCode->appendChild($CI_DateTypeCodeText);
-	$gmd_dateType->appendChild($CI_DateTypeCode);
-	$CI_Date->appendChild($gmd_date);
-	$CI_Date->appendChild($gmd_dateType);
-	$gmd_date_2->appendChild($CI_Date);
-	$gmd_title_cs->appendChild($gmd_titleText);
-	$gmd_title->appendChild($gmd_title_cs);
-	$CI_Citation->appendChild($gmd_title);
-	$CI_Citation->appendChild($gmd_date_2);
-	$gmd_specification->appendChild($CI_Citation);
-	$gmd_explanation_cs->appendChild($gmd_explanationText);
-	$gmd_explanation->appendChild($gmd_explanation_cs);
-	$gco_Boolean->appendChild($gco_BooleanText);
-	$gmd_pass->appendChild($gco_Boolean);
-	$DQ_ConformanceResult->appendChild($gmd_specification);
-	$DQ_ConformanceResult->appendChild($gmd_explanation);
-	$DQ_ConformanceResult->appendChild($gmd_pass);
-	$gmd_result->appendChild($DQ_ConformanceResult);
-	$DQ_DomainConsistency->appendChild($gmd_result);
-	$gmd_report->appendChild($DQ_DomainConsistency);
-	$DQ_DataQuality->appendChild($gmd_report);
+	//new from january 2017 - create conformance table from inspire_legislation config file - for interoperable datasets set all conformancy declarations to true for non interoperable set only the metadata conformance to true
+	//get conformancy declarations from class
+	$qualityReport = new QualityReport();
+	//All services are conform
+	$inputXml = $qualityReport->getIso19139Representation("service", "t");
+	$reportDomObject = new DOMDocument();
+	$reportDomObject->loadXML($inputXml);
+	$xpathInput = new DOMXpath($reportDomObject);
+	$inputNodeList = $xpathInput->query('/mb:dataqualityreport/gmd:report');
+	for ($i = ($inputNodeList->length)-1; $i >= 0; $i--) {
+		$DQ_DataQuality->appendChild($iso19139->importNode($inputNodeList->item($i), true));
+	}
+
 	$gmd_dataQualityInfo->appendChild($DQ_DataQuality);
 	//$MD_ScopeCode->setAttribute("codeListValue", "service");
 	$MD_Metadata->appendChild($identificationInfo);



More information about the Mapbender_commits mailing list