Changeset 1621 for TI02-CSML


Ignore:
Timestamp:
24/10/06 13:37:02 (13 years ago)
Author:
domlowe
Message:

added stub standard name class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI02-CSML/trunk/csml2MolesStuff/csml2moles.py

    r1617 r1621  
    2727    return dataset 
    2828     
     29 
     30class StandardName(object): 
     31    def __init__(self, somename): 
     32        '''given some name, attempt to resolve it into a standard name type structure. by stripping out any URLs etc''' 
     33        #types of names: 
     34        #myrandomvar 
     35        #http://some.namespace/localparams#somevar  #conventions? 
     36        #http://some.namespace/something#somevar  # standard name 
     37        #from these extract text (description), termid and vocabid where possible.         
     38        self.text='' 
     39        self.term=somename 
     40        self.vocab='' 
    2941 
    3042class EnvelopeAggregator(object): 
     
    131143        for feature in dataset.featureCollection.members: 
    132144            if hasattr(feature.parameter, 'href'): 
    133                 SPM=M.dgStdParameterMeasured(dgValidTerm= feature.parameter.href) 
    134             else: 
    135                 PM=M.dgStdParameterMeasured(dgValidTerm= '') 
     145                sn=StandardName(feature.parameter.href) 
     146            SPM=M.dgStdParameterMeasured(dgValidTerm= sn.text) 
    136147            RDP=M.dgRangeDataParameter(HighValue='', LowValue='') 
    137148            PS  = M.dgParameterSummary(dgRangeDataParameter=RDP, dgStdParameterMeasured=SPM) 
Note: See TracChangeset for help on using the changeset viewer.