XML Data – Semi-Structured Data XML 数据 - 半结构化数据

news2024/9/22 11:43:15

Outline • Structured, Semistructured, and Unstructured Data • XML Hierarchical (Tree) Data Model • Extracting XML Documents from Relational Databases • XML Documents, DTD, and XML Schema • XML Languages 结构化、半结构化和非结构化数据 - XML 层次(树)数据模型 - 从关系数据库中提取 XML 文档 - XML 文档、DTD 和 XML 模式 - XML 语言

Structured, Semi-structured, and Unstructured Data • Structured data — Represented in a strict format (schema) — Example: information stored in databases结构化数据 - 以严格的格式(模式)表示 - 例如:存储在数据库中的信息 • Semi-structured data — Has a certain structure — Not all information collected will have identical structure半结构化数据 - 具有一定的结构 - 并非所有收集到的信息都具有相同的结构  • Unstructured data — Limited indication of the of data document that contains information embedded within it 非结构化数据 - 数据文件的有限指示,其中包含嵌入的信息

Examples • Structured: Excel spreadsheets Comma-separated value file (.csv) Relational database tables • Semi-structured: Hypertext Markup Language (HTML) files, JavaScript Object Notation (JSON) files, Extensible Markup Language (XML) files • Unstructured: Audio, Video, Flat Text示例 - 结构化: Excel 电子表格 逗号分隔值文件(.csv) 关系数据库表格 - 半结构化: 超文本标记语言 (HTML) 文件、JavaScript Object Notation (JSON) 文件、可扩展标记语言 (XML) 文件 - 非结构化: 音频、视频、扁平文本

Semi-structured Data • Schema information mixed in with data values • Self-describing data • May be displayed as a directed graph — Labels or tags on directed edges represent:半结构化数据 - 混合在数据值中的模式信息 - 自描述数据 - 可以有向图的形式显示 ◦ Schema names ◦ Names of attributes ◦ Object types (or entity types or classes) ◦ Relationships有向边上的标签或标记表示: 模式名称 ◦属性名称 ◦对象类型(或实体类型或类) ◦关系037a51279a4244bca683b848e24a663b.pngXML: Extensible Markup Language • Data sources — Database storing data for Internet applications — Standard for data representation and exchange 数据源 - 为互联网应用程序存储数据的数据库 - 数据表示和交换标准 • Hypertext documents (HTML) — Common method of specifying contents and formatting of Web pages — Tags describe content instead of formatting 超文本文档(HTML) - 指定网页内容和格式的通用方法 • XML data model

XML Hierarchical (Tree) Data Model • Elements and attributes — Main structuring concepts used to construct an XML document 元素和属性 - 用于构建 XML 文档的主要结构概念• Complex elements — Constructed from other elements hierarchically 复杂元素 - 由其他元素分层构建• Simple elements — Contain data values 简单元素 - 包含数据值• XML tag names — Describe the meaning of the data elements in the document — Start tag: angled brackets – — End tag with a slash –XML 标记名称 - 描述文档中数据元素的含义 - 开始标记:带角度的括号 - <...> - 带斜线的结束标记 - </...>bf0f5c711f234ad094fa68a45a76c246.png Company ER Model

6d3b3d59786542a1901dc85b5c6b231a.png

Company Relational Model1f8f8906e1414aae89a26ae0cccf8cff.pngCompany Entities

9f5d8ced5397420c8c1ad27f90b3dbfa.png

Relational to XML Mapping

187b1657e3f74698ab14dfe5fedeaf2e.png

Relational Model v.s. XMLf5ecd643c58a4ef18815c41386be9e71.pngKnowledge Check • You’re creating a database to contain information about university records: students, courses, grades, etc. Should you use the relational model or XML? • You’re creating a database to contain information for a university web site: news, academic announcements, admissions, events, research, etc. Should you use the relational model or XML? • You’re creating a database to contain information about family trees (ancestry). Should you use the relational model or XML?d7554694024041c39b93b79be7b8249a.png“Well-Formed” XML Adheres to basic structural requirements • Single root element • Matched tags, proper nesting • Unique attributes within elements "格式完善的 "XML 符合基本结构要求 - 单一根元素 - 匹配的标记,适当的嵌套 - 元素内的唯一属性

bdb10ebe72b2456db4291a624cc6b888.pngbc12d2c008154ddb872da61d14b8d7a4.png

