DSPL 架构

本页及其关联的子页面介绍了 DSPL XML 架构。 本材料适用于希望了解语言低层细节的高级用户;对于大多数用户而言,开发者指南中的内容应足以创建和修改 DSPL 数据集。

您可访问 DSPL 代码网站以 XSD 格式下载完整的 XML 架构。

元素:dspl

命名空间 http://schemas.google.com/dspl/2010
注释 DSPL 规范描述的是数据集。数据集由其命名空间标识。数据集由以下元素组成:- 表:数据集中定义的概念和切片的数据 - 概念:数据集中使用的用户指定定义和结构 - 切片:数据集中存在的维度和指标的组合 - 主题:用于整理数据集的概念的分层标签
图示 图示 dspl9.tmp#id103 dspl9.tmp#id2 dspl9.tmp#id5 dspl9.tmp#id16 dspl9.tmp#id17 dspl9.tmp#id27 dspl9.tmp#id35 dspl9.tmp#id68 dspl9.tmp#id86
属性
content: 复杂
模型 import*infoproviderattribute*topics{0,1}concepts{0,1}slices{0,1}tables{0,1}
儿童 属性概念导入信息提供方切片主题
实例
<dspl targetNamespace="">
  <import location="" namespace="">{0,unbounded}</import>
  <info>{1,1}</info>
  <provider>{1,1}</provider>
  <attribute concept="" id="">{0,unbounded}</attribute>
  <topics>{0,1}</topics>
  <concepts>{0,1}</concepts>
  <slices>{0,1}</slices>
  <tables>{0,1}</tables>
</dspl>
属性
QName 类型 已修复 默认 使用 注解
targetNamespace xs:anyURI 可选 每个数据集都可以提供目标命名空间。目标命名空间是一个用于唯一标识数据集的 URI。如需详细了解如何在 XML 中使用命名空间,请参阅:http://www.w3.org/TR/REC-xml-name/。如果未提供 targetNamespace,则系统会在导入数据集时生成命名空间。
来源
<xs:element name="dspl">
  <xs:annotation>
    <xs:documentation>A DSPL specification describes a dataset. A dataset is
        identified by its namespace. A dataset is comprised of the
        following elements:

        - Tables: Data for the concepts and slices defined in the
        dataset

        - Concepts: User-specified definitions and structures used in
        the dataset

        - Slices: Combinations of dimensions and metrics present in
        the dataset

        - Topics: Hierarchical labels used to organise the concepts of
        the dataset</xs:documentation>
  </xs:annotation>
  <xs:complexType>
    <xs:sequence>
      <xs:element name="import" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>Import directive for external datasets -- modeled after
              the XML Schema import directive.  In order to use
              elements defined in an external dataset, the external
              dataset must be referenced using an import directive.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:attribute name="namespace" use="required">
            <xs:annotation>
              <xs:documentation>The namespace of the imported dataset, specified as
                  a URI. A prefix must be associated with this
                  namespace before its contents can be referenced. See
                  [XML Namespaces] for more information about the use
                  of namespaces and prefixes in XML.</xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="location" use="optional">
            <xs:annotation>
              <xs:documentation>An optional location where the definition of the
                  imported dataset can be found, specified as a
                  URL. If the location is omitted, the system
                  processing this DSPL dataset must already know the
                  imported dataset.

                  Implementation note: The Google dataset importer
                  ignores the location attribute. Any imported dataset
                  must be known by the Google importer beforehand.</xs:documentation>
            </xs:annotation>
          </xs:attribute>
        </xs:complexType>
      </xs:element>
      <xs:element name="info" type="Info" minOccurs="1">
        <xs:annotation>
          <xs:documentation>General information about the dataset.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="provider" type="Info">
        <xs:annotation>
          <xs:documentation>General information about the dataset provider.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="attribute" type="Attribute" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>Attribute associated with the dataset.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="topics" minOccurs="0">
        <xs:annotation>
          <xs:documentation>A hierarchy of topics used to organize the contents of
              the dataset. The order in which topics are given is
              meaningful and should be respected by visualizations
              that displays these topics.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:sequence>
            <xs:element name="topic" type="Topic" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="concepts" minOccurs="0">
        <xs:annotation>
          <xs:documentation>A list of concepts defined in this dataset.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:sequence>
            <xs:element name="concept" type="Concept" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="slices" minOccurs="0">
        <xs:annotation>
          <xs:documentation>A list of slices defined in this dataset.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:sequence>
            <xs:element name="slice" type="Slice" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="tables" minOccurs="0">
        <xs:annotation>
          <xs:documentation>A list of tables defined in this dataset.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:sequence>
            <xs:element name="table" type="Table" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="targetNamespace" type="xs:anyURI" use="optional">
      <xs:annotation>
        <xs:documentation>Each dataset may provide a target namespace. The
              target namespace is a URI that uniquely identifies the
              dataset. For more information about the use of namespaces in XML,
              see:

              http://www.w3.org/TR/REC-xml-names/

              If no targetNamespace is provided,  then a namespace will be
              generated when the dataset is imported.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>
