예제 #1
0
def main():
    cleanttl.clean()
    members = []
    member_elements = []
    for unit in INPUTS:
        members.append(uri_pattern.format(unit[0]))
        m_elem_str = uri_pattern.format(unit[0])
        m_elem_str += ' a skos:Concept ;\n'
        m_elem_str += '\trdfs:label "{}" ;\n'.format(unit[1])
        m_elem_str += '\tskos:prefLabel "{}" ;\n'.format(unit[1])
        m_elem_str += '\tskos:notation "{}" ;\n'.format(unit[3])
        m_elem_str += '\tskos:altLabel "{}" ;\n'.format(unit[2])
        m_elem_str += '\tskos:altLabel "{}" ;\n'.format(unit[4])
        m_elem_str += '\t.\n'
        member_elements.append(m_elem_str)
    file_write(members, member_elements)
예제 #2
0
                      '\trdfs:isDefinedBy <bufr4>\n'
                      '\t.\n\n')
        fhandle.write('<bufr4/referenceValue>a owl:ObjectProperty ;\n'
                      '\trdfs:label "Reference value"@en ;\n'
                      '\trdfs:comment "Reference value used when encoding the value of the BUFR Table B Element in WMO No. 306 Vol I.2 FM 94 BUFR."@en ;\n'
                      '\trdfs:range xsd:integer ;\n'
                      '\trdfs:isDefinedBy <bufr4>\n'
                      '\t.\n\n')
        fhandle.write('<bufr4/scale> a owl:ObjectProperty ;\n'
                      '\trdfs:label "Scale"@en ;\n'
                      '\trdfs:comment "Scale factor used when encoding the value of the BUFR Table B Element in WMO No. 306 Vol I.2 FM 94 BUFR."@en ;\n'
                      '\trdfs:range xsd:integer ;\n'
                      '\trdfs:isDefinedBy <bufr4>\n'
                      '\t.\n\n')

    if not os.path.exists('ttl/bufr4'):
        os.mkdir('ttl/bufr4')
    with open('ttl/bufr4.ttl', 'w') as fhandle:
        fhandle.write(ttlhead)
        fhandle.write('<bufr4> a reg:Register ;\n')
        fhandle.write('\tdc:description "WMO No. 306 FM 94 BUFR (edition 4)"@en ;\n')
        fhandle.write('\treg:owner <http://codes.wmo.int/system/organization/wmo> ;\n')
        fhandle.write('\tdct:publisher <http://codes.wmo.int/system/organization/wmo> ;\n')
        fhandle.write('\treg:manager <http://codes.wmo.int/system/organization/www-dm> ;\n')
        fhandle.write('\trdfs:label "BUFR edition 4"@en.\n')


if __name__ == '___main__':
    cleanttl.clean()
    main()
예제 #3
0
            '\trdfs:comment "Abbreviation for unit of measure (for IA2) - as defined within WMO No. 306 Vol I.2 Common code-table C-6 `List of units for TDCFs`."@en ;\n'
            '\trdfs:range xsd:string ;\n'
            '\trdfs:isDefinedBy <common>;\n'
            '\t.\n\n')

    with open('ttl/def/bulk_codeform.ttl', 'w') as fhandle:
        fhandle.write(ttlhead)
        fhandle.write(
            '<codeform> a owl:Ontology, ldp:Container ;\n'
            '\trdfs:label "Schemata for WMO code forms";\n'
            '\trdfs:member <codeform/GRIB-message>, <codeform/BUFR-message> ;\n'
            '\t.\n\n')
        fhandle.write('<codeform/GRIB-message> a owl:Class ;\n'
                      '\trdfs:isDefinedBy <codeform>;\n'
                      '\trdfs:label "GRIB message" ;\n'
                      '\tdct:description "GRIdded Binary message, as defined '
                      'in WMO No. 306 FM 92 GRIB" ;\n'
                      '\t.\n\n')
        fhandle.write('<codeform/BUFR-message> a owl:Class ;\n'
                      '\trdfs:isDefinedBy <codeform>;\n'
                      '\trdfs:label "BUFR message" ;\n'
                      '\tdct:description "Binary Universal Form for the '
                      'Representation of meteorological data message, as '
                      'defined in WMO No. 306 FM 94 BUFR" ;\n'
                      '\t.\n')


if __name__ == '__main__':
    cleanttl.clean()
    main()