Displaying XML Use rule-based language to translate to HTML • Cascading stylesheets (CSS) • Extensible stylesheet language (XSL)使用基于规则的语言翻译成 HTML - 层叠样式表 (CSS) - 可扩展样式表语言 (XSL)

9cfa160796b646f59984585149ede0ab.png

Extensible Markup Language (XML) • Standard for data representation and exchange • Formal specification is enormous; we cover most important components

“Valid” XML Adheres to basic structural requirements • Also adheres to content-specific specification — Document Type Descriptor (DTD) — XML Schema Description (XSD)符合基本的结构要求 - 也符合特定内容规范 - Document Type Descriptor (DTD) - XML Schema Description (XSD)  所以是在“Well-Formed” XML的基础上符合特定内容规范

7b5584830ae848a195b5c93573ff8d1e.png

Document Type Descriptor (DTD) • Grammar-like language for specifying elements, attributes, nesting, ordering, #occurrences 文档类型描述符(DTD)--类似语法的语言,用于指定元素、属性、嵌套、排序和 #occurrences

1a22040fdd434a23981f27477530afec.png

a0b2a32fe2e34ca89a873e3ab338b0b3.png0f7269a9ed5e4aefb445e9b3db703b0e.png

XML Schema (XSD) • Extensive language • Like DTDs, can specify elements, attributes, nesting, ordering, #occurrences • Also data types, keys, (typed) pointers, and more • XSD is written in XML 扩展语言 - 与 DTD 类似,可指定元素、属性、嵌套、排序、#occurrences - 还可指定数据类型、键、(类型化)指针等 - XSD 以 XML 编写4627d3e322a14784851e15b2298809e5.png

DTD/XSD v.s. None (Well-Formed) • Advantages — Program can assume the structure — CSS/XSL rules are simple when program has particular structure — Specification language DTD as a specification what the XML look like — Documentation — Strongly typed Data • Disadvantages — Flexibility and ease of change is difficult — DTD can be messy irregular structure — Benefits of no typing //“Valid” XML对比“Well-Formed” XML的优点 - 程序可以假设结构 - 当程序具有特定结构时,CSS/XSL 规则很简单 - 规范语言 DTD 作为 XML 的外观规范 - 文档 - 强类型化数据 - 缺点 - 难以实现灵活性和易更改性 - DTD 可能是杂乱无章的不规则结构 - 无类型化的优点

Querying XML • Not nearly as mature as Querying Relational — Newer — No underlying algebraXML 查询 - 不如关系查询成熟 - 较新 - 没有底层代数 • Sequence of development — XPath: Path expression + conditions — XSLT: Xpath transformation, output formatting — XQuery: Xpath + full featured QL 发展顺序 - XPath: XSLT:Xpath 转换、输出格式化 - XQuery: X路径+全功能QL

XPath = Path expressions + Conditions XPath = 路径表达式 + 条件96415c0ce7224c0991a7ae0cde905cff.pngebf4dee335574d5c8c213799fd1846db.png

- 基本结构 - / :根元素分隔符

- 元素名称 X

- * : 匹配路径中的任何节点

- @ : 属性名

- // : 任何子节点或自通配符

- [C] : 条件

- [N] : 根据位置访问子节点

• Built-in functions (lots of them) — starts-with() and contains() : built-in functions work on string values and can be useful to access elements based on substring matches. /companyDB/employees/employee[starts-with(lname,"S")] /companyDB/employees/employee[contains(address,"Philadelphia")] 内置函数(很多) - starts-with() 和 contains():内置函数用于处理字符串值,可用于访问基于子串匹配的元素。  Navigation “axes” (13 of them) — Keywords that allows us to move in multiple directions from current node in path expression ◦ includes, self, child, descendent, attribute, parent, ancestor, previous sibling, and next sibling- 导航 "轴"(共 13 个)--允许我们从路径表达式中的当前节点向多个方向移动的关键字 ◦ 包括、自己、子节点、后节点、属性、父节点、祖节点、上一个兄弟节点和下一个兄弟节点

More Details • XPath queries operate on & return sequence of elements — XML document — XML stream • Sometimes result can be expressed as XML, not always XPath 查询操作并返回元素序列 - XML 文档 - XML 流 - 有时结果可表示为 XML,但并非总是如此

