原站英文机器转录 + 本地中文机器初译(未完成逐句听审) 原作者及许可见 attribution.txt;中文由九天新增,不代表原作者认可。 00:00:11.120 EN: Today, we talk about the SparkQL query language after we discussed the web ontology language and the reasoning with OWL, with ontologies in the last week. 中文初译: 今天,我们讨论SparkQL问询语言后, 我们讨论了网络本体语言以及“OWL”的推理, 00:00:25.420 EN: And SparkQL also builds on top of RDF. You can see that here in the linked data stack. So it's a query language inspired also by SQL for relational databases. 中文初译: SparkQL 也建在“ RDF” 之上。 您可以在链接的数据堆中看到这一点。 因此它是一种查询语言, 由关系数据库的“ SQL” 启发。 00:00:39.480 EN: We will discuss SparkQL, basic SparkQL, and then also some advanced features today. So let me go to the next slide. 中文初译: 我们将讨论SparkQL, 基础的SparkQL, 然后今天还有一些先进的特征。所以让我看下一张幻灯片。 00:00:51.880 EN: SparkQL stands for SparkQL protocol and RDF query language. It's a standard by W3C as most of the semantic web standards. 中文初译: SparkQL 代表 SparkQL 协议和“ RDF” 查询语言。 W3C 将它作为大多数语义网络标准的标准 。 00:01:05.300 EN: And it defines a protocol for issuing SparkL queries and receiving the results. And there's also the SparkL query results format. 中文初译: 它定义了发布 SparkL 查询和接收结果的程序。 还有SparkL 查询结果格式 。 00:01:16.920 EN: It's an XML format and an XML document for representing the results of SparkL queries. There have been many proposals before about query languages. 中文初译: 这是代表 SparkL 查询结果的“ XML” 格式和“ XML ” 文件。 以前有许多关于查询语言的建议 。 00:01:32.620 EN: Here you see some predecessors of SparkQL. And this resulted then in the SparkQL standard. And we will cover what is the W3C recommendation. 中文初译: 这里您可以看到 SparkQL 的一些前身。 这导致了 SparkQL 标准。 我们将覆盖 W3C 建议的内容 。 00:01:46.280 EN: So one predecessor was RDQL and RQL or CRQL. These were our predecessors basically of SparkQL. Then there was also an extension of SparkQL. 中文初译: 因此,有一个前任是RDQL和RQL或CRQL。他们基本上是我们的前身SparkQL。然后是SparkQL的延期。 00:02:03.000 EN: SparkQL 1.0 was standardized in 2008, so almost 15 years ago. And then there was an update SparkQL 1.1 later on done by the W3C SparkQL working group. 中文初译: SparkQL 1. 0 于2008年标准化,几乎15年前。后来W3C SparkQL工作组更新了SparkQL 1. 1。 00:02:23.260 EN: And you can find a lot of further details and information on the W3C pages. So what is the basic structure of SparkQL queries? 中文初译: 在 W3C 页面上可以找到更多细节和信息。SparkQL 查询的基本结构是什么? 00:02:38.180 EN: So it builds on triples. So on RDF basically, statements about things or resources using your eyes and literal values that's exactly the same as an RDF. 中文初译: 所以它建立在三重上。所以“RDF ” 基本上,用你的眼睛和字面价值来表达事物或资源, 与“RDF”完全一样。 00:02:53.460 EN: Since we were talking in the last lectures about ontologies, maybe we'll repeat some details about that. Or there are some pictures unfortunately missing here. 中文初译: 既然我们在上次的讲座上谈论了肿瘤学, 也许我们会重复一些细节。 或者这里不幸丢失了一些照片。 00:03:05.580 EN: And these triples can be organized in vocabularies which share the concept of a domain which utilize your eyes as unique identifiers and define properties and classes as we have discussed it in our RDF schema and our lectures. 中文初译: 这些三重元素可以组织在不同的词汇里, 共同的概念是 利用你的眼睛作为独特的识别资料 并定义属性和阶级, 正如我们在我们的“RDF”计划和讲座中讨论的。 00:03:29.560 EN: And there are some well-known vocabularies which have namespace prefixes like RDF, RDF schema, FOA, or also DBpedia. 中文初译: 还有一些著名的词汇库,有命名空间前缀,如“RDF”、“RDF”schema、FOA或DBpedia。 00:03:40.580 EN: And of course, there can be arbitrary custom further vocabularies which can be used in SparkQL queries. A sparkle endpoint exposes one or more graphs. 中文初译: 当然,还可以有任意的自定义的进一步词汇,可用于SparkQL查询。一个闪亮的终点暴露了一个或多个图表。 00:03:55.280 EN: And it uses the HTTP protocol for interacting with the sparkle endpoint. So HTTP is the web protocol which is used by web servers to serve web pages. 中文初译: 它使用 HTTP 协议与闪光端点进行互动。 所以 HTTP 是网络协议, 被网络服务器用来为网页服务 。 00:04:09.600 EN: And the same is used here for issuing or for connecting to a sparkle endpoint. And a sparkle endpoint, a triple store basically expects a parameter query with either post or get the encoded query. 中文初译: 此处用于发行或连接火花端点也使用同样的方法。而一个火花端点,即三重商店, 基本上期望有一个参数查询, 要么是发布,要么是获得编码查询。 00:04:30.320 EN: And there is by default no relation between the graph name and the endpoint name. But it's of course good practice if the URIs coincide. 中文初译: 默认情况下,图形名称和终点名称之间没有关联。 但是如果“ URIs” 相吻合, 当然这是好的做法 。 00:04:41.660 EN: So when you connect to a sparkle endpoint, you have a URL basically of how you can access the endpoint. And then it's a good practice that you use the same URI namespace prefix also for the graphs in your sparkle endpoint. 中文初译: 所以当您连接到一个闪亮的终点时, 您有一个 URL 基本上可以访问端点。 然后这是一个好的做法, 您也可以使用相同的“ URI” 命名空间前缀, 在您的闪亮端点中的图形中也使用同样的“ URI” 命名空间前缀 。 00:05:02.440 EN: But of course, you can also load other data sets into sparkle endpoint which might have other namespace prefixes. 中文初译: 当然,您也可以将其他数据集装入火花端点中,其中可能包含其它命名空间前缀。 00:05:13.550 EN: Now I have a problem with the images here. So maybe let me quickly. So basically, when we talk about data access, also if you look how this is done with different technologies, there are of course also other data access languages. 中文初译: 现在,我对这里的图像有问题。所以也许让我快速地说一下。 基本上,当我们谈论数据存取的时候, 如果你看看如何用不同的技术来做, 当然还有其他的数据存取语言。 00:05:39.290 EN: So many of you have heard about SQL, which is a query language. So we have different data models like you see that here on the bottom of the slide, relational databases, column-oriented database management systems, then triple stores or quad stores, which are the ones used for RDF, RDF schema and OWL, and then also other ones like XML, 中文初译: 你们中许多人听说过“SQL”是一个查询语言。所以我们有不同的数据模型,比如在幻灯片底部看到的数据模型、相关数据库、专栏导向的数据库管理系统、三家商店或四家商店,这些商店是用于“RDF”、“RDF”和“OWL”的商店,还有“XML”等其他商店。 00:06:09.090 EN: hierarchical, tree, graph-oriented databases. And the data model in a way also implies how the data can be accessed. 中文初译: 数据模型也意味着如何访问这些数据。 00:06:19.350 EN: And on the access layer, there are classical, for example, object-relational mappings, ORM for object-oriented or relational databases. 中文初译: 在存取层上,有典型的,例如物体-关系图绘制、对象导向或关系数据库的ORM。 00:06:30.150 EN: There are procedural APIs like ODBC and JDBC. There is linked data as an data access paradigm where you can retrieve resources using HTTP URIs. 中文初译: 有像ODBC和JDBC这样的程序性API。有链接的数据作为数据访问模式,您可以利用 HTTP “URIs” 检索资源。 00:06:49.250 EN: And then there are different query languages which must respect the data model. So for relational database, we have Datalog and SQL. 中文初译: 然后有不同的查询语言必须尊重数据模型。所以对于关系数据库,我们有数据log和“SQL”。 00:07:00.800 EN: For triple store, Spark UL. For XML, for example, XPath and XQuery. And then there are different data integration paradigms on the data web, the local SVU data integration paradigm. 中文初译: 对于三家商店,Spark UL。比如“XML ” ( XML), XPath 和 XQuery。然后数据网络上的数据整合模式不同,当地SVU数据整合模式也不同。 00:07:15.050 EN: But there are also peer-to-peer data integration mediators, enterprise information integration. One very common paradigm was also data warehousing in enterprises where you extract, transform, and load data into a data warehouse. 中文初译: 但也有同行数据整合调解者、企业信息整合。 一个非常常见的范例是将数据储存在提取、转换和装入数据仓的企业中。 00:07:34.090 EN: And that follows the global SVU paradigm. A global SVU means that you have a global schema which your data warehouse basically stores, and then you transform different data sets into your global schema. 中文初译: 这遵循了全球SVU模式。全球SVU意味着你拥有一种全球模型, 数据仓基本上储存着这些数据, 然后将不同的数据集转换成你的全球模型。 00:07:51.170 EN: While on the web, we work with the local SVU, follow the local SVU paradigm where we see basically Spark UL as, or we see ontologies as some kind of local schemas. 中文初译: 在网络上,我们与当地SVU合作, 遵循当地的SVU模式, 我们基本上把Spark UL看成是, 或者我们把肿瘤学看成某种地方计划。 00:08:11.350 EN: And we interpret the data according to these local schemas. We learned basically in RDF schema how we can reason and howl with SQL, but we cannot really query a data set. And that's what Spark UL allows. 中文初译: 我们根据这些本地的图案来解释数据。我们基本上在“RDF”图案中学会了如何用“SQL”来理性和嚎叫,但我们无法真正查询数据集。这正是斯帕克UL允许的。 00:08:38.540 EN: So here you see an example query, basically a simple example query. So we have a prefix declaration in the beginning of the document here. 中文初译: 这里您可以看到一个示例查询, 基本上是一个简单的示例查询。 所以我们在文档的开头有一个前缀声明 。 00:08:49.240 EN: Then we have a select clause. So we select certain variables, in that case here a title and author. And then a where clause where we have a graph pattern which consists of subject, predicate, object, triple patterns. 中文初译: 然后我们有一个选择条款。所以我们选择了某些变量, 在这样的情况下, 这里选择了标题和作者。 然后选择了一个条款, 我们有一个由主题、 谓词、 对象、 三个模式组成的图形模式 。 00:09:08.180 EN: But other than with triples, we have variables. For example, we have here the variable book, which stands for book. 中文初译: 但除了三本之外,我们还有变量。例如,我们这里有可变书,它代表书籍。 00:09:16.480 EN: So the subject, predicates, or objects can also not only refer to URIs, to properties, and classes, and instances, but they can also refer to variables. 中文初译: 因此,主体、谓词或物体不仅可以指“URIs”,还可以指属性、类别和实例,也可以指变量。 00:09:30.820 EN: And with such a pattern basically we have, we can use different, here in that case we have three triple patterns. 中文初译: 有了这样一个模式,我们基本上有这样的模式, 我们可以使用不同的模式, 在这种情况下,我们有三个三重模式。 00:09:40.060 EN: We can construct basically a graph pattern. So a graph pattern then consists of three of these triple patterns here. 中文初译: 我们可以基本上构建一个图形图案。因此,一个图形图案由三个三重图案组成。 00:09:50.780 EN: And they define a pattern which is then looked for or retrieved from the triple store. So in that case, we look for books which are published by a certain publisher, in that case here Springer. 中文初译: 他们定义了一种模式,然后从三重商店中寻找或检索。在这种情况下,我们找的是由某个出版商出版的书籍,这里就是斯普林格。 00:10:07.680 EN: And we are interested in the titles of these books and the authors. That's the second and the third triple. The second one retrieves the title and the third one the author. 中文初译: 我们对这些书和作者的书名感兴趣。这是第二和第三次。第二次取回标题,第三次取回作者的名称。 00:10:20.880 EN: And since they all have the same variable as subject, in that case here book, it means that we look for basically resources with the same identifiers as subjects. 中文初译: 因为他们都有相同的变量, 在这样的例子中,这本书, 这意味着我们基本上寻找资源, 与对象具有同样的识别特征。 00:10:37.720 EN: So if you have a small example RDF document, which you can see here, for example, like a semantic web book is published by Springer, the Springer publisher. And we have then a property title, which is here semantic, it's a literal semantic web krundlagen. 中文初译: 所以,如果你有一个小例子“RDF”文档, 你可以在这里看到, 比如说,像 Springer 出版社斯普林格出版的语义网页。 然后我们有了产权, 就是这里的语义, 它是一个字面语义网络krundlagen。 00:10:59.760 EN: And we have different authors. And there we have a list of four authors. So these are basically four triples which all have semantic web as subject, author as predicate, and then Hitler, Koch, Rudolf, and Zuhr as objects. 中文初译: 我们有不同的作者。我们有一个四位作者的名单。基本上,这四位作者是三重的, 它们都以语义网络为主体, 以作者为谓词,然后是希特勒,科奇,鲁道夫和祖尔作为对象。 00:11:15.940 EN: When we then issue this query, basically we get results. And if we look back at our query, we were asking for two variables, title and author. 中文初译: 当我们发布这个查询时, 基本上我们得到了结果。如果我们回顾我们的查询, 我们要求两个变量, 标题和作者。 00:11:27.560 EN: So please note that actually the book itself is not retrieved, it's just a helper variable here in that case. So what is returned is a table with two columns. 中文初译: 所以请注意,实际上这本书本身没有被检索到, 它只是一个助手变量, 在这样的情况下。 因此返回的是一个带有两列的表格。 00:11:39.380 EN: And these columns correspond exactly to the variables which were mentioned in the select clause. So that is title and author. So we get a table with two columns. 中文初译: 这些列与选择条款中提到的变量完全对应。 这就是标题和作者。所以我们得到了一张有两列的表格。 00:11:52.260 EN: And we get then a result for each match. And each match, basically the pattern is matched for each of the authors because we basically have a different result for each of the authors. 中文初译: 然后我们得到每场比赛的结果。 每一场比赛, 基本上每个作者的格局都匹配, 因为我们对每一个作者的结果基本不同。 00:12:07.600 EN: So we have semantic web kundlag as title, and then the author Hitler, and the same for Koch, for Rudolf, and for Zuhr. 中文初译: 因此,我们有语义学的网页 kundlag作为头衔, 然后作者希特勒, 对Koch、鲁道夫和Zuhr也是一样。 00:12:15.920 EN: So basically the pattern is evaluated multiple times. And as many times as the pattern is found in the graph, results are returned. 中文初译: 基本上,该图案被多次评估。只要图中发现图案的次数,结果就会返回。 00:12:25.180 EN: And these results are then returned as a table in a tabular form. So these basic graph patterns are sets of triples in turtle syntax. 中文初译: 然后这些结果以表格形式作为表格返回。因此,这些基本图表模式是海龟语法中的三重图案。 00:12:38.120 EN: And we can also use this shortcut like comma or semicolon in the graph patterns. Variables are indicated either with a question mark or the dollar sign. 中文初译: 我们也可以使用这个快捷键, 比如在图形模式中的逗号或分号。 变量用问号或美元符号表示 。 00:12:50.420 EN: So it doesn't really matter which one you use if you use question mark variable or dollar variable. And you can use variables as subject, predicate, or object, or even end object. 中文初译: 所以如果使用问号变量或美元变量,那么使用哪个变量并不真正重要。您也可以使用变量作为主题、谓词或对象,甚至最终对象。 00:13:03.620 EN: You can also create a triple pattern where you have a subject, predicate, end object variables. And you can see here the same query basically. 中文初译: 也可以创建三重图案,其中您有一个主题、上游、最终对象变量。这里可以大致看到相同的查询。 00:13:17.780 EN: Here the variable names are not readable. These are just numeric, alphanumeric identifiers. That's, of course, perfectly fine. 中文初译: 这里变量名称无法读取。 这些只是数字的字母数标识符。 当然,这很好。 00:13:26.380 EN: So it's not required that the variables have any semantics or any name. You can basically use arbitrary identifiers. 中文初译: 所以不需要变量具有任何语义或名称。 您基本上可以使用任意的标识符 。 00:13:37.520 EN: But of course, the queries get better readable if you use speaking names for the variables. So there can be also blank notes in SparkQL. 中文初译: 当然,如果您使用变数的语音名称,查询会更容易读懂。因此在 SparkQL 中也可以有空白便条。 00:13:48.240 EN: So they are also possible as a subject or objects. They can have arbitrary IDs. The blank notes are basically placeholders for unknown elements. 中文初译: 因此它们也可以作为对象或对象。 它们可以任意使用 ID 。 空白笔记基本上是未知元素的占位符 。 00:14:03.360 EN: And they can be bound to different result sets. So here we have some examples for blank notes in SparkQL. And there are also data types, of course, in RDF data sets. 中文初译: 他们可以被绑在不同的结果组中。 因此这里我们有一些用于 SparkQL 中的空白笔记的例子。 当然, 在“ RDF” 数据集中也有数据类型 。 00:14:25.560 EN: So if you have such a data set here like the one on top, you have example, and property, property test, a test string, test with the language tag DE, and another fourth example, triple with a numeric value here, an integer. 中文初译: 所以,如果您在像上面的数据集这样的数据组里, 您有示例, 属性, 属性测试, 测试字符串, 使用语言标记 DE 进行测试, 还有第四个例子, 三倍于数字值, 一个整数。 00:14:52.330 EN: And then we now have a query which contains the following triple pattern, subject, example, or property, and then tests. 中文初译: 现在我们有一个查询 包含以下的三重模式, 主题,例如,或者属性, 然后测试。 00:15:03.770 EN: It retrieves only one result. And that's the first one here because SparkQL really evaluates the literals based on the string matching, also taking the data types and the language tags into account. 中文初译: 它只取回一个结果。 这是这里的第一个结果, 因为 SparkQL 真正根据字符串匹配来评估字面, 同时也考虑到数据类型和语言标记 。 00:15:20.570 EN: So if you just vary for such a literal, you will also only retrieve the first result, although the second one and maybe also the third one are semantically almost equivalent. 中文初译: 所以,如果你只是改变字面上的内容, 你也会只取回第一个结果, 尽管第二个结果和第三个结果几乎相等。 00:15:32.890 EN: Definitely the second one, the third one has a language tag, so that has a bit of different semantics indicating that the literal here corresponds to a certain language. 中文初译: 肯定的第二个,第三个有一个语言标记, 所以它有一点点不同的语义 表示这里的字面对应某种语言。 00:15:45.350 EN: So for numeric value, we can just use the numeric value. So you don't have to indicate the data type. So it will automatically cast basically the data type to this numeric value. 中文初译: 因此,对于数值值,我们可以只使用数值值。所以你不必表示数据类型。因此它会自动将数据类型投放到这个数值上。 00:16:01.570 EN: We can group these triple patterns in a query using the curly brackets. So here you have an example. Our example, we have title, author, where, and then we have a first part, subgraph, basically, pattern, subgraph pattern, where we look for books. 中文初译: 我们可以使用卷轴括号将这些三重模式分组到一个查询中。 因此这里您可以举一个例子。 我们的例子, 我们有标题, 作者, 然后我们有第一部分, Subgraph, 基本上, 模式, Subgraph 模式, 我们寻找书籍。 00:16:24.810 EN: And then the third one is separated here. It doesn't make a difference. You can even have empty triple or graph patterns inside, but they will be just pruned. 中文初译: 然后第三个是在这里分开的。这没有区别。你甚至可以里面有空的三重或图形模式, 但是它们只会被切割出来。 00:16:36.450 EN: They will be just ignored if there is an empty one. But that allows you to group the triple patterns, especially if you have larger queries, then it makes sense to have such a grouping. 中文初译: 如果有一个空的,它们就会被忽略。但是这允许你对三重模式进行分组,特别是如果您有更大的查询,那么这样组合是有道理的。 00:16:51.390 EN: So then it's also possible to indicate optional parts of a graph pattern, and that's what we see here. So for example, if you want to get all the books, but some books might not have a title, some books might not have authors, we can indicate these parts with the optional keyword here. 中文初译: 因此,也有可能显示图表图案的可选部分, 这就是我们在这里看到的。例如,如果你想要获得所有书籍, 但是有些书可能没有标题, 有些书也许没有作者, 我们可以用可选关键字来表示这些部分 。 00:17:17.490 EN: And then basically in curly brackets indicate the optional part. So this can be either a single triple pattern, but it can be also a full graph pattern optional. 中文初译: 然后基本上在卷括号中表示可选部分。因此,这可以是单一的三重模式,但也可以是完整的图表模式。 00:17:32.990 EN: And then it tries to find matching sets of triples in our knowledge base. But if it doesn't find some for these optional parts, this is not a problem, and they will be then empty basically in the result set. 中文初译: 然后它试图在我们的知识库中找到匹配的三重数组。 但如果它找不到这些可选部件, 这不是一个问题, 并且结果组将基本是空的 。 00:17:53.690 EN: So you can see that here on the button, we have this table with three columns with all the variables. So in that case, we have a book as the first variable, then the title and the author. 中文初译: 所以您可以看到,在按钮上, 我们有这张表格, 上面有三个列, 包含所有变量。 在这种情况下, 我们有一个书作为第一个变量, 然后是标题和作者 。 00:18:08.330 EN: And you can see that for some of the books, there is no author, like for the second result here, book number two. 中文初译: 你可以看到,对于一些书来说, 没有作者, 和这里的第二个结果一样, 第二本书。 00:18:17.210 EN: So the author cell in the result table is empty, or we also say unbound. It's not bound to a concrete resource. 中文初译: 因此结果表中的作者单元格是空的, 或者我们说没有约束。 它不受混凝土资源的约束 。 00:18:26.230 EN: The variable is not bound to a resource. In that case, the variable author. In the third case, it's again bound. In that case here to a blank node. 中文初译: 变量不受资源的约束。 在此情况下, 变量作者。 在第三个案例中, 它再次被约束 。 在那个例子中, 这里的空节点是空的 。 00:18:37.830 EN: In the fourth case, fourth result, there is no title. So the title variable is not bound to a concrete literal or resource, while the author is bound. 中文初译: 第四起案件的结果是,第四起案件没有标题。因此,标题变量不受具体字面或资源的约束,而提交人则受约束。 00:18:52.010 EN: And in the fifth result, we have neither title nor author. So all possible in that case combinations are possible because we have here optional separately for title and for author. 中文初译: 第五个结果,我们既无所有权,也无作者。所以在这种情况下,所有可能的组合都是可能的,因为我们在这里可以选择产权和作者。 00:19:05.030 EN: Then we have also the possibility to build unions of queries. For example, so these are alternative parts. So we have a book is published by a publisher, and then the first triple patterns ends. 中文初译: 然后我们也可以建立查询联盟。例如,这些是可供选择的部分。所以我们有一本书是由出版商出版的,然后是第一个三重模式结束。 00:19:22.970 EN: And then we have a second triple pattern for the author. And then we have a union with a third triple pattern with the editor. 中文初译: 然后我们为作者准备了第二个三重模式。然后我们与编辑组成了一个 第三个三重模式的联盟。 00:19:35.310 EN: And the result here is the union of the results of both graph patterns as if they were evaluated individually. So basically, you could do this with two Sparker queries. 中文初译: 这里的结果是两种图形模式结果的结合, 仿佛它们都是单独评估的。所以基本上, 你可以用两个斯帕克查询来做这个。 00:19:50.690 EN: But as a shortcut, you can use the union keyword basically, and then you can combine the result sets from two queries into one. 中文初译: 但作为一个捷径,你可以基本上使用联盟关键字, 然后将两个查询的结果组合合并为一个。 00:19:59.830 EN: Of course, the variable names in both parts of the union, they are not influencing each other. But since you have only a single result set table, you have to be careful with the variables that you also get those results which match basically. 中文初译: 当然,工会两个部分的变量名称不会相互影响。但是既然你只有一个结果组合表,那么你必须小心那些也得到基本匹配结果的变量。 00:20:21.190 EN: And then there's also the possibility, of course, to combine optional and union. So here we see an example for that. 中文初译: 当然,还有将任择和结合结合起来的可能性。所以我们在这里看到一个这方面的例子。 00:20:29.710 EN: We have book is published by a publisher as a first triple pattern. Then we have a second triple pattern for the author. 中文初译: 我们的书是出版商出版的第一三版。然后我们为作者提供了第二三版。 00:20:40.730 EN: Then we build a union with book as editor, author, optional author, last name, and name. So it basically here builds the union of two patterns with an appended optional one. 中文初译: 然后我们以编辑、作者、任选作者、姓和姓名等身份建立书联。因此,它基本上构建了两种模式的结合,其中一种是随附的可选模式。 00:21:02.510 EN: So the union binds stronger than optional in that case. And to make this more clear, you could also use the brackets, and you can see here that we start here, the curly brackets. 中文初译: 因此,在这样的情况下,结合比可选性更紧密。为了让这一点更加明确,你也可以使用括号,你可以看到我们从这里开始,就是卷轴括号。 00:21:18.050 EN: Here we have another curly bracket, which ends after... Oh, there's actually one missing here. There should be... 中文初译: 我们这里还有一个卷轴括号, 结尾是... 00:21:28.790 EN: Ah, which ends actually here, right? Yeah. So this part is evaluated. So this is the same as on top, but for better clarity, we added the curly brackets. 中文初译: 啊,结束在这里,对吗?所以这个部分是被评估的。这和上面一样,但为了更清楚起见,我们加了卷轴括号。 00:21:40.190 EN: So first it evaluates basically the union, and then evaluates the optional part. So as I said, the union binds stronger. 中文初译: 首先,它评估了工会的基本情况,然后评价了任择部分。所以正如我所说,工会的结合更加紧密。 00:21:53.640 EN: So either you can indicate how you want to have the combination by adding the curly brackets. If you omit them, then you have to be aware that union has a stronger binding than optional. 中文初译: 因此,您也可以通过添加卷轴括号来显示组合的方式。 如果您略去这些括号, 那么您必须意识到工会的约束力比任择性更强。 00:22:08.060 EN: So optional is always referring to the pattern right of optional, and optional and union are referring to the patterns left of that. 中文初译: 因此,任选总是指任择权的模式,而任选和工会则指任选的剩余模式。 00:22:28.750 EN: So here we have a bit more complicated example. So we have a triple pattern as 1P101, optional as 2P202. And then we have a union, then another optional clause, and then a further optional clause, yeah? 中文初译: 因此,我们这里有一个比较复杂的例子。所以我们有一个三重模式,1P101,2P202,可选。然后我们有一个联盟,另一个任择条款, 还有一个任择条款,是么? 00:22:49.510 EN: So you can have arbitrary many unions and optional clauses, and then we have that here indicated with the curly brackets. 中文初译: 所以你们可以任意设立许多工会和任择条款, 然后我们在这里用卷轴括号表示这一点。 00:22:58.230 EN: So the first optional is evaluated, then the union is evaluated, you can see that here. Then this third optional is evaluated. 中文初译: 第一个选项被评估,然后工会被评估, 你可以在这里看到。然后第三个选项被评估。 00:23:17.220 EN: And finally, sorry, that was here the third optional, and finally the fourth optional one. So it's always good to add these curly brackets to make it clear what the intended meaning is of such basically optional or union queries. 中文初译: 最后,抱歉,这是第三种选择,最后是第四种选择。所以,加入这些卷轴括号总是有好处的,这样可以明确这种基本上属于任择性或工会性的询问的含义。 00:23:41.700 EN: So another feature in SPARQL is filters. So for example, we want to get people which are between 18 and 23 year old. 中文初译: 所以“SPARQL”中的另一个特征就是过滤器。例如,我们想让18至23岁的人加入。 00:23:52.800 EN: We want to get last names of people which contain a dash. We want to obtain texts in German language, which are given in an ontology, and we can use filter as basic mechanisms for such expressions. 中文初译: 我们希望获得含有破折号的人的姓氏。 我们想要获得德文文本,这些文本以本体论形式提供,我们可以使用过滤器作为表达方式的基本机制。 00:24:17.340 EN: And let's have a look at some filter conditions. Here we have our basic example query again, we look for books which are published by a certain publisher, in that case, again, Springer Verlag, and we want to look for the price of the book. 中文初译: 让我们来看看一些过滤条件。这里我们再次有了基本的例子查询, 我们寻找由某个出版商出版的书籍, 也就是说, 斯普林格·弗拉格, 我们想看看这本书的价格。 00:24:36.620 EN: So we have indicated the price here, and then we add a filter clause. So that's done with this filter keyword and in round brackets, we then have the filter clause. And here in that case, these can be comparisons, Boolean and binary comparisons. 中文初译: 因此我们在这里表明了价格, 然后我们添加了一个过滤条款。所以用这个过滤关键词和圆括号来完成, 我们接着有了过滤条款。 在这样的情况下,可以进行比较, Boulean 和 二进制比较。 00:24:59.900 EN: In that case, we check for the price being lower than 35. And there are a number of these comparisons defined and also functions which are partially reused from XQuery and XPath standard in XML. 中文初译: 在这种情况下,我们检查价格是否低于35美元。 有一些比较已经确定,有些功能也从XQuery和XPath标准“XML”中部分重新使用。 00:25:19.160 EN: What are the comparison operators? So here we see the comparison operator. So we have smaller than equal, we have larger, we have smaller or equal, we have larger or equal, and then we have unequal. 中文初译: 比较操作员是什么? 因此我们在这里看到比较操作员。 所以我们有比等的更小, 我们有更大的,我们有小的或同等的, 我们有更大的或同等的, 然后是不平等的。 00:25:38.400 EN: So these are the comparison operators which you can use in filter clauses and Sparkly queries. The literals are compared using the natural order. 中文初译: 这些是比较操作器, 您可以在过滤条款和闪烁查询中使用。 字面用自然顺序来比较 。 00:25:51.240 EN: So for, this is supported for numeric data types, but also for dates, for example. For strings, it uses the alphabetic order, and if you have Boolean values, then one is larger than zero. 中文初译: 对于此选项, 支持数字数据类型, 也支持日期。 例如, 对于字符串, 它使用字母顺序, 如果您有布尔值, 那么一个大于零 。 00:26:07.900 EN: So pretty standard with the data types. For all other data types, so other than numeric and string data types, there is no only equal or unequal available, because other data types might not have a natural order. 中文初译: 数据类型的标准非常漂亮。 对于所有其他的数据类型, 包括数字和字符串数据类型之外的数据类型, 不存在唯一的平等或不平等的可用数据, 因为其他数据类型可能没有自然顺序 。 00:26:27.740 EN: And you should also be careful that you compare only compatible types. For example, strings and integers cannot be compared by default. 中文初译: 您也应该小心, 您只能比较兼容的类型。 例如, 字符串和整数无法默认地比较 。 00:26:39.760 EN: So then you have to, if you want to do that, you have to first cast the string to an integer value or the integer to a string, and then you could also do that. 中文初译: 所以,然后你必须,如果你想这样做的话, 你必须首先把字符串投到整数值或整数到整数, 然后也可以这样做。 00:26:48.640 EN: But without casting, the types would be incompatible. Then there are also arithmetic operators. So the typical ones, plus, minus, multiplication, division. 中文初译: 但如果没有铸造,这些类型将是不兼容的。然后还有算术操作员。所以典型的,加上,减去,乘法,除法。 00:27:02.080 EN: So these support also numeric data types, and we can do some calculation in Sparkly queries. So here you see a filter clause on the button where we calculate the body mass index. 中文初译: 因此这些支持数字数据类型, 我们可以在 Sparkly 查询中做一些计算。 所以这里您可以看到一个过滤条款, 在用来计算身体质量指数的按钮上 。 00:27:16.540 EN: So we use the weight of a person, for example, and then we divide the weight by the square product of the height. 中文初译: 因此,我们使用一个人的体重,比如说, 然后我们把重量除以平方的高度产物。 00:27:29.120 EN: Yeah, kruse is the height. And then we compare if it's larger than 24, 25. So these are people who are overweight and have a body mass index equal or higher than 25. 中文初译: 是的,Kruse是高度。然后我们比较它是否大于24,25 所以这些人超重 体重指数等于或高于25 00:27:44.280 EN: So you can do such calculations in filter clauses as well. Then Sparkly supports some RDF-specific filter functions. 中文初译: 这样您也可以在过滤条款中做这样的计算。 然后, Sparkly 支持某些“ RDF” 特定的过滤功能 。 00:27:54.940 EN: So one function, for example, is a bound, which checks whether a certain variable is bound in a result, yeah? So a Sparkly query returns a number of result sets, and with optionals, we basically can have unbound results. 中文初译: 比如说,一个函数是约束性的, 它检查某个变量是否被约束于结果中, 是么? 因此, 一个闪烁质询返回了多个结果组, 并且有选择性, 我们基本上可以有无限的结果。 00:28:12.540 EN: Once you have optional, when you don't have optional, it will return only fully bound result sets. So all variables are bound either to a resource or to a literal or to a blank node. 中文初译: 一旦您有可选, 当您没有可选时, 它只返回完全绑定的结果组。 所以所有变量都与资源或文字或空白节点相关 。 00:28:27.740 EN: Once you have optionals, it might be that certain variables are not bound. Those from the optional part can be unbound, and then you could, in the filter, still check if they are bound or not. 中文初译: 一旦您有可选选项, 某些变量可能不受约束。 那些来自可选部分的变量可以不受约束, 然后您可以在过滤器中检查它们是否受约束 。 00:28:40.600 EN: With this bound function, you can basically evaluate. So this function will return true if a is bound in a certain result. 中文初译: 使用此绑定函数, 您可以基本上评估。 因此如果某个函数被绑定在一定结果中, 此函数将返回真实状态 。 00:28:50.680 EN: It will return false if it's not bound, yeah? Similarly, we can check whether something is a URI, is URI, and then the variable, and that returns true if a is bound, the variable a is bound to URI. False if it's not bound to a URI. 中文初译: 如果它没有被约束的话, 它会返回假的。 类似地, 我们可以检查某物是否是“ URI ” , 是“ URI ” , 然后是变量, 而如果是一个被约束的话, 该变量将返回真实。 如果它不是被“ URI ” 约束的话, 变量a 将归为“ URI ” 。 00:29:13.660 EN: And we can check whether something is a blank node. So is blank is the function here, and that returns true if a is a blank node, yeah? Same with literals. 中文初译: 我们可以检查某事是否为空白节点。 此处的函数是空的, 如果是一个空白节点, 则返回为真实, 是么? 与字面意思相同 。 00:29:26.720 EN: We can check if something is a literal but the function is literal. That returns true if a is an RDF literal. We can also convert a resource or a literal to a string, and that's done with the function str, string, and that basically returns a string representation. 中文初译: 我们可以检查某物是字面的, 但函数是字面的。 如果某物是“ RDF” 字面的, 则返回真实 。 我们还可以将资源或文字转换为字符串, 而这样就可以使用函数字符串、 字符串, 并且基本上返回字符串表示法 。 00:29:52.380 EN: So, and that works for literals. So if you have a number, 49, for example, it will return a string containing the 49. 中文初译: 所以,这对字面来说是有效的。所以如果你有49个数字,比如49个, 它会返回包含49个字符串的字符串。 00:30:01.040 EN: You can also apply that URIs. It will basically return a string of the URI, yeah? With HTTP colon double slash and so on and so forth. 中文初译: 您也可以应用“ URIs ” 。 它基本上会返回一个“ URI ” 的字符串, 是么 ? HTTP 结肠双切等等 。 00:30:12.240 EN: So that's basically what I meant with casting. So you can cast literals or resources to strings, and then you could, for example, apply an alphanumeric ordering. 中文初译: 基本上这就是我对铸造的意思。所以你可以用字面或资源来字符串, 然后,比如说,可以应用字母数字顺序。 00:30:25.280 EN: Similarly, we can get the language tag. Also, the string returns a string value. If you have, for example, a string, then it will return only the string value because a string literal can also contain the data type. 中文初译: 同样,我们也可以获得语言标记。此外,字符串还返回字符串值。例如,如果有字符串,则只返回字符串值,因为字符串字典也可以包含数据类型。 00:30:40.740 EN: It also can contain a language tag. If you want to omit that, and if you just want to compare strings independently of whether there is a language tag or whether there is an additional data type, you can apply this casting to a plain string, yeah? 中文初译: 它也可以包含一个语言标记。 如果您想要省略, 如果您只想比较字符串, 而不考虑是否存在语言标记或者是否有额外的数据类型, 您可以将此刻录应用到平坦的字符串中, 是么 ? 00:30:59.140 EN: For string literals, we can also get the language tag. That's done with the function lang here. It basically returns us this two or four letter code of the language string. 中文初译: 对于字符串字典, 我们也可以获得语言标记。 功能朗语就完成了 。 它基本上返回了语言字符串的两到四个字母代码 。 00:31:14.220 EN: So we can compare, for example, or we can filter for labels or descriptions where the language is in German, in English, or in Russian using this function here. 中文初译: 例如,我们可以比较,或者我们也可以过滤用德语、英语或俄语使用此函数的标签或描述。 00:31:27.020 EN: And another function is data type, which is here on the button. So basically data type returns the data type of a literal, and that's a URI. 中文初译: 另一个函数是数据类型, 即此按钮上的数据类型。 所以基本上数据类型返回一个字面的数据类型, 那就是“ URI ” 。 00:31:38.520 EN: So you can then retrieve the data type without the language tag. So it will return also string for untyped literals because untyped literals are, by default, strings. 中文初译: 这样您就可以在不使用语言标记的情况下检索数据类型。 因此它也会返回未打字的字符串, 因为未打字的字符串默认是字符串 。 00:31:56.100 EN: Yeah, implicitly, they are strings. That's why for untyped literals, this will also return then X is the string. 中文初译: 是的,隐含地说,它们是字符串。这就是为什么对于不打字的文字来说,它也会返回,然后X就是字符串。 00:32:05.180 EN: What else is there? There is the function same term, A and B. So this returns true if A and B are the same RDF terms. 中文初译: 还有什么? 函数是相同的, A和 B。 所以如果 A 和 B 是相同的“ RDF” 术语, 则返回为真实 。 00:32:20.860 EN: What are same RDF terms? So it basically, in URI, sometimes you have different capitalization, and that checks whether the URIs basically are the same. 中文初译: 同样的“RDF”术语是什么?基本上,在“URI”中,有时你具有不同的资本化, 检查“URI”是否基本相同。 00:32:32.400 EN: Maybe the strings might be different because you have a different capitalization. The capitalization in URIs, it's a bit difficult. 中文初译: 也许字符串可能不同,因为你有一个不同的资本化。“URIs”中的资本化有点困难。 00:32:42.200 EN: For example, in the domain name part of the URI, it doesn't matter. In the path part, in the last part, the capitalization actually matters. 中文初译: 例如,在“ URI” 的域名部分, 它并不重要。 在路径部分, 最后一部分, 资本化实际上很重要 。 00:32:52.740 EN: So that's why if you write amazon.com with capital A, then amazon.com with capital A and amazon.com with small cap A are referring to the same URLs basically. 中文初译: 所以这就是为什么如果你用首都A 来写Amazon.com, 然后用首都A和小帽A的amazon.com 基本上是指相同的URL。 00:33:15.470 EN: And that is something we just checked with the same term function, whether they resolve to the same canonical URIs. 中文初译: 这是我们刚刚用同一个术语功能检查的, 是否他们决心使用同一个“URIs”的语句。 00:33:25.320 EN: Then we have also lang matches. So that checks whether A and B have the same language tags. So if you, for example, if they have the same, if they are both in German or in English or in Chinese, that's a lang matches. 中文初译: 然后我们还有朗语匹配。 这样可以检查 A 和 B 是否具有相同的语言标签。 比如, 如果您有相同语言标签, 如果是德文或英文或中文的, 那是朗语匹配。 00:33:45.080 EN: And then there's also the possibility to do a regular expression matching. So it's reg X, A, B checks whether in A the regular expression B can be found. 中文初译: 还可以进行正则表达式匹配。 所以它是 reg X, A, B 检查是否在 A 中找到正则表达式 B 。 00:33:59.440 EN: So we have an example here on the button. So we have a book, book has a review and then a review text. And then we filter and we do a lang match on the language of text with DE. 中文初译: 因此,我们在按钮上有一个例子。所以我们有一本书, 书有一个审查, 然后一个审查文本。然后我们过滤, 我们用 DE 对文本的语言做一个朗比。 00:34:19.760 EN: So basically we check for literals which have the language text DE. So we can also combine filter conditions with Boolean operators. 中文初译: 基本上,我们检查了含有语言文字 DE 的字面文字。 所以我们也可以将过滤条件与布林操作员结合起来。 00:34:30.840 EN: And for that, we can use the double ampersand sign for an end combination, the double pipe sign for an OR combination or the exclamation mark for negation. 中文初译: 为此,我们可以使用双倍增 Perpersand 签名作为最终组合, OR 组合的双管号或否定的感叹标记。 00:34:50.860 EN: So this exclamation mark indicates a negation of a Boolean, of a condition basically. So these were the basic, the basics of SparkQL. 中文初译: 所以这个感叹标记 表明对布尔恩的否定, 基本上是一个条件。所以这些是SparkQL的基本基础。 00:35:07.480 EN: And now there are, how are the results returned? So we can use, there are different result formats. We can use select to return us SparkL results. And with select, we can basically give either a list of variables or the star assigned. 中文初译: 现在有了, 结果是如何返回的? 所以我们可以使用不同的结果格式。 我们可以使用选择来返回 SparkL 结果。 并且通过选择, 我们基本上可以给出一个变量列表或者指定恒星 。 00:35:31.000 EN: Star stands for all variables. So if you give a list, it will return us only those variables which appear in the list. 中文初译: 恒星代表所有变量。 所以, 如果您给出列表, 它只返回列表中显示的变量 。 00:35:41.100 EN: So if we use the star, it returns us all variables from our query. So, and the result format of select is always a table. 中文初译: 所以如果我们使用恒星, 它会从查询中返回所有变量。 因此, 选择的结果格式总是一个表格 。 00:35:52.560 EN: Now, and that's a bit interesting to keep in mind. We query RDF graph, a data set, and that's a graph, a set of triples, but as a result, we get a table. 中文初译: 现在,这有点有趣 值得记住。我们查询“RDF”图表,一个数据集, 这是一个图表,一组三重组合, 但是结果,我们得到了一张表格。 00:36:04.980 EN: So in that way, SparkQL is very similar to like a relational database query language. Of course, it queries an RDF graph, but it presents a table as a result. 中文初译: 这样, SparkQL 与关联数据库查询语言非常相似。 当然, 它会查询一个“ RDF” 图, 但它会因此提供一个表格 。 00:36:18.900 EN: And that's quite useful because often you want to use actually SparkQL then in a software, in your source code, in your development platform, software development project. 中文初译: 这是非常有用的,因为你经常想在软件中, 在源代码中, 在开发平台,软件开发项目中使用SparkQL。 00:36:35.960 EN: And when you have such select queries, you basically can use a triple store similarly, or almost in the same way as a relational database. 中文初译: 当您有这样的选择查询时, 您基本上可以使用类似的三重商店, 或几乎和关系数据库一样。 00:36:45.880 EN: Now, of course you query the data a bit different, the data structure different, but the results are returned as a table. 中文初译: 现在,当然了,你查询数据时会略为不同, 数据结构则不同, 但结果会以表格形式返回。 00:36:52.720 EN: And then you can just iterate through the table and for example, show them in the user interface as a table or show individual entries. 中文初译: 然后你就可以通过表格进行循环,比如,在用户界面中以表格的形式显示它们或者显示单个条目。 00:37:01.780 EN: So it makes the processing of the results programmatically easy that you have these kind of select queries, which return tables. 中文初译: 因此,它使得处理结果在方案上变得容易:你有这些选择的查询,这些返回表格。 00:37:12.240 EN: The problem with that is that the structure of RDF is lost in the result. So you don't know anymore what was the original structure there. 中文初译: 问题在于“RDF”的结构在结果中丢失了。所以你不知道那里原来的结构是什么了。 00:37:25.960 EN: And that's why there are some other query types. There are not only select queries, but there are also, for example, construct queries. So instead of select, you can also use construct. 中文初译: 这就是为什么还有其他的查询类型。 不仅有选择的查询, 而且也有构建查询等。 因此, 而不是选择, 您也可以使用构建 。 00:37:37.120 EN: So here you see an example of that. And construct allows you to construct an RDF result so that you don't get a table, but you get RDF as a result. 中文初译: 所以在这里,你可以看到一个例子。 构造可以让你构建一个“ RDF” 结果 这样你就得不到一张桌子, 但是会因此得到“ RDF ” 。 00:37:51.040 EN: How is that done? We see here a triple pattern or a graph pattern after the construct. So that's the template, how we want to have the results returned. 中文初译: 如何完成 ? 我们在此看到构建后的三重图案或图形图案。 这就是模板, 我们要怎样返回结果 。 00:38:02.060 EN: Here in that case, we want to have a person, mailbox, email, and then person, telephone, telephone. And afterwards we have the same where clause, the same as in the select query. 中文初译: 在此情况下, 我们想要有一个人、 邮箱、 电子邮件, 然后是个人、 电话、 电话。 之后我们也有相同的条款, 和选中的查询一样 。 00:38:16.080 EN: And here we have person, email, email, and person, tell, telephone. So we basically get results from a triple store which match to this triple graph pattern here, but we don't return them in exactly that shape, but we actually change the properties. 中文初译: 我们这里有个人,电子邮件,邮件, 和人,告诉,电话。所以我们基本上从一个三重商店里得到结果, 这与这里的三重图形模式相匹配, 但我们不完全按这个形状归还它们, 但我们实际上改变了属性。 00:38:36.680 EN: So the property email is here exchanged into mailbox and the property tell is changed into telephone. So, and that allows you to integrate data because sometimes you get data, you have data in different, according to different vocabularies. 中文初译: 属性电子邮件在此交换为邮箱, 属性告知被转换为电话。 因此, 这样您就可以整合数据, 因为有时你得到数据, 根据不同的词汇, 你的数据是不同的。 00:38:55.400 EN: If you retrieve data from different sources, they might use different vocabularies. Using such construct queries, you can match them to the same target vocabulary. 中文初译: 如果您从不同来源检索数据, 他们可能会使用不同的词汇。 使用这种构建查询, 您可以将这些数据匹配到相同的目标词汇表 。 00:39:07.960 EN: Here in that case, using the properties mailbox and telephone. And also an advantage is that you get triples as a result. 中文初译: 在此情况下,使用财产信箱和电话。还有一个好处是,你因此获得三倍的收益。 00:39:16.340 EN: Basically for every match, which we find in the knowledge base, a small graph is constructed or graph snippets, which exactly looks like this graph pattern here. 中文初译: 基本上每一个匹配, 我们从知识库中找到的, 一个小图或图形片段, 都构造成一个小图或图形片段, 这里的图表模式看起来就是这个图案。 00:39:31.540 EN: And that's then iteratively generated. So we generate iteratively several or many of these snippets and we can build basically a new graph from an existing graph. 中文初译: 然后是迭接生成的。所以我们反复生成了数个或者很多个这些片段, 我们可以从一个现有的图表中 构建一个新的图形。 00:39:47.720 EN: It makes, of course, the sequential processing of the results a bit more difficult. If you want to, for example, so this is for certain purposes useful for data integration purposes, but maybe not so much when you want to show something in a user interface. 中文初译: 当然,它会让结果的顺序处理更加困难。例如,如果您想要,这对数据整合的某些目的有用,但当您想在用户界面中显示某种东西时可能不会太多。 00:40:05.940 EN: If you want to show something on the user interface, the tabular result format is usually better. So, and then there are two more result formats, ask and describe. 中文初译: 如果您想要在用户界面上显示一些东西, 表格结果格式通常更好。 所以, 然后又有两个结果格式, 询问和描述 。 00:40:18.380 EN: Ask is checking whether there are results and it checks only if there are results. It only returns a boolean value, so either true or false. 中文初译: 询问是检查是否有结果, 只有在有结果时才检查。 它只返回布林值, 所以是真实的还是假的 。 00:40:29.580 EN: So true, if there is any results, also the sparkle endpoint basically can stop operating. Once he finds the first result, he basically stops and returns true. 中文初译: 所以,真的,如果有任何结果的话, 闪亮的终点基本上可以停止运行。一旦他找到了第一个结果, 他基本上就停止了并恢复了真实性。 00:40:40.880 EN: That's ask, what ask does. Sometimes you only want to know is there something or is there nothing? And that you can do with ask. And the fourth query type is describe, which basically retrieves for every URI an RDF description. 中文初译: 这是问什么问题。 有时你只想知道有什么东西或者什么都没有? 你可以问。第四个查询类型是描述, 基本上每个“ URI” 的描述都有“ RDF ” 。 00:40:59.820 EN: And that means it returns for every URI, which has found the set of all subjects, predicates and objects where the subject matches to this URI. 中文初译: 这意味着它返回每一个“URI”, 它已经找到了所有主体、 谓词和物体的集合, 主题与这个“URI”吻合。 00:41:10.440 EN: So it returns resource descriptions. So these are the four query types, select for getting tables, construct for getting new graphs, ask for getting true or false and describe for getting sets of resource descriptions for each found URI. 中文初译: 所以它返回资源描述。 因此这些是四种查询类型, 选择用于获取表格, 构建用于获取新图形, 要求获取真实或错误, 并描述每个被找到的“ URI” 都获取成套的资源描述 。 00:41:34.600 EN: And then the last feature or the last important feature of sparkle, how can we modify the result sets if we want to get only parts of the result sets, how can we sort and order them? 中文初译: 然后是最后的特征,或者闪光的最后一个重要特征, 如果我们想要只得到结果组的一部分, 我们怎样才能修改结果组, 如何排序和排列它们呢? 00:41:51.880 EN: And that's done with modifiers, a solution sequence modifiers. So far, if we would issue a query, it would, of course, not for ask, that would return just Boolean, but for all other query types, it would return us as many as are found in the triple store. 中文初译: 这是用修饰剂做的, 一种解析序列修饰剂。到目前为止, 如果我们发出一个查询, 当然,它不会因为要求, 那只会返回布林恩, 但是对于所有其他的查询类型, 它会给我们带来在三重商店里找到的尽可能多的回馈。 00:42:10.620 EN: Sometimes triple stores might contain millions or even billions of triples. So this would be extremely large. And then it's very useful if you can filter or sort and also reduce the number of results. 中文初译: 有时候,三家商店可能包含上百万甚至数十亿个三倍。所以这将会是巨大的。如果你能过滤或排序并且减少结果的数量,那将非常有用。 00:42:26.540 EN: Sorting is done with the order by keyword, and that's exactly the same as an SQL. In SQL, we have also the possibility to use order by. 中文初译: 按关键字对顺序进行排序, 这与“ SQL” 完全相同。 在“ SQL” 中, 我们也可以使用顺序 。 00:42:36.520 EN: So here we have an example, we select books and prices where book has a price, that's our triple pattern here, and then we order by the price. 中文初译: 我们这里有一个例子,我们选择书籍有价的书本和价格, 这就是我们的三重模式, 然后我们按价格订货。 00:42:51.000 EN: The sequence is that if you have URIs, for example, here in that case, we assume that the price would be a numeric value, but in case we order, we can order by arbitrary URIs, you could also order by book, for example, that would be also possible. 中文初译: 顺序是,如果你有“URIs”,比如说,在这种情况下, 我们假设价格是一个数字值, 但如果我们订购的话, 我们可以通过任意的“URIs”来订购, 比如说,也可以用书籍来订购。 00:43:08.960 EN: In that case, the URIs would taken as alphanumeric strings, and they would be sorted alphanumerically. And then also sometimes variables can have either literals or blank nodes or URIs, and then the order is as follows. 中文初译: 在这种情况下, “ URIs” 将被视为字母数字符串, 并将按字母数排序。 然后有时变量也可以有文字或空白节点或“ URIs ” , 然后顺序如下 。 00:43:32.020 EN: So first are unbound variables, so variables which are not bound in case you have optional, for example. Next, it would return blank nodes, then it would return URIs, and finally, the literals. And of course, inside, especially in the URIs and the literals, it would sort, yeah. 中文初译: 首先是不受约束的变量,所以没有约束的变量 以防您有可选的节点。接下来,它会返回空白的节点, 然后返回“URIs ” , 最后是字面文字。当然,在内部,特别是在“URI”和字面中, 它会排序,是的。 00:43:54.080 EN: And then we can, yeah. I have question, I have question. Order by price, it will order them like from the highest price or from the lowest price? 中文初译: 然后我们就可以,是的。我有一个问题,我有疑问。按价格顺序排列, 它会像从最高价格或最低价格排序它们? 00:44:06.260 EN: Yeah, it's written down here. It would order in ascending order, yeah. So from the lowest to the highest, that is the default here, yeah. 中文初译: 对,这里写着,按升序顺序排列,从最低到最高 00:44:19.200 EN: If we want in descending order, if we want to have the most expensive books first, we could use the keyword descending, yeah. 中文初译: 如果我们想要按降序排列, 如果我们想先有最贵的书, 我们可以使用关键词下降,是的。 00:44:28.980 EN: So with descending and ascending, you can indicate what kind of order you want to have, ascending or descending, yeah. 中文初译: 所以随着降级和升迁,你可以指出 你想有什么样的秩序, 升或降,是的。 00:44:36.920 EN: If you omit it, then it will order in ascending order, from the lowest to the highest. Thank you. And you can also add several order criteria, so that we see here in the third example. 中文初译: 如果您省略了它, 那么它将按升序顺序排列, 从最低到最高。 谢谢您。 您也可以添加几个顺序标准, 这样我们就可以在第三个例子中看到这里 。 00:44:52.020 EN: So we can order first by price in descending order, and let's assume we have, for example, lots of books which cost 20 euro or 10 euro, and then we could, as a second criteria, order by the title of the book. 中文初译: 所以我们可以按降价顺序先订价格, 让我们假设我们有很多书籍, 比如,花费20欧元或10欧元的书, 然后作为第二个标准, 我们可以按照书名排序。 00:45:07.100 EN: So then all the 20 euro books would be in addition, then ordered by the title afterwards. Yeah, it's the same as in SQL, yeah. 中文初译: 所以所有20欧元的书都会加起来, 然后按标题排序。是的,它和“SQL”一样,是的。 00:45:17.340 EN: And then we have the possibility to use limit, offset, and distinct to reduce the results. So with limit, we can give a maximum number of results which we are interested in. 中文初译: 然后我们就可以使用限制、抵消和区分来减少结果。因此,只要有限制,我们就能够提供我们感兴趣的最大数量的结果。 00:45:33.780 EN: So the number of table rows, basically, which should be returned. So if you add limit 10, it will return only 10 results. 中文初译: 因此表格行的数量, 基本上应该返回。 所以如果添加限制 10, 它只返回 10 结果 。 00:45:45.780 EN: If you add limit 100, it will return 100 results. With offset, you can indicate you only want to have results after a certain position. 中文初译: 如果您添加了限制 100, 则返回100 结果。 顶点后, 您可以表示您只想要在某个位置后取得结果 。 00:45:58.220 EN: It starts only, for example, you have offset 10, then it starts with the 11th result. Yeah, so that's what you use, what you need for pagination. 中文初译: 它只开始,比如说,你已经抵消了10, 然后它从第11个结果开始。是的,所以这就是你使用的东西, 需要什么来排成平面。 00:46:10.180 EN: Usually on the user interface, if you have lots of results, it shows you the first 10, and then on the second page, the next 10, and on the third page, the next 10. 中文初译: 通常在用户界面上,如果结果很多, 它会显示前10个, 然后在第二页, 接下来10个, 第三页, 接下来10个。 00:46:19.840 EN: So this can be done with limit and offset. So here we have an example. We select book and prices where book has a certain price. 中文初译: 因此,这可以用限制和抵消来完成。所以我们这里有一个例子。我们选择书籍有一定价格的书本和价格。 00:46:30.260 EN: We order by price, we limit to five results, and we offset to 25. So that would basically return us results 26 till 30. 中文初译: 我们按价格排序,我们限制为5个结果,我们抵消25个结果,这样基本上可以把我们的结果26恢复到30。 00:46:42.120 EN: Yeah, after it starts, after the offset, after 25. So it would return us five results, starting from 26 here in that case. 中文初译: 是啊,开始后, 抵消后,25后, 所以它会回馈我们五个结果, 从这里26开始 在那个情况下。 00:46:53.140 EN: And another important feature is we want to remove double results, because it sometimes can be that we have several results. 中文初译: 另一个重要特征是,我们想要消除双重结果,因为有时我们可以有几种结果。 00:47:10.080 EN: For example, you remember the authors, yeah? When we have several authors, we might get the same book several times, or we have the book listed several times. 中文初译: 比如,你还记得作者吗?当我们有几个作者的时候, 我们可能会得到同一本书好几次, 或者我们把这本书列了好几次。 00:47:22.400 EN: Then we can use distinct, and it basically removes duplicate result sets. This is because, yeah, once you select certain properties, it might be, even if the resources are maybe different, the results, some results might still be, the result set might still be the same. 中文初译: 然后我们就可以使用不同的, 它基本上可以删除重复的结果组。 这是因为, 是的, 一旦您选择了某些属性, 它可能是, 即使资源可能不同, 结果, 一些结果可能仍然一样, 结果组可能还是一样 。 00:47:48.520 EN: So that's why distinct, if you prefix the select, the selection of the variables with the keyword distinct, it removes these double entries in the result set. 中文初译: 所以这就是为什么区别, 如果您在选择前加上前缀, 选择带有关键字的变量, 它会删除结果集中的这些双重条目。 00:48:01.680 EN: So how are the modifiers combined? So first, it's sorted with order by. Then it removes not selected variables. 中文初译: 修饰剂是如何结合的? 因此首先, 它按顺序排序。 然后它删除了未选中的变量 。 00:48:16.020 EN: Then it removes double results. And that's, why is that important, this sequence? If you would remove double results before you remove the non-selected variables, then there might be no double results. Maybe the double results only appear after you remove certain columns in your result set, yeah? 中文初译: 然后它会删除双重结果。这就是为什么重要, 这个序列? 如果您在移除非选中变量之前要删除双结果, 那么可能就不会有双结果。 也许双结果只在您删除结果集中的某些列之后才会出现, 是么 ? 00:48:40.060 EN: That's why it's important to note that the double results are, but this is basically what you expect from executing a query, yeah? 中文初译: 这就是为什么必须注意到 双重结果是, 但基本上这就是你对执行询问的期望,是吗? 00:48:49.100 EN: Then it removes the first results, if you have an offset defined, and then it removes the last results if you have limit defined, yeah? 中文初译: 然后它删除了第一个结果, 如果你定义了一个抵消, 然后它删除了最后一个结果, 如果你定义了限制, 是吗? 00:49:03.860 EN: Basically everything after the limit. And that means that you can also sort by not selected variables, yeah? So because sorting is done first, you can basically sort by a variable which you not even return in your result set, yeah? 中文初译: 限制之后的每件事。 这意味着您也可以通过非选中变量进行排序, 是吗? 所以因为排序首先完成, 您基本上可以按照一个变量进行排序, 而这个变量甚至没有返回到结果组中, 是的 ? 00:49:22.340 EN: And that's sometimes also good to do. For example, you can sort by the price, but maybe in the end, you don't even return the price in the result set. 中文初译: 这有时也是件好事。例如,你可以按价格来排序, 但也许最终,你甚至不会把价格还给结果组。 00:49:36.280 EN: Sometimes it makes sense. Mostly not. Mostly you sort by something which you also select and want to see in the result set, but it's possible. 中文初译: 有时它有道理,但大多不合理。大多数情况下,你也会通过选择和想要在结果集中看到的东西来排序,但这是可能的。 00:49:46.930 EN: And ORDER BY works not only for SELECT queries, but also for CONSTRUCT and for DESCRIBE queries. For ASK, of course, it doesn't matter because ASK doesn't matter what is found. 中文初译: 当然,对于ASK来说,这并不重要,因为ASK并不影响发现什么。 00:50:03.080 EN: It just checks whether something is found. So they are ORDER BY. It doesn't make a difference, but for CONSTRUCT and for DESCRIBE, it will then return the constructed graphs in the order how the results are found. 中文初译: 它只是检查是否找到某物。 所以它们是按顺序排列的。它没有改变, 但是对于CONSTUCT和DESCRIBE来说, 它会按照如何找到结果的顺序返回构造图。 00:50:21.100 EN: And similarly, also for DESCRIBE, it will return the resource descriptions then in the order how the resources are returned in the result set. 中文初译: 同样,对于DESCRIBE来说,它也将按照资源在结果组合中如何返回的顺序,归还资源说明。 00:50:38.560 EN: So overview of SparkQL. So we have a prefix and WHERE as basic structure. We have these four different result sets, SELECT, CONSTRUCT, ASK, and DESCRIBE. We have different graph patterns. 中文初译: 因此,我们有一个前缀和基本结构。我们有四个不同的结果组:SELECT、CONSTUCT、ASK和DEDCRIBE。我们有不同的图表模式。 00:50:54.900 EN: So simple graph patterns, which are just lists of triple patterns. Then we can group them with the curly brackets. 中文初译: 简单图形模式, 它们只是三重模式的列表。 然后我们可以用圆括号把它们组合起来 。 00:51:02.760 EN: Arbitrary grouping is possible. We can use optional and we can use union. So these are the different constructors for graph patterns. 中文初译: 任意分组是可能的。我们可以使用可选的,也可以使用结合。所以这些是图案模式的不同构造器。 00:51:13.700 EN: Then we have the filter conditions here where we have a number of variables. And of course, also the comparisons like equal, unequal, larger, smaller than, and so on. 中文初译: 然后我们在这里有了过滤条件, 我们有一些变量。 当然, 比较也像平等,不平等,大,小等等。 00:51:26.040 EN: And we have the modifiers for ordering, for limit, for offset, and for distinct. So this was basically the basics of SparkQL. 中文初译: 我们有修饰者可以命令, 限制, 抵消, 和区别。所以这基本上是SparkQL的基本原理。 00:51:38.700 EN: And yeah, maybe let's look a bit how they are evaluated such basic graph patterns. Actually, I wanted to show you some example of SparkQL. 中文初译: 是的,也许让我们来看看如何评价它们 基本图形模式。实际上,我想给你们展示一些SparkQL的例子 00:51:52.060 EN: But unfortunately, the triple, the DBpedia endpoint is down. So let me see if it's maybe up again now. I don't know, it seems to be working. 中文初译: 但不幸的是,三重点DBpedia终点已经下降。所以让我看看它是否再次上升。我不知道,它似乎起作用了。 00:52:04.040 EN: So then we can actually do some experiments. SparkQL endpoint, let's see if that works. Yeah, it works. So I have to switch back to my, share my screen. 中文初译: 这样我们就可以做一些实验。SparkQL终点,让我们看看它是否有效。是的,它有效。所以我必须回到我的屏幕上,分享我的屏幕。 00:52:17.960 EN: So if you go to DBpedia, here's DBpedia. Yeah, for example, we can open the page Hanover here. And we can see then all the triples for the resource Hanover. 中文初译: 所以如果你去DBpedia,这里就是DBpedia。比如说,我们可以在这里打开Hanover的网页。然后我们可以看到资源Hanover的所有三倍。 00:52:31.600 EN: We have the properties and the values. And what you see here is also then the SparkQL endpoint on the upper right corner of the window. And if you click on SparkQL point, you will get a SparkQL query editor where you can write SparkQL queries. 中文初译: 我们拥有属性和值。 您在这里看到的也是窗口右上角的 SparkQL 端点。 如果您点击 SparkQL 点, 您将会得到一个 SparkQL 查询编辑器, 在那里您可以写入 SparkQL 查询 。 00:52:54.360 EN: And it shows us a default query here in that case. Select, let me make this a bit larger. So, and reduce the size a bit. 中文初译: 它向我们展示了一个默认的查询。 选择, 让我把这个放大一点。 所以, 然后缩小一些大小 。 00:53:07.440 EN: So first we indicate what graph we want to query because the SparkQL endpoint can host several graphs. It's a bit similar to relational databases. 中文初译: 所以首先我们要指出要查询的图形, 因为 SparkQL 端点可以存放数个图表。 它与关联数据库有点相似 。 00:53:21.560 EN: And a relational database can have certain, sometimes it's called table spaces or in MySQL it's called databases. 中文初译: 关系数据库可以确定 有时叫做桌位空间 或者在 MySQL 里叫数据库 00:53:30.900 EN: You can in one relational database create several, either table spaces or databases. Oracle, for example, causes a table space. MySQL causes a database. 中文初译: 您可以在一个关联数据库中创建多个数据库, 要么是表格空间, 要么是数据库。 Oracle 例如, 产生一个表格空间。 MySQL 导致一个数据库 。 00:53:44.440 EN: So in one database management system, you can have several databases. And the same works for triple stores. A triple store can host several graphs, not just one graph. 中文初译: 所以在一个数据库管理系统中,你可以拥有几个数据库。对于三家商店来说也是一样。三家商店可以容纳数个图表,而不仅仅是一个图表。 00:53:57.800 EN: So you can identify which one you want to query. Here in that case, dbpdf.org. If the triple store contains several graphs, we can indicate another IRI, URI for the graph here. 中文初译: 所以您可以指定要查询哪个。 在此, dbpdf. org 。 如果三家商店包含多个图表, 我们可以为此图形指定另一个“ IRI ” 、 “ URI ” 。 00:54:12.080 EN: And then we can add the query below. So in here we have the query. We select distinct and then a variable concept. 中文初译: 然后我们可以添加下面的查询。 因此在这里我们有了查询。 我们选择了不同的, 然后一个变量概念 。 00:54:23.460 EN: And then we have a where clause. And here we have the square brackets. That means something. So this doesn't have a variable name. 中文初译: 然后我们有一个条款。在这里我们有方括号。这意味着什么。所以这个没有变量的名称。 00:54:35.540 EN: A is a shortcut for RDF type. And then we have concept. So maybe let's format that a bit nicer. And then curly brackets end. And then we have limit 100. 中文初译: A 是“ RDF” 类型的快捷键。 然后我们有了概念。 所以也许让我们格式化得更好一点, 然后卷轴括号结尾。 然后我们限制100。 00:54:49.440 EN: So we want to get 100 results. Also, our endpoint here allows us to get the results in different formats. So we can get it as HTML here in that case. 中文初译: 所以我们想要得到100个结果。此外,我们的终点让我们可以以不同格式获得结果。这样我们就可以用 HTML 来获取结果。 00:54:59.640 EN: But of course, if you would do this from your software implementation, you could get it as XML. Here's, for example, the XML result set. 中文初译: 当然,如果你从软件的安装中做这个, 你可以把它当作XML。例如,“XML”结果集。 00:55:11.200 EN: Or you can get it also as JSON. So there are lots of different, as a spreadsheet, lots of different possibilities, CSV to get results. 中文初译: 或者你也可以得到它作为JSON。所以有很多不同的,作为一个电子表格, 很多不同的可能性, CSV来获得结果。 00:55:21.660 EN: And then we can get, we can execute the query. So let's do that. And then basically it returns us a table and all the concepts which are found here in this, in DBpedia. 中文初译: 然后我们可以得到,我们就可以执行查询。所以让我们这样做。然后基本上它会给我们一个表格 和所有在DBpedia这里发现的概念。 00:55:37.220 EN: So that's maybe not so interesting in that case. Let's maybe look for something else. So let's assume we want to have cities in lower Saxony. 中文初译: 那样的话也许没那么有趣。让我们来找点别的东西。让我们假设我们想要在下萨克森有城市。 00:55:52.300 EN: So we can basically explore the graph here. So what do we do? How can we find out what is a city? So we basically need RDF type here somewhere. 中文初译: 所以我们基本上可以在这里探索图表。 那么我们该怎么办? 我们怎样才能发现城市是什么? 因此我们基本上需要“RDF”类型。 00:56:11.260 EN: Can also search type, entity of type city. So we can copy us this resource A and then instead of we add here city. 中文初译: 也可以搜索类型, 城市类型实体。 所以我们可以复制这个 A 资源, 而不是添加到这里 。 00:56:27.200 EN: So let's see if that works. So this should basically, it's a very simple query, maybe instead of the, we write here city. 中文初译: 所以让我们看看这是否有效。所以基本上, 这应该是一个非常简单的查询, 也许而不是我们在这里写的城市。 00:56:40.300 EN: And then we also need to change the variable city. And to make it better readable, we can also write select distinct city and rare. 中文初译: 然后我们也需要改变变数城市。为了让它更易读, 我们还可以写出 特定和稀有的城市。 00:56:55.840 EN: Then it's a bit so writing the SparkQL keywords and capital letters and the variable small is maybe a good practice. 中文初译: 写SparkQL关键字和大写字母 变小或许是一种好的做法 00:57:06.160 EN: So let's see if that works. And now we execute a query. And indeed it returns us a list of cities here. So we had a limit on 100. So it returns us 100 results there. 中文初译: 让我们看看这是否有效。 现在我们执行一个查询, 并且它确实给我们提供了一份城市清单。 因此我们对100有限制, 所以它会给我们100个结果。 00:57:19.040 EN: And you can see here, we get all kinds of results. They are actually not ordered. They are just returned in the way how they are found in the triple store. 中文初译: 你可以看到这里,我们得到了各种各样的结果。它们实际上没有被订购。 它们只是按照在三重商店中 发现的方式被送回去。 00:57:34.140 EN: Now we wanted to have cities in lower Saxony. So let's see if we find a property giving us that it's in lower Saxony. 中文初译: 现在我们想要在下萨克森州有城市。让我们看看我们是否找到一个财产, 告诉我们它是在下萨克森州。 00:57:47.200 EN: I guess we should use the English word. So this property here there, but I think that's not the right one. Seat of lower Saxony. So that means it's a capital, ah, federal state. Here we have it, yeah. 中文初译: 我想我们应该用英语这个词。所以这里的地产, 但我认为这不对。 下萨克森州的座位。 这意味着这是一个首都, 啊,联邦州。我们在这里有了它,是的。 00:58:03.120 EN: So here we have the property federal state lower Saxony. What do we do? We copy us on federal state. So we basically need now a second triple pattern. 中文初译: 这里是联邦州下萨克森州的财产区。我们该怎么办?我们在联邦州复制我们。所以我们现在基本上需要第二三模式。 00:58:12.960 EN: We do a full stop and we say city. Now the property is federal state and we copy us the resource for lower Saxony and add this as the last triple pattern. Let me make this a bit. 中文初译: 我们做一个完全的停留,我们说城市。现在财产是联邦州,我们复制了下萨克森州的资源, 并添加作为最后三重模式。让我来做一点。 00:58:35.260 EN: Cannot be a bit smaller. So it fits on one line. So we have two triple patterns. First city, a city. And second is that the city belongs to the federal state lower Saxony. 中文初译: 不能小一点。 因此它符合一条线。 所以我们有两个三重模式。 第一个城市,一个城市。第二个城市属于联邦州下萨克森州。 00:58:53.600 EN: And since it's a resource, we have to add this brackets here. Yeah, resource. So let's see if that works. We go to execute query and indeed we get the cities of lower Saxony. 中文初译: 既然这是一个资源, 我们必须在此添加这个括号。 是的, 资源。 所以让我们看看它是否有效。 我们执行查询, 然后我们得到下萨克森的城市。 00:59:10.040 EN: Here in that case, there are only four of them. I don't know what's the reason for that. I guess other cities don't have this property for federal state. 中文初译: 我不知道原因是什么 我猜其他城市没有联邦州的财产 00:59:19.320 EN: Now we want to maybe get the number of inhabitants. Do we see this somewhere? Inhabitants or I think sometimes called population. Area total. 中文初译: 现在,我们也许想弄清楚居住人口的数量。我们是在什么地方看到这个的吗?居民或我有时会叫人口。地区总数。 00:59:37.220 EN: Here is population metro and then we have the number. Or maybe another possibility would be, we could also use the leader party. 中文初译: 这里是人口地铁,然后我们有了数字。或者可能还有另一种可能性,我们也可以利用领导党。 00:59:47.860 EN: Let's maybe, or we could get elevation. Maybe that's a bit similar. We take the elevation and we build, we add another triple pattern. 中文初译: 也许,或者我们可以升高。也许这有点相似。我们沿着高地走,然后建造,再增加三重模式。 00:59:59.000 EN: City. Elevation and say elevation and now we select also the elevation and we execute the query and now you can see for the cities the elevation here we have 75, 80, 55, 123. 中文初译: 城市高地和称海拔,现在我们也选择了高地,我们执行查询, 现在你可以看到城市的高度 我们这里有75,80,55,123。 01:00:17.860 EN: Yeah, Helmstedt is high up. And now we want to order so we could add order by elevation and we execute the query and now you can see that our table is ordered. Yeah, we have the 55, 75, 80, 123. If we want to order it this was now ascending. 中文初译: 是的,赫尔姆斯泰特很高。现在我们想点菜,这样我们就可以通过高空添加顺序,执行查询,现在你可以看到我们的桌子是定的。是的,我们有55,75,80,123个,如果我们想要点的话,这是上升了。 01:00:45.720 EN: If we want to order it in descending order we add descending and we execute the query and then we get it in the opposite order. 中文初译: 如果我们想按降序排列它,我们增加降序,然后执行查询,然后按相反顺序处理。 01:00:59.460 EN: So these are meters or is it? Yeah, I think it's meters. So let's say we want to have this in centimeters. What do we do? 中文初译: 那么这些是米还是米?我想是米。让我们假设我们想用厘米来计算这个。我们该怎么办呢? 01:01:10.900 EN: We multiply elevation by 100. So we execute the query and then we get basically here the result multiplied by 100. 中文初译: 我们乘以100 乘以100 所以我们执行查询 然后我们基本上在这里得到结果乘以100 01:01:21.460 EN: We see that the column name now has changed. It now has a call return one. It basically generates an arbitrary column name. 中文初译: 我们看到列名现在已经更改了。 它现在有一个回拨名。 它基本上产生一个任意的列名 。 01:01:32.620 EN: What we can do is we can rename that. We can just write as elevation in cm and then we basically renamed. Oh sorry, that doesn't work. 中文初译: 我们能做的就是重命名它。我们可以写成以立方公尺的高度,然后基本上改名。哦,对不起,这行不通。 01:01:52.400 EN: I think I need to add here the question mark as well. And then we can basically rename the column. It's the same as an SQL. 中文初译: 我认为我还需要在这里添加一个问号。 然后我们可以基本上重命名列。 它和“ SQL” 一样。 01:02:01.100 EN: Yeah, an SQL you can also use the s keyword and then rename the columns in your result set. So the same we could do with city. 中文初译: 是的,一个“ SQL” 也可以使用关键字, 然后在结果集中重命名列名。 城市也是这样。 01:02:09.580 EN: We can rename that as town for example. And we could also add a filter condition filter. Actually the filter should go inside the here. 中文初译: 我们可以重命名为镇。 我们还可以添加一个过滤条件过滤器。 实际上过滤器应该进入这里 。 01:02:24.460 EN: We need to add the full stop and then we do a filter condition and we say elevation larger than what do we say 100. 中文初译: 我们需要加上整站 然后我们做一个过滤条件 我们说海拔比100要大 01:02:41.680 EN: So we filter the results by those who are higher up than 100 and then we get only hamsted here in that case. Now since we have the further state maybe let's remove lower Saxony to make it a bit more interesting. 中文初译: 因此,我们通过那些超过100岁的人过滤结果,然后在这样的情况下我们只能在这里被浸泡。现在既然我们有了更进一步的状况,也许让我们去掉下萨克森州,让它变得更有趣。 01:02:57.660 EN: Yeah, maybe also remove this renaming here. We just get the elevation there. So let's execute this query and now we get of course a lot of towns. 中文初译: 是的,也许也删除了这个改名。我们只要把高地移到那里就可以了。让我们执行这项查询,现在我们当然会有很多城镇。 01:03:10.080 EN: If you don't remove the restricted to lower Saxony then we have here a large number of results. If you want to now get the highest ones. 中文初译: 如果您不取消限制在下萨克森州, 那么我们这里有很多结果。 如果您现在想要获得最高的结果 。 01:03:21.460 EN: We have actually ordered by elevation and descending order and 100. So that's actually the highest cities. Yeah, so and you see Habipur apparently is 7899 meters high. 中文初译: 我们实际上按海平面和降级顺序下订单100, 所以这是最高的城市。是的,所以你看Habipur显然有7899米高。 01:03:41.100 EN: Hard to believe. You of course should also be a bit skeptical. I somehow think that this is a mistake. So this is probably not in meters. 中文初译: 难以置信。 当然,你也应该有点怀疑。 我不知怎的认为这是个错误。所以这大概不是米数。 01:03:52.860 EN: So it's a census town in the district of the Indian state of Bihar. So this DBpedia information is automatically extracted from Wikipedia and that's why there might be some errors also. 中文初译: 所以它是印度比哈尔州的一个人口普查镇。所以这个DBpedia信息 自动从维基百科中提取出来, 这就是为什么还可能有些错误。 01:04:09.180 EN: Let's maybe search for Habipur and look what's written on the Wikipedia page if the error is there as well. So here on the right hand side we have this fact box and that's basically also where DBpedia extracts information from. 中文初译: 让我们也许可以搜索Habipur, 看看维基百科页面上写的内容, 如果错误也存在的话。 因此在右手边, 我们有一个事实框, 这也是 DBpedia 从那里提取信息的地方 。 01:04:29.040 EN: But here we don't even see the height of Habipur. I don't know where this value comes from. Must be some mistake. 中文初译: 但这里我们甚至看不到Habipur的高度。我不知道这个价值来自何方。一定是搞错了。 01:04:37.720 EN: Let's see if we search for elevation. Then it returns us. Yeah, actually here it says 7899 meters from Wikipedia Habipur. So there is apparently a mistake in Wikipedia. 中文初译: 让我们看看我们是否在寻找海拔。 然后它又返回了我们。 是的,实际上这里上面写着离维基百科Habipur7899米。 所以维基百科显然有错误。 01:04:56.470 EN: I don't know where. We didn't see it on the page. But even Google has tells us the wrong information here. I don't know where this information comes from. 中文初译: 我不知道在哪里。我们没有在页面上看到它。但连谷歌也告诉我们错误的信息。我不知道这些信息来自何处。 01:05:07.650 EN: We can look at edit this page if it's here in the code. Yeah, here actually elevation in meters 7899 meters. So you see that this fact is actually contained in Wikipedia and then DBpedia extracts it. 中文初译: 我们可以在代码中看到这个页面的编辑 。 是的,这里的高度是7899米。 所以你可以看到这个事实实际上包含在维基百科里 然后DBpedia提取它。 01:05:27.110 EN: And I would say that this must be a mistake because here it actually shows us the elevation. It was just just disabled for some reason. 中文初译: 我要说,这一定是个错误, 因为在这里它实际上向我们展示了高地。 它只是因为某种原因被禁用了。 01:05:40.650 EN: But that's also an interesting way how you can basically then pack check data basically using order by. Yeah, so the other I would say the other resources probably they are correct. 中文初译: 但这也是一个有趣的方法, 基本上你可以用顺序来核对数据。 是的,所以另一个我说其他资源可能是正确的。 01:05:55.370 EN: Yeah, LASA is indeed a very high city high up in Tibet. So 4200 meters. So the other ones look reasonable and we can basically get the results. 中文初译: 是的,LASA确实是一个很高的城市 在西藏高处。所以4200米。其他的看起来合理,我们基本上可以得到结果。 01:06:06.890 EN: And similarly we can also get the lowest towns. So we do ascending order. And let's see what are the lowest ones. 中文初译: 同样,我们也可以找到最底层的城镇。所以我们做上层秩序。让我们来看看最底层的城市是什么。 01:06:17.690 EN: So there are some 100 meter below zero like in Georgia, in Missouri, in Pennsylvania, in Louisiana, Tennessee, apparently a lot of US cities. 中文初译: 比如格鲁吉亚,密苏里,宾夕法尼亚, 路易斯安那,田纳西州, 显然有很多美国城市。 01:06:33.680 EN: But since the data is obtained from Wikipedia, of course, it's only as complete and correct as Wikipedia is. So are you interested any other query you are interested to build? What features did we not use? 中文初译: 但是,既然数据是从维基百科获得的, 当然, 它和维基百科一样完整正确。 那么您是否有兴趣建立其它任何您感兴趣的查询? 我们没有使用什么特征 ? 01:06:54.560 EN: We could use let's go to maybe again to Hanover. Let's do some optional queries. So we have leader party here is a property. 中文初译: 我们也许可以再去汉诺威,我们来做一些非强制性的问询。所以这里的领导党是一个财产。 01:07:10.520 EN: So if you want to have the cities and the party of the leader, we could add that and then we say party and then we get elevation and party. 中文初译: 所以,如果你想拥有城市 和领袖的党, 我们可以加上这一点 然后我们说党,然后我们得到 升格和党。 01:07:24.540 EN: Let's maybe you want to see if there is a correlation between the height and the city and the party. And we order maybe again in descending order. Let's see what we get here. 中文初译: 让我们来看看高度和城市之间 以及派对之间是否有关联。我们再订购一次降序。让我们来看看这里有什么。 01:07:38.160 EN: So and you see now the highest city we get is Munich. So and this is because the properties of party is only given for apparently not for all cities, only for those cities where it's available. 中文初译: 所以,你可以看到现在我们得到的最高城市是慕尼黑。所以这是因为党的属性 仅仅给给不是所有的城市, 仅仅给那些有聚会的城市。 01:07:55.540 EN: So these are primarily here German, German cities. Yeah. And then you can see the social democratic party. You can see that the three highest towns in Germany are ruled by a social democratic party. So maybe there is a pattern. 中文初译: 这些主要是德国的德国城市。是的,然后你可以看到社会民主党。你可以看到德国的三个最高城镇是由一个社会民主政党统治的。所以也许有一个模式。 01:08:09.540 EN: The higher the town, the more social democratic the voters are in these towns. While if we look at the lower ones here, they are more ruled by the conservative party or the green party. 中文初译: 这些城镇越高,选民的社会民主度就越高。 如果我们看看这里的下层,他们就越受保守党或绿党的统治。 01:08:23.800 EN: In the middle we also have the left. We wanted to do something maybe also optional. So we can also add optional and then another graph pattern inside here. And what do we do the leader? 中文初译: 在中间,我们也有左边。 我们想做一些可能也是可选的。 所以我们也可以在这里添加一个可选的图案, 然后再添加另一个图表图案。 我们做什么领导呢? 01:08:43.860 EN: Maybe the leader, we could use leader title for example because sometimes they are called program master, sometimes over program master. 中文初译: 也许领导者,我们可以使用领导者称号,比如说,因为有时他们被称为方案大师,有时甚至高于方案大师。 01:08:54.110 EN: Then we use city leader title. We just call it title. Execute the query and now you can see that we sometimes have also empty results because apparently for Turin this property is not defined for Nürnberg. 中文初译: 然后我们使用城市领导者头衔。 我们称之为标题。 执行查询, 现在你可以看到我们有时也有空结果 因为显然都灵的这个财产不是在纽伦堡定义的。 01:09:11.990 EN: It's not defined for Würzburg. It's not defined for Kala. It's not defined. Yeah. So now you see with optional basically that we also get unbound results here. 中文初译: 它不是为Würzburg定义的,也不是为Kala定义的。它不是为Kala定义的。是的。所以现在你可以用可选的方式看到, 基本上,我们在这里也取得了一些没有限制的结果。 01:09:25.590 EN: Yeah. But for many it's defined and it's called Oberbergermeister. Interestingly it's tagged here as English. I would say Oberbergermeister is a German title but apparently that's what it is. 中文初译: 有趣的是,它被贴上英文标签。我想说,奥伯伯格梅斯特是德国的头衔,但显然这就是它的头衔。 01:09:41.330 EN: In Mayer as it is here in Darmstadt. So that's optional and we could maybe do another. Let's maybe look how this is for New York. 中文初译: 在Mayer,它在这里达姆施塔特。所以这是可选的,我们也许可以再做一次。让我们来看看这对纽约来说是怎么样的。 01:09:59.570 EN: New York City we actually should check. So we can click here New York City. Click on New York City and we should get the results. Yeah. Sorry. 中文初译: 我们实际上应该检查纽约市。所以我们可以点击这里的纽约市。点击纽约市,我们应该得到结果。 01:10:13.030 EN: No that's a soul band. Sorry that's also not the right. Looks a bit strange. Something is wrong here with the abstract. 中文初译: 不,那是灵魂乐队,对不起,那也是不对的 看起来有点奇怪,抽象的东西有点不对劲 01:10:24.080 EN: I think at New York City the city has to go in records. No that's also a band. Not New Yorker. I wanted to see New York and we want to see that's actually oh yeah it's New York City. 中文初译: 我想纽约市必须记录下来 不,那也是个乐队 不是纽约人,我想看看纽约 01:10:42.400 EN: Yeah that's how the URI is. So it should exactly have this one. So we can copy the URI. So that's actually the right page. 中文初译: 是的,这就是“URI”的原理。所以它应该有这个。 所以我们可以复制“URI”。所以这是正确的一页。 01:10:57.740 EN: Political leader we have here. We want to find leader title. Here we have leader title. How was it in? Yeah it was also leader title. Maybe let's remove the elevation here. 中文初译: 我们这里有政治领袖,我们想找到领导头衔。我们这里有领导头衔。情况如何?是的,也是领导头衔。也许让我们在这里取消高地。 01:11:15.800 EN: So since DBP there's such a large knowledge graph. It's a bit cumbersome maybe sometimes to figure out what the properties and the values are in there. 中文初译: 所以自DBP以来,有如此庞大的知识图表。有时要弄清楚里面的属性和价值 可能有点麻烦。 01:11:27.840 EN: So this is a very maybe the one of the largest and most complex knowledge graph. Yeah so here we have also the property is capital off. 中文初译: 因此,这是一个非常可能 最大和最复杂的知识图表之一。是的,我们在这里也有一个财产 正在资本关闭。 01:11:39.040 EN: Maybe another thing could be also what we could do is also check the different result sets. So let's maybe do an ask query. We replace select with ask and for ask of course you don't need the you don't have variables ask and here in that case it also doesn't allow us to do some ordering for ask. 中文初译: 也许我们也可以做另外一件事, 检查不同的结果组。 所以我们也许可以做一个询问查询。 我们用问和问替换选择。 当然, 您不需要您没有变量的询问。 如果这样的话, 它也不允许我们做点菜 。 01:12:04.340 EN: So now it complains that elevation is used in sub-expressions of the query but not assigned. Yeah because we removed the filter and we removed elevation. 中文初译: 所以现在它抱怨说,高地是用于查询的子表达面,但没有被指定。是的,因为我们删除了过滤器,我们删除了高地。 01:12:16.480 EN: So we basically should also remove the filter condition execute query. Now it returns us true. Yeah so that's an ask query. 中文初译: 因此我们基本上也应该删除过滤器条件执行查询。 现在它返回了我们的真实身份 。 所以这是一个询问查询 。 01:12:27.240 EN: So these are all German towns here actually. So why don't we get us towns because apparently this leader party property doesn't exist. 中文初译: 所以这里都是德国的城镇。为什么我们不去镇上, 因为显然这个领导党的财产并不存在。 01:12:38.520 EN: So if you want to we could then do here a union. So and to make it clear we could mark the different parts of the query. 中文初译: 所以,如果你愿意的话,我们可以在这里做一个工会。所以,为了表明这一点,我们可以标记查询的不同部分。 01:12:51.760 EN: So we could add here another curly bracket before the union to make it clear. Then after the union and then we select so what how was it here leader leader party doesn't exist. How was the term mayor leader title. 中文初译: 因此我们可以在此添加另一个卷轴, 以在工会之前弄清楚。 然后在工会之后, 然后我们选择为什么这里不存在领袖党。 市长任期的首领头衔如何? 01:13:16.200 EN: It was also leader title but leader party doesn't exist on the second case. So yeah we could remove leader party here. 中文初译: 也是领袖头衔,但第二起案件中并不存在领袖党。所以我们可以在这里取消领袖党。 01:13:27.820 EN: Okay with cities it doesn't maybe make so much sense but we could go for was it was there was a problem with spoke for example we didn't get returned in lower section um lower section while for Hanover it it worked. 中文初译: 城市问题也许说不通 但我们可以去... ...如果说起来有问题... ...比如说,我们没有回到低层... 01:13:48.100 EN: So we can here we have the country country Germany. Okay let's say we want to have um so we say country and then we say Germany. 中文初译: 所以,我们可以在这里我们有德国的国家。好吧,让我们假设我们想有 嗯,所以我们说国家 然后我们说德国。 01:14:01.700 EN: So let's assume we want to have German and French cities. So we copy this so we add Germany here and then we can do the union in the same way cities and instead of Germany we add here now France. 中文初译: 让我们假设我们想要有德国和法国的城市。 所以我们复制这个, 我们在这里加入德国, 然后我们可以用同样的城市方式来做联合, 而不是德国,我们现在在这里加入法国。 01:14:22.020 EN: Let's see if that works yeah and we get German cities do we also get French ones or not clear maybe they are in the end. 中文初译: 让我们看看这是否有效,是的,我们得到德国城市... ...我们是否也得到法国城市 或者不清楚,也许他们最终会。 01:14:33.200 EN: We can order by country city and we could yet now order actually this we have to do after the curly brackets order by title see what comes up there. 中文初译: 我们可以按乡村城市点菜, 而现在我们也可以按实际点菜。 在卷括号按标题顺序排列之后, 我们不得不这样做。 看看那里有什么变化。 01:14:47.800 EN: I still are still um only German towns I guess here but um but I guess you you get the point unfortunately we're running out of time so you can also build such unions maybe now the second part of the union is actually empty here because something um with France ah ah the problem is I have France here twice that's the problem maybe that solves it yeah and now you see here we have now also French towns 中文初译: 我仍然只是德国的城镇,我猜这里我猜是德国的城镇 但我猜你可能明白 我们时间不多了 你也可以成立这样的工会 01:15:19.970 EN: in here Paris and so on so that's an example for for union as well but for the French towns we apparently don't have the leader titles. 中文初译: 在巴黎这里,等等, 所以这是工会的一个榜样 也为工会,但对于法国城镇 我们显然没有领导头衔。