例 3 - WITSML™ 文件 (在demo目录中)
这个例子展示了使用一种Joost STX转换载入描述一个石油钻塔的样例数据。该数据是一种从energistics.org下载的复杂的XML文件格式。
Wellsite Information Transfer Standard Markup Language (WITSML™)是一种石油工业发起的为技术和软件提供开放的、非所有权的、标准的接口,以便在石油公司、服务公司、钻探承包商和监管代理之间分享信息。更多有关WITSML™的信息请见http://www.energistics.org/。
石油钻塔的信息由一个顶层的<rigs>
元素和多个子元素(例如<documentInfo>、<rig>
等)构成。下面从该文件中摘录的片段展示了<rig>
标签中的信息的类型。
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="../stylesheets/rig.xsl" type="text/xsl" media="screen"?>
<rigs
xmlns="http://www.energistics.org/schemas/131"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.energistics.org/schemas/131 ../obj_rig.xsd"
version="1.3.1.1">
<documentInfo>
... misc data ...
</documentInfo>
<rig uidWell="W-12" uidWellbore="B-01" uid="xr31">
<nameWell>6507/7-A-42</nameWell>
<nameWellbore>A-42</nameWellbore>
<name>Deep Drill #5</name>
<owner>Deep Drilling Co.</owner>
<typeRig>floater</typeRig>
<manufacturer>Fitsui Engineering</manufacturer>
<yearEntService>1980</yearEntService>
<classRig>ABS Class A1 M CSDU AMS ACCU</classRig>
<approvals>DNV</approvals>
... more data ...
目标是把这个钻塔的信息导入到Greenplum数据库。
样例文档rig.xml的尺寸大约是11KB。输入不包含制表符,因此相关信息可以被转换成用竖线(|)分隔的记录。
W-12|6507/7-A-42|xr31|Deep Drill #5|Deep Drilling Co.|John
Doe|John.Doe@example.com|
有这些列:
well_uid text
, -- e.g. W-12well_name text
, -- e.g. 6507/7-A-42rig_uid text
, -- e.g. xr31rig_name text
, -- e.g. Deep Drill #5rig_owner text
, -- e.g. Deep Drilling Co.rig_contact text
, -- e.g. John Doerig_email text
, -- e.g. John.Doe@example.comdoc xml
然后,载入该数据到Greenplum数据库中。
上级主题: XML转换示例