XQuery: FLWOR Expression • All except Return are optional • For and Let can be repeated and interleaved XQuery: FLWOR 表达式 - 除了 Return 之外,其他都是可选的 - For 和 Let 可以重复和交错使用8110111f5b7e4c6aa664a307bd533b8b.pngMixing Queries and XMLcf3285f55cec4ddea4382acdcc1b103f.png

Summary • Three main types of data: structured, semi-structured, and unstructured • XML standard — Tree-structured (hierarchical) data model — XML documents and the languages for specifying the structure of these documents • XPath and XQuery languages — Query XML data 三种主要数据类型:结构化、半结构化和非结构化 - XML 标准 - 树状结构(分层)数据模型 - XML 文档和指定这些文档结构的语言 - XPath 和 XQuery 语言 - 查询 XML 数据

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1536777.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Java最后一块石头的重量 II(力扣Leetcod1049)

最后一块石头的重量 II 力扣原题 有一堆石头&#xff0c;用整数数组 stones 表示。其中 stones[i] 表示第 i 块石头的重量。 每一回合&#xff0c;从中选出任意两块石头&#xff0c;然后将它们一起粉碎。假设石头的重量分别为 x 和 y&#xff0c;且 x < y。那么粉碎的可能结…

Java学习笔记NO.24

T1.完成理工超市系统的商品类及其子类的定义&#xff0c;实现“浏览商品”及“查看商品详情”功能 &#xff08;1&#xff09;商品类 public class Goods {public String name;public double price;public int count;public String desc;public Goods(String name, double p…

C/C++代码性能优化——编程实践

1. 编程实践 在一些关键的地方&#xff0c;相应的编程技巧能够给性能带来重大提升。 1.1. 参数传递 传递非基本类型时&#xff0c;使用引用或指针&#xff0c;这样可以避免传递过程中发生拷贝。参数根据是否需要返回&#xff0c;相应加上const修饰&#xff0c;代码更安全&am…

matlab实现机器学习svm

一、目的和要求 1.编程实现SVM训练函数和预测函数&#xff1b; 2.绘制线性和非线性边界&#xff1b; 3.编写线性核函数 二、算法 1.线性svm&#xff1a; 分离超平面&#xff1a;wxb0&#xff0c;对于线性可分的数据集来说&#xff0c;这样的超平面有无穷多个&#xff08;…

局部路径规划算法 - 贝塞尔曲线法 C++ matlab

参考资料&#xff1a; &#xff08;1&#xff09;贝塞尔曲线法 &#xff08;2&#xff09;曲线杂谈&#xff08;二&#xff09;&#xff1a;Bezier曲线的特殊性质 贝塞尔曲线法 1 算法概述 1.1 算法简介 贝塞尔曲线于1962年由法国工程师皮埃尔贝塞尔&#xff08;Pierre Bzi…

(2023)mac 安装Android studio(安装jdk,Android SDK)

一、安装jdk并配置环境变量 1.下载安装jdk 网址&#xff1a;Java Downloads | Oracle 注意这里需要注册登录后才可下载。 选择下载java8&#xff0c;jdk1.8。打开安装即可。 ​ 2.配置环境变量 打开终端&#xff0c;输入java -version&#xff0c;能够看到jdk版本&#…

PyTorch深度学习:如何提升遥感影像的地物分类精度?

我国高分辨率对地观测系统重大专项已全面启动&#xff0c;高空间、高光谱、高时间分辨率和宽地面覆盖于一体的全球天空地一体化立体对地观测网逐步形成&#xff0c;将成为保障国家安全的基础性和战略性资源。未来10年全球每天获取的观测数据将超过10PB&#xff0c;遥感大数据时…

SpringBoot+Vue项目(后端项目搭建 + 添加家居)

文章目录 1.使用版本控制管理该项目1.创建远程仓库2.克隆到本地 2.后端项目环境搭建1.创建一个maven项目2.删除不必要的文件夹3.pom.xml文件引入依赖4.application.yml 配置数据源&#xff08;注意&#xff0c;数据库名还没写&#xff09;5.com/sun/furn/Application.java 编写…

java练习题目1:让用户从键盘键入长方体的长,宽,高,计算并输出它的表面积与体积

