Changeset 2363 for TI07-MOLES


Ignore:
Timestamp:
02/04/07 16:15:07 (12 years ago)
Author:
ko23
Message:

Extended MDIP output from MOLES

Location:
TI07-MOLES/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TI07-MOLES/trunk/MDIP/XQueries/NDG-MDIP.xquery

    r2236 r2363  
    55declare namespace gco='http://www.isotc211.org/2005/gco'; 
    66declare namespace xsi='http://www.w3.org/2001/XMLSchema-instance';  
     7(: Keep 
    78declare variable $targetCollection as xs:string {'TargetCollection'}; 
    89declare variable $repositoryIdentifier as xs:string {'RepositoryID'}; 
    910declare variable $localIdentifier as xs:string {'LocalID'}; 
     11:) 
     12declare variable $targetCollection as xs:string {'/db/discovery'}; 
     13declare variable $repositoryIdentifier as xs:string {'grid.bodc.nerc.ac.uk'}; 
     14declare variable $localIdentifier as xs:string {'grid.bodc.nerc.ac.uk:DIF:EDMED1048001'}; 
    1015 
    1116declare variable $ISO_639-2_ns as xs:string{$voclib:ISO_639-2_ns}; 
     
    2429                return 
    2530                        element Language{ 
    26                                 element LanguageName {data($lang/dgValidTerm)}, 
    27                                 element LanguageVocab {data($lang/dgValidTermID/ParentListID)}, 
    28                                 element LanguageCode {data($lang/dgValidTermID/TermID)} 
     31                                element LanguageName {data($lang/moles:dgValidTerm)}, 
     32                                element LanguageVocab {data($lang/moles:dgValidTermID/moles:ParentListID)}, 
     33                                element LanguageCode {data($lang/moles:dgValidTermID/moles:TermID)} 
    2934                        } 
    3035                                 
    3136        else (), 
    3237 
    33         element Abstract {}, 
    34         for $isoTopic in $DE/moles:dgStructuredKeyword[moles:dgValidTermID/moles:ParentListID='']  
    35         return element TopicCategory {}, 
    36         for $subject in distinct-values($DE/dgDataEntity/dgDataSummary/dgParameterSummary/dgStdParameterMeasured[ 
    37         voclib:spot-vocab($voclib:gcmd_science_valids, dgValidTermID/ParentListID)  
    38         or voclib:spot-vocab($voclib:gcmd_project_valids, dgValidTermID/ParentListID) 
    39         or voclib:spot-vocab($voclib:bodc_parameter_usage_vocab, dgValidTermID/ParentListID) 
    40         or voclib:spot-vocab($voclib:bodc_parameter_discovery_vocab, dgValidTermID/ParentListID) 
    41         ]/dgValidTerm)  
    42         return element Subject {$subject}, 
     38        element Abstract {string($DE/moles:dgMetadataDescription/moles:abstract/moles:abstractText)}, 
     39        for $isoTopic in $DE/moles:dgStructuredKeyword[voclib:spot-vocab($voclib:iso_topic_list, moles:dgValidTermID/moles:ParentListID)]  
     40        return element TopicCategory { 
     41        element TopicCategoryName {data($isoTopic/moles:dgValidTerm)}, 
     42        element TopicCategoryVocab {data($isoTopic/moles:dgValidTermID/moles:ParentListID)}, 
     43        element TopicCategoryCode {data($isoTopic/moles:dgValidTermID/moles:TermID)} 
     44        }, 
     45        for $subject in ($DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgParameterSummary/moles:dgStdParameterMeasured[ 
     46        voclib:spot-vocab($voclib:gcmd_science_valids, moles:dgValidTermID/moles:ParentListID)  
     47        or voclib:spot-vocab($voclib:gcmd_project_valids, moles:dgValidTermID/moles:ParentListID) 
     48        or voclib:spot-vocab($voclib:gcmd_science_valids_categories, moles:dgValidTermID/moles:ParentListID) 
     49        or voclib:spot-vocab($voclib:bodc_parameter_usage_vocab, moles:dgValidTermID/moles:ParentListID) 
     50        or voclib:spot-vocab($voclib:bodc_parameter_discovery_vocab, moles:dgValidTermID/moles:ParentListID) 
     51        ])  
     52        return (element Subject { 
     53        element SubjectName {data($subject/moles:dgValidTerm)}, 
     54        element SubjectVocab {data($subject/moles:dgValidTermID/moles:ParentListID)}, 
     55        element SubjectCode {data($subject/moles:dgValidTermID/moles:TermID)} 
     56        }, 
     57        for $subterm in $subject//moles:dgValidSubterm 
     58        return (element Subject { 
     59        element SubjectName {data($subterm/moles:dgValidTerm)}, 
     60        element SubjectVocab {data($subterm/moles:dgValidTermID/moles:ParentListID)}, 
     61        element SubjectCode {data($subterm/moles:dgValidTermID/moles:TermID)} 
     62        } 
     63        ) 
     64        ), 
     65        if (exists($DE//moles:dgTemporalCoverage/(moles:DateSingle | moles:DateRange))) then  
    4366        element Date { 
    44                 element DatasetStartDate {}, 
    45                 element DatasetEndDate {} 
     67                element DatasetStartDate { 
     68                let $dateStart:=min($DE//moles:dgTemporalCoverage/(moles:DateSingle | moles:DateRange/moles:DateRangeStart) cast as xs:date) 
     69                return  
     70                if (empty($dateStart)) then ()  
     71                else data($dateStart) 
     72                }, 
     73                element DatasetEndDate { 
     74                let $dateEnd:=max($DE//moles:dgTemporalCoverage/(moles:DateSingle | moles:DateRange/moles:DateRangeEnd) cast as xs:date) 
     75                return 
     76                if (empty($dateEnd)) then ()  
     77                else data($dateEnd) 
     78                } 
    4679        } 
    47 } 
     80        else (), 
     81        let $west := min($DE/moles:dgDataEntity/moles:dgDataSummary//moles:BoundingBox/moles:LimitWest cast as xs:integer) 
     82        return element WestCoOrdinate {data($west)}, 
     83        let $east := max($DE/moles:dgDataEntity/moles:dgDataSummary//moles:BoundingBox/moles:LimitEast cast as xs:integer) 
     84        return element EastCoOrdinate {data($east)}, 
     85        let $north := max($DE/moles:dgDataEntity/moles:dgDataSummary//moles:BoundingBox/moles:LimitNorth cast as xs:integer) 
     86        return element NorthCoOrdinate {data($north)}, 
     87        let $south := min($DE/moles:dgDataEntity/moles:dgDataSummary//moles:BoundingBox/moles:LimitSouth cast as xs:integer) 
     88        return element SouthCoOrdinate {data($south)}, 
     89        element DatasetIdentifier {concat($DE/moles:dgMetadataID/moles:repositoryIdentifier, $utillib:moles_id_separator, 'MDIP', $utillib:moles_id_separator, $DE/moles:dgMetadataID/moles:localIdentifier)}, 
     90        for $target in $DE/moles:dgStructuredKeyword[voclib:spot-vocab($voclib:ndg_data_provider_vocab, moles:dgValidTermID/moles:ParentListID) ] 
     91        return element Target { 
     92        element TargetName {data($target/moles:dgValidTerm)}, 
     93        element TargetVocab {data($target/moles:dgValidTermID/moles:ParentListID)}, 
     94        element TargetCode {data($target/moles:dgValidTermID/moles:TermID)} 
     95        } 
     96        } 
  • TI07-MOLES/trunk/PythonCode/wsgi/ndg_xqueries.py

    r2358 r2363  
    19071907declare namespace gco='http://www.isotc211.org/2005/gco'; 
    19081908declare namespace xsi='http://www.w3.org/2001/XMLSchema-instance';  
     1909 
    19091910declare variable $targetCollection as xs:string {'TargetCollection'}; 
    19101911declare variable $repositoryIdentifier as xs:string {'RepositoryID'}; 
     
    19261927        return 
    19271928            element Language{ 
    1928                 element LanguageName {data($lang/dgValidTerm)}, 
    1929                 element LanguageVocab {data($lang/dgValidTermID/ParentListID)}, 
    1930                 element LanguageCode {data($lang/dgValidTermID/TermID)} 
     1929                element LanguageName {data($lang/moles:dgValidTerm)}, 
     1930                element LanguageVocab {data($lang/moles:dgValidTermID/moles:ParentListID)}, 
     1931                element LanguageCode {data($lang/moles:dgValidTermID/moles:TermID)} 
    19311932            } 
    19321933                 
    19331934    else (), 
    19341935 
    1935     element Abstract {}, 
    1936     for $isoTopic in $DE/moles:dgStructuredKeyword[moles:dgValidTermID/moles:ParentListID='']  
    1937     return element TopicCategory {}, 
    1938     for $subject in distinct-values($DE/dgDataEntity/dgDataSummary/dgParameterSummary/dgStdParameterMeasured[ 
    1939     voclib:spot-vocab($voclib:gcmd_science_valids, dgValidTermID/ParentListID)  
    1940     or voclib:spot-vocab($voclib:gcmd_project_valids, dgValidTermID/ParentListID) 
    1941     or voclib:spot-vocab($voclib:bodc_parameter_usage_vocab, dgValidTermID/ParentListID) 
    1942     or voclib:spot-vocab($voclib:bodc_parameter_discovery_vocab, dgValidTermID/ParentListID) 
    1943     ]/dgValidTerm)  
    1944     return element Subject {$subject}, 
     1936    element Abstract {string($DE/moles:dgMetadataDescription/moles:abstract/moles:abstractText)}, 
     1937    for $isoTopic in $DE/moles:dgStructuredKeyword[voclib:spot-vocab($voclib:iso_topic_list, moles:dgValidTermID/moles:ParentListID)]  
     1938    return element TopicCategory { 
     1939    element TopicCategoryName {data($isoTopic/moles:dgValidTerm)}, 
     1940    element TopicCategoryVocab {data($isoTopic/moles:dgValidTermID/moles:ParentListID)}, 
     1941    element TopicCategoryCode {data($isoTopic/moles:dgValidTermID/moles:TermID)} 
     1942    }, 
     1943    for $subject in ($DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgParameterSummary/moles:dgStdParameterMeasured[ 
     1944    voclib:spot-vocab($voclib:gcmd_science_valids, moles:dgValidTermID/moles:ParentListID)  
     1945    or voclib:spot-vocab($voclib:gcmd_project_valids, moles:dgValidTermID/moles:ParentListID) 
     1946    or voclib:spot-vocab($voclib:gcmd_science_valids_categories, moles:dgValidTermID/moles:ParentListID) 
     1947    or voclib:spot-vocab($voclib:bodc_parameter_usage_vocab, moles:dgValidTermID/moles:ParentListID) 
     1948    or voclib:spot-vocab($voclib:bodc_parameter_discovery_vocab, moles:dgValidTermID/moles:ParentListID) 
     1949    ])  
     1950    return (element Subject { 
     1951    element SubjectName {data($subject/moles:dgValidTerm)}, 
     1952    element SubjectVocab {data($subject/moles:dgValidTermID/moles:ParentListID)}, 
     1953    element SubjectCode {data($subject/moles:dgValidTermID/moles:TermID)} 
     1954    }, 
     1955    for $subterm in $subject//moles:dgValidSubterm 
     1956    return (element Subject { 
     1957    element SubjectName {data($subterm/moles:dgValidTerm)}, 
     1958    element SubjectVocab {data($subterm/moles:dgValidTermID/moles:ParentListID)}, 
     1959    element SubjectCode {data($subterm/moles:dgValidTermID/moles:TermID)} 
     1960    } 
     1961    ) 
     1962    ), 
     1963    if (exists($DE//moles:dgTemporalCoverage/(moles:DateSingle | moles:DateRange))) then  
    19451964    element Date { 
    1946         element DatasetStartDate {}, 
    1947         element DatasetEndDate {} 
     1965        element DatasetStartDate { 
     1966        let $dateStart:=min($DE//moles:dgTemporalCoverage/(moles:DateSingle | moles:DateRange/moles:DateRangeStart) cast as xs:date) 
     1967        return  
     1968        if (empty($dateStart)) then ()  
     1969        else data($dateStart) 
     1970        }, 
     1971        element DatasetEndDate { 
     1972        let $dateEnd:=max($DE//moles:dgTemporalCoverage/(moles:DateSingle | moles:DateRange/moles:DateRangeEnd) cast as xs:date) 
     1973        return 
     1974        if (empty($dateEnd)) then ()  
     1975        else data($dateEnd) 
     1976        } 
    19481977    } 
    1949 }''' 
     1978    else (), 
     1979    let $west := min($DE/moles:dgDataEntity/moles:dgDataSummary//moles:BoundingBox/moles:LimitWest cast as xs:integer) 
     1980    return element WestCoOrdinate {data($west)}, 
     1981    let $east := max($DE/moles:dgDataEntity/moles:dgDataSummary//moles:BoundingBox/moles:LimitEast cast as xs:integer) 
     1982    return element EastCoOrdinate {data($east)}, 
     1983    let $north := max($DE/moles:dgDataEntity/moles:dgDataSummary//moles:BoundingBox/moles:LimitNorth cast as xs:integer) 
     1984    return element NorthCoOrdinate {data($north)}, 
     1985    let $south := min($DE/moles:dgDataEntity/moles:dgDataSummary//moles:BoundingBox/moles:LimitSouth cast as xs:integer) 
     1986    return element SouthCoOrdinate {data($south)}, 
     1987    element DatasetIdentifier {concat($DE/moles:dgMetadataID/moles:repositoryIdentifier, $utillib:moles_id_separator, 'MDIP', $utillib:moles_id_separator, $DE/moles:dgMetadataID/moles:localIdentifier)}, 
     1988    for $target in $DE/moles:dgStructuredKeyword[voclib:spot-vocab($voclib:ndg_data_provider_vocab, moles:dgValidTermID/moles:ParentListID) ] 
     1989    return element Target { 
     1990    element TargetName {data($target/moles:dgValidTerm)}, 
     1991    element TargetVocab {data($target/moles:dgValidTermID/moles:ParentListID)}, 
     1992    element TargetCode {data($target/moles:dgValidTermID/moles:TermID)} 
     1993    } 
     1994    } 
     1995''' 
  • TI07-MOLES/trunk/v1Schema/Schemae/ndgmetadata1.3.xsd

    r2064 r2363  
    11<?xml version="1.0" encoding="UTF-8"?> 
    22<!-- edited with XMLSPY v5 rel. 4 U (http://www.xmlspy.com) by Kev O'Neill (CCLRC) --> 
    3 <xs:schema targetNamespace="http://ndg.nerc.ac.uk/moles" xmlns:moles="http://ndg.nerc.ac.uk/moles" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.03"> 
     3<xs:schema targetNamespace="http://ndg.nerc.ac.uk/moles" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:moles="http://ndg.nerc.ac.uk/moles" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.03"> 
    44        <xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="http://www.isotc211.org/2005/xlink/xlinks.xsd"/> 
    55        <!--version 1.03 of NDG metadata schema. Modifications from 1.02.05: 
     
    815815                                <xs:annotation> 
    816816                                        <xs:documentation>Allows labelling of the reference for std. link text for example.</xs:documentation> 
     817                                </xs:annotation> 
     818                        </xs:element> 
     819                        <xs:element name="dgReferenceText" minOccurs="0"> 
     820                                <xs:annotation> 
     821                                        <xs:documentation>Notes or other non-title text associated with reference</xs:documentation> 
    817822                                </xs:annotation> 
    818823                        </xs:element> 
Note: See TracChangeset for help on using the changeset viewer.