</xs:element>

元素:dspl / import

命名空间 http://schemas.google.com/dspl/2010
注释 外部数据集的导入指令 - 模仿 XML 架构导入指令。为了使用外部数据集中定义的元素,必须使用导入指令来引用外部数据集。
图示 图示 dspl9.tmp#id3 dspl9.tmp#id4
属性
content: 复杂
minOccurs: 0
maxOccurs: 无界限
属性
QName 类型 已修复 默认 使用 注解
地理位置 可选 可选位置,可以在其中找到导入的数据集的定义,以网址形式指定。如果省略了此位置,则处理此 DSPL 数据集的系统必须已经知道导入的数据集。实现备注:Google 数据集导入工具会忽略位置属性。Google 导入方必须事先知道所有导入的数据集。
namespace 必需 导入的数据集的命名空间,以 URI 的形式指定。前缀必须与此命名空间关联,然后才能引用其内容。如需详细了解如何在 XML 中使用命名空间和前缀,请参阅 [XML 命名空间]。
来源
<xs:element name="import" minOccurs="0" maxOccurs="unbounded">
  <xs:annotation>
    <xs:documentation>Import directive for external datasets -- modeled after
              the XML Schema import directive.  In order to use
              elements defined in an external dataset, the external
              dataset must be referenced using an import directive.</xs:documentation>
  </xs:annotation>
  <xs:complexType>
    <xs:attribute name="namespace" use="required">
      <xs:annotation>
        <xs:documentation>The namespace of the imported dataset, specified as
                  a URI. A prefix must be associated with this
                  namespace before its contents can be referenced. See
                  [XML Namespaces] for more information about the use
                  of namespaces and prefixes in XML.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="location" use="optional">
      <xs:annotation>
        <xs:documentation>An optional location where the definition of the
                  imported dataset can be found, specified as a
                  URL. If the location is omitted, the system
                  processing this DSPL dataset must already know the
                  imported dataset.

                  Implementation note: The Google dataset importer
                  ignores the location attribute. Any imported dataset
                  must be known by the Google importer beforehand.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>
</xs:element>

元素:dspl/info

命名空间 http://schemas.google.com/dspl/2010
注释 有关数据集的常规信息
图示 图示 dspl4.tmp#id7 dspl4.tmp#id14 dspl4.tmp#id15 dspl4.tmp#id6
类型 信息
属性
content: 复杂
minOccurs: 1
模型 namedescription{0,1}url{0,1}
儿童 descriptionnameurl
实例
<info>
  <name>{1,1}</name>
  <description>{0,1}</description>
  <url>{0,1}</url>
</info>
来源
<xs:element name="info" type="Info" minOccurs="1">
  <xs:annotation>
    <xs:documentation>General information about the dataset.</xs:documentation>
  </xs:annotation>
</xs:element>

元素:dspl / provider