每日小语 我相信即便是一道简单的题目&#xff0c;背后也有深刻的自然规律&#xff0c;通向那最高的“道”。 即便一个晚上&#xff0c;一道题也没做出来&#xff0c;只是不断地体悟那些解法与思想。彷佛这是一趟心灵的朝圣之旅。 …

Ubuntu24.04即将发布,支持Linux内核6.8。该版本会有哪些亮点?

更多内容在 Canonical 计划 2024 年 4 月发布 Ubuntu 24.04 LTS 发行版&#xff0c;将获得长达 12 年的支持。Ubuntu 24.04 LTS&#xff0c;代号“Noble Numbat”&#xff0c;是Ubuntu发行版的最新长期支持&#xff08;LTS&#xff09;版本。12年的支持意味着你会得到 五年的维…

tinyrenderer-Bresenham绘制直线算法

如何画线段 第一种尝试 求x&#xff0c;y起始点的差值&#xff0c;按平均间隔插入固定点数 起始点平均插入100个点&#xff1a; void line(int x0, int y0, int x1, int y1, TGAImage& image, TGAColor color) {for (float t 0.; t < 1.; t .01) {int x x0 (x1 -…

2024计算机二级Python 11和12

单向列表不能再回头&#xff0c;只有从头指针开始才可以&#xff0c;双向列表会出现重复访问&#xff0c;二叉树节点从根开始可以达到目的 面向对象的主要特征&#xff1a;抽象、封装、继承、多态 Python通过解释方式执行&#xff0c;执行速度没有采用编译方式的语言执行的快 f…

Docker【docker使用】

文章目录 前言一、概念二、常用方法1.镜像2.容器 三、镜像与镜像的关系&#xff0c;以及镜像构建和管理 前言 上一篇文章讲了docker的安装&#xff0c;本片文章我们来聊聊docker的一些常用操作。以及镜像、容器之间的关系 如果你想更加系统的学习docker&#xff0c;请看【dock…

蓝桥杯(3.21 刷真题)

P8682 [蓝桥杯 2019 省 B] 等差数列 import java.util.Arrays; import java.util.Scanner; public class Main {public static void main(String[] args) {Scanner sc new Scanner(System.in);int n sc.nextInt();int[] res new int[n1];for(int i1;i<n;i)res[i] sc.ne…

elasticsearch的数据搜索

DSL查询文档 elasticsearch的查询依然是基于JSON风格的DSL来实现的。 Elasticsearch提供了基于JSON的DSL(Domain Specific Language)来定义查询。常见的查询类型包括: 查询所有:查询出所有数据,一般测试用。例如:match_all 全文检索(full text)查询:利用分词器对用户…

虚拟直播赋能文旅,蓝海创意云亮相文旅虚拟现实应用推广交流活动

3月21日&#xff0c;由文化和旅游部产业发展司主办&#xff0c;中国信息通信研究院、北京市石景山区文化和旅游局、中国动漫集团有限公司承办的文化和旅游虚拟现实应用推广交流活动在首钢一高炉SoReal科幻乐园33 Meta Club举办。蓝海创意云应邀参与此次活动&#xff0c;携vLive…

ON1 NoNoise AI 2024 for mac v18.2 中文版 ai摄影

ON1 NoNoise AI 2024 for mac一款去除图像噪点的应用&#xff0c;特别对于摄影师来说&#xff0c;它是比较专业的摄影降噪软件。 软件下载&#xff1a;ON1 NoNoise AI 2024 for mac v18.2 中文版下载 智能降噪&#xff1a;利用先进的机器学习技术&#xff0c;ON1 NoNoise AI 20…

第5讲-MIPS(3)汇编语言

三、MIPs汇编语言(自学) 1.概述

taro之Picker,PickerView基础用法

1.Picker 直接上代码 import Taro,{Component} from "tarojs/taro"; import {View,Picker} from tarojs/components import { AtIcon } from taro-ui import { putKey } from /src/utils/storage-utilsclass AgriculturePolicy extends Component{constructor (prop…

部署Zabbix Agents添加使能监测服务器_Linux平台_Yum源/Archive多模式

Linux平台 一、从yum源脚本安装部署Zabbix-Agent,添加Linux Servers/PC 概述 Zabbix 主要有以下几个组件组成: Zabbix Server:Zabbix 服务端,Zabbix的核心组件,它负责接收监控数据并触发告警,还负责将监控数据持久化到数据库中。 Zabbix Agent:Zabbix客户端,部署在被监…