命名空间 http://schemas.google.com/dspl/2010
注释 有关数据集提供程序的常规信息。
图示 图示 dspl4.tmp#id7 dspl4.tmp#id14 dspl4.tmp#id15 dspl4.tmp#id6
类型 信息
属性
content: 复杂
模型 namedescription{0,1}url{0,1}
儿童 descriptionnameurl
实例
<provider>
  <name>{1,1}</name>
  <description>{0,1}</description>
  <url>{0,1}</url>
</provider>
来源
<xs:element name="provider" type="Info">
  <xs:annotation>
    <xs:documentation>General information about the dataset provider.</xs:documentation>
  </xs:annotation>
</xs:element>

元素:dspl / 属性

命名空间 http://schemas.google.com/dspl/2010
注释 与数据集关联的特性
图示 图示 dspl14.tmp#id24 dspl14.tmp#id26 dspl14.tmp#id19 dspl14.tmp#id20 dspl0.tmp#id10 dspl0.tmp#id12 dspl0.tmp#id9 dspl14.tmp#id18
类型 特性
属性
content: 复杂
minOccurs: 0
maxOccurs: 无界限
模型 info{0,1}type{0,1}、(value* | conceptValue{0,1}
儿童 conceptValueinfotypevalue
实例
<attribute concept="" id="">
  <info>{0,1}</info>
  <type format="" ref="">{0,1}</type>
</attribute>
属性
QName 类型 已修复 默认 使用 注解
概念 xs:QName 可选 对与属性值对应的概念的引用。如果属性指定类型,则该类型必须与所引用概念的类型匹配。对外部概念的引用必须采用“前缀:other_concept_id”格式,其中“前缀”是用于外部数据集命名空间的前缀(请参阅 XML 命名空间)。
id 本地 ID 可选 概念属性的 ID。此标识符在概念中必须是唯一的(在各个属性之间)。如果指定了概念属性,则可以省略此 ID。在这种情况下,系统将隐式创建一个 ID,其值为所引用概念的本地名称。例如,<attribute concept="unit:currency"/> 相当于 <attribute id="currency" concept="unit:currency"/>
来源
<xs:element name="attribute" type="Attribute" minOccurs="0" maxOccurs="unbounded">
  <xs:annotation>
    <xs:documentation>Attribute associated with the dataset.</xs:documentation>
  </xs:annotation>
</xs:element>

元素:dspl / topics

命名空间 http://schemas.google.com/dspl/2010
注释 用于组织数据集内容的主题的层次结构。主题的提供顺序很重要,显示这些主题的可视化图表应予以遵循。
图示 图示 dspl9.tmp#id28
属性
content: 复杂
minOccurs: 0
模型 主题+
儿童 主题
实例
<topics>
  <topic id="" parentTopic="">{1,unbounded}</topic>
</topics>
来源
<xs:element name="topics" minOccurs="0">
  <xs:annotation>
    <xs:documentation>A hierarchy of topics used to organize the contents of
              the dataset. The order in which topics are given is
              meaningful and should be respected by visualizations
              that displays these topics.</xs:documentation>
  </xs:annotation>
  <xs:complexType>
    <xs:sequence>
      <xs:element name="topic" type="Topic" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

元素:dspl / topics / topic

命名空间 http://schemas.google.com/dspl/2010
图示 图示 dspl15.tmp#id32 dspl15.tmp#id34 dspl15.tmp#id30 dspl15.tmp#id31 dspl15.tmp#id29
类型 Topic
属性
content: 复杂
maxOccurs: 无界限
模型 infotopic*
儿童 infotopic
实例
<topic id="" parentTopic="">
  <info>{1,1}</info>
  <topic id="" parentTopic="">{0,unbounded}</topic>
</topic>
属性
QName 类型 已修复 默认 使用 注解
id ID 必需 数据集中主题的唯一标识符。
parentTopic xs:QName 可选 此主题的父主题的 ID(如果有)。 无法为内嵌在其他主题中的主题指定 parentTopic。
来源
<xs:element name="topic" type="Topic" maxOccurs="unbounded"/>

元素:dspl / concepts

命名空间 http://schemas.google.com/dspl/2010
注释 此数据集中定义的概念列表。
图示 图示 dspl9.tmp#id36
属性
content: 复杂
minOccurs: 0
模型 概念+
儿童 概念
实例
<concepts>
  <concept extends="" id="">{1,unbounded}</concept>
</concepts>
来源
<xs:element name="concepts" minOccurs="0">
  <xs:annotation>
    <xs:documentation>A list of concepts defined in this dataset.</xs:documentation>
  </xs:annotation>
  <xs:complexType>
    <xs:sequence>
      <xs:element name="concept" type="Concept" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

元素:dspl/concepts/concepts

命名空间 http://schemas.google.com/dspl/2010
图示 图示 dspl6.tmp#id66 dspl6.tmp#id67 dspl6.tmp#id38 dspl6.tmp#id43 dspl6.tmp#id45 dspl6.tmp#id47 dspl6.tmp#id48 dspl6.tmp#id57 dspl6.tmp#id58 dspl6.tmp#id37
类型 概念
属性
content: 复杂
maxOccurs: 无界限
模型 infotopic*type{0,1}attribute*property*defaultValue{0,1}table{0,1}
儿童 attributedefaultValueinfopropertytabletopictype
实例
<concept extends="" id="">
  <info>{1,1}</info>
  <topic ref="">{0,unbounded}</topic>
  <type ref="">{0,1}</type>
  <attribute concept="" id="">{0,unbounded}</attribute>
  <property concept="" id="" isMapping="false" isParent="false">{0,unbounded}</property>
  <defaultValue>{0,1}</defaultValue>
  <table ref="">{0,1}</table>
</concept>
属性
QName 类型 已修复 默认 使用 注解
扩展 xs:QName 可选 此概念扩展的概念的唯一标识符。引用的概念可以在同一个数据集中定义,也可以在外部进行定义,即在另一个数据集内进行定义。对外部概念的引用必须采用“前缀:other_concept_id”格式,其中“前缀”是用于外部数据集命名空间的前缀(请参阅 XML 命名空间)。
id ID 必需 概念的唯一标识符,必须在数据集内保持全局唯一。
来源
<xs:element name="concept" type="Concept" maxOccurs="unbounded"/>

元素:dspl / Slice

命名空间 http://schemas.google.com/dspl/2010
注释 此数据集中定义的切片列表
图示 图示 dspl9.tmp#id69
属性
content: 复杂
minOccurs: 0
模型 Slice+
儿童 slice
实例
<slices>
  <slice id="">{1,unbounded}</slice>
</slices>
来源
<xs:element name="slices" minOccurs="0">
  <xs:annotation>
    <xs:documentation>A list of slices defined in this dataset.</xs:documentation>
  </xs:annotation>
  <xs:complexType>
    <xs:sequence>
      <xs:element name="slice" type="Slice" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

元素:dspl/Slice/Slice

命名空间 http://schemas.google.com/dspl/2010
图示 图示 dspl2.tmp#id85 dspl2.tmp#id71 dspl2.tmp#id72 dspl2.tmp#id75 dspl2.tmp#id76 dspl2.tmp#id70
类型 Slice
属性
content: 复杂
maxOccurs: 无界限
模型 info{0,1}dimension+metric+table
儿童 dimensioninfometrictable
实例
<slice id="">
  <info>{0,1}</info>
  <dimension concept="">{1,unbounded}</dimension>
  <metric concept="">{1,unbounded}</metric>
  <table ref="">{1,1}</table>
</slice>
属性
QName 类型 已修复 默认 使用 注解
id ID 必需 Slice 的唯一标识符。
来源
<xs:element name="slice" type="Slice" maxOccurs="unbounded"/>

元素:dspl/表

命名空间 http://schemas.google.com/dspl/2010
注释 此数据集中定义的表的列表。
图示 图示 dspl9.tmp#id87
属性
content: 复杂
minOccurs: 0
模型 表格+
儿童 表格
实例
<tables>
  <table id="">{1,unbounded}</table>
</tables>
来源
<xs:element name="tables" minOccurs="0">
  <xs:annotation>
    <xs:documentation>A list of tables defined in this dataset.</xs:documentation>
  </xs:annotation>
  <xs:complexType>
    <xs:sequence>
      <xs:element name="table" type="Table" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

元素:dspl / tables / 表

命名空间 http://schemas.google.com/dspl/2010
图示 图示 dspl10.tmp#id102 dspl10.tmp#id89 dspl10.tmp#id90 dspl10.tmp#id97 dspl10.tmp#id88
类型 表格
属性
content: 复杂
maxOccurs: 无界限
模型 info{0,1}column+data{0,1}
儿童 columndatainfo
实例
<table id="">
  <info>{0,1}</info>
  <column format="" id="" type="">{1,unbounded}</column>
  <data>{0,1}</data>
</table>
属性
QName 类型 已修复 默认 使用 注解
id ID 必需 数据集中表的唯一标识符。
来源
<xs:element name="table" type="Table" maxOccurs="unbounded"/>

属性:dspl / import / @namespace

命名空间 没有命名空间
注释 导入的数据集的命名空间,以 URI 的形式指定。您必须先将前缀与此命名空间相关联,然后才能引用其内容。如需详细了解如何在 XML 中使用命名空间和前缀,请参阅 [XML 命名空间]。
属性
而应使用以下命令: 必需
使用方数量
元素 dspl/import
来源
<xs:attribute name="namespace" use="required">
  <xs:annotation>
    <xs:documentation>The namespace of the imported dataset, specified as
                  a URI. A prefix must be associated with this
                  namespace before its contents can be referenced. See
                  [XML Namespaces] for more information about the use
                  of namespaces and prefixes in XML.</xs:documentation>
  </xs:annotation>
</xs:attribute>

属性:dspl / import / @location

命名空间 没有命名空间
注释 可选位置,可以在其中找到导入的数据集的定义,以网址形式指定。如果省略了此位置,则处理此 DSPL 数据集的系统必须已经知道导入的数据集。实现备注:Google 数据集导入工具会忽略位置属性。Google 导入方必须事先知道导入的所有数据集。
属性
而应使用以下命令: 可选
使用方数量
元素 dspl/import
来源
<xs:attribute name="location" use="optional">
  <xs:annotation>
    <xs:documentation>An optional location where the definition of the
                  imported dataset can be found, specified as a
                  URL. If the location is omitted, the system
                  processing this DSPL dataset must already know the
                  imported dataset.

                  Implementation note: The Google dataset importer
                  ignores the location attribute. Any imported dataset
                  must be known by the Google importer beforehand.</xs:documentation>
  </xs:annotation>
</xs:attribute>

属性:dspl / @targetNamespace

命名空间 没有命名空间
注释 每个数据集都可以提供目标命名空间。目标命名空间是一个用于唯一标识数据集的 URI。如需详细了解如何在 XML 中使用命名空间,请参阅 http://www.w3.org/TR/REC-xml-name/。如果未提供 targetNamespace,则导入数据集时会生成一个命名空间。
类型 xs:anyURI
属性
而应使用以下命令: 可选
使用方数量
元素 dspl
来源
<xs:attribute name="targetNamespace" type="xs:anyURI" use="optional">
  <xs:annotation>
    <xs:documentation>Each dataset may provide a target namespace. The
              target namespace is a URI that uniquely identifies the
              dataset. For more information about the use of namespaces in XML,
              see:

              http://www.w3.org/TR/REC-xml-names/

              If no targetNamespace is provided,  then a namespace will be
              generated when the dataset is imported.</xs:documentation>
  </xs:annotation>
</xs:attribute>

使用 oXygen XML 编辑器创建。