From c7747be8650ac72966e0ce8937b404947b020c27 Mon Sep 17 00:00:00 2001 From: Xenia Lu Date: Thu, 25 Aug 2022 13:26:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20EdgeDB=201.0=20?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E4=BC=9A/3=20=E5=BF=AB=E9=80=9F=E4=B8=8A?= =?UTF-8?q?=E6=89=8B=E4=B8=AD=E6=96=87=E5=AD=97=E5=B9=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- video/edgedb-day-1.0/subtitles/zh/3.bcc | 738 ++++++++++++------------ 1 file changed, 369 insertions(+), 369 deletions(-) diff --git a/video/edgedb-day-1.0/subtitles/zh/3.bcc b/video/edgedb-day-1.0/subtitles/zh/3.bcc index 830cf74..11bc3ca 100644 --- a/video/edgedb-day-1.0/subtitles/zh/3.bcc +++ b/video/edgedb-day-1.0/subtitles/zh/3.bcc @@ -9,2209 +9,2209 @@ "from": 6.631625, "to": 9.90990000000009, "location": 2, - "content": "Hello and welcome to this \"EdgeQL: a primer\"." + "content": "大家好,欢迎来到“EdgeQL:快速上手”。" }, { "from": 10.310299999999726, "to": 11.636624999999999, "location": 2, - "content": "My name is Victor Petrovykh," + "content": "我是 Victor Petrovykh," }, { "from": 11.636624999999999, "to": 14.839824999999816, "location": 2, - "content": "and I am a senior software engineer at EdgeDB." + "content": "是 EdgeDB 的高级软件工程师。 }, { "from": 15.848333500999864, "to": 18.14312199699989, "location": 2, - "content": "So we'll pick up" + "content": "下面我们会接着" }, { "from": 18.14312199699989, "to": 21.121099999999906, "location": 2, - "content": "kinda where Elvis has left off," + "content": "Elvis 的那部分继续展开," }, { "from": 21.121099999999906, "to": 23.748724999999908, "location": 2, - "content": "but we'll dive into more details about EdgeQL." + "content": "同时我们也会深入了解更多关于 EdgeQL 相关的细节。" }, { "from": 23.748724999999908, "to": 27.577549999999725, "location": 2, - "content": "And the best way to do it is by trying out to build something with it." + "content": "并且最好的方式就是尝试用它来开发一些东西。" }, { "from": 28.053025000000087, "to": 33.333299999999724, "location": 2, - "content": "So we'll go and try to model something familiar" + "content": "因此我们将尝试构建一些我们比较熟悉的模型," }, { "from": 33.333299999999724, "to": 36.86182499999981, "location": 2, - "content": "like the Netflix clone we already used in the previous example." + "content": "像是我们在前面的示例中使用过的仿 Netflix 片库。" }, { "from": 37.837799999999724, "to": 39.21417499999972, "location": 2, - "content": "And to keep things simple," + "content": "为简单起见," }, { "from": 39.21417499999972, "to": 42.71767499999972, "location": 2, - "content": "we'll ignore all the complexities that come with uh," + "content": "我们将不考虑涉及" }, { "from": 42.71767499999972, "to": 47.46382640999981, "location": 2, - "content": "setting up user accounts and profiles and such," + "content": "创建账户、配置文件等等这些复杂的流程," }, { "from": 47.46382640999981, "to": 49.599549999999724, "location": 2, - "content": "and we'll concentrate instead on the" + "content": "我们只将注意力放在" }, { "from": 49.599549999999724, "to": 52.802749999999996, "location": 2, - "content": "movie library aspect of our Netflix clone." + "content": "翻版的 Netflix 片库上面。" }, { "from": 53.770124407999766, "to": 56.50644999999981, "location": 2, - "content": "So, where do we start?" + "content": "咱们从哪儿开始好呢?" }, { "from": 56.50644999999981, "to": 58.93387499999999, "location": 2, - "content": "Well, we're gonna need some movies, uh..." + "content": "那么首先我们需要一些电影, 嗯... " }, { "from": 58.93387499999999, "to": 62.187124999999995, "location": 2, - "content": "with titles and maybe release year." + "content": "包含影片名称,或许还有上映年份。" }, { "from": 63.61354999999972, "to": 66.69162499999999, "location": 2, - "content": "And here's a type, type \"Movie\"." + "content": "这是一个类型定义,“Movie”(电影)类型。" }, { "from": 66.70803539399975, "to": 68.4183499999999, "location": 2, - "content": "It has a required" + "content": "它拥有一个必需属性" }, { "from": 68.4183499999999, "to": 72.37229999999973, "location": 2, - "content": "\"title\" property and an optional \"release_year\" property." + "content": "“title”(片名)以及一个可选属性“release_year”(上映年份)。" }, { "from": 72.97290000000008, "to": 74.22415000000008, "location": 2, - "content": "So far so good." + "content": "看起来不错。" }, { "from": 75.19150538899979, "to": 76.82674999999999, "location": 2, - "content": "But we're gonna need more," + "content": "但我们还是需要更多的信息," }, { "from": 76.82674999999999, "to": 79.1790999999999, "location": 2, - "content": "and, uh," + "content": "比如,呃," }, { "from": 79.1790999999999, "to": 80.14459252799988, "location": 2, - "content": "movies have directors." + "content": "电影是有导演的。" }, { "from": 80.14459252799988, "to": 84.4343499999999, "location": 2, - "content": "So, we'll represent that with a new type and, uh," + "content": "所以我们会用一个新的类型来代表导演并且,呃," }, { "from": 84.4343499999999, "to": 86.4363499999999, "location": 2, - "content": "define a relationship." + "content": "为他们定义一个关系。" }, { "from": 86.4363499999999, "to": 87.61252500000008, "location": 2, - "content": "Like so." + "content": "像这样。" }, { "from": 87.61252500000008, "to": 88.7886999999998, "location": 2, - "content": "There's a new type \"Person\" now," + "content": "现在我们有了一个新的类型“Person”(人员)," }, { "from": 88.7886999999998, "to": 90.55454007599974, "location": 2, - "content": "and there's a link \"director\"" + "content": "还有一个映射关系“director”(导演)," }, { "from": 90.55454007599974, "to": 93.29319999999981, "location": 2, - "content": "from the \"Movie\" to the \"Person\"." + "content": "从“Movie”到“Person”的映射关系。" }, { "from": 93.91882499999981, "to": 95.4453499999999, "location": 2, - "content": "It's a single link," + "content": "他是一个“single”(对一)映射关系。" }, { "from": 95.4453499999999, "to": 99.22412499999999, "location": 2, - "content": "so there can only be one director per movie." + "content": "也就是每部电影只能有一位导演。" }, { "from": 101.00090000000009, "to": 103.12802500000008, "location": 2, - "content": "But movies also have actors." + "content": "但电影也有演员。" }, { "from": 103.12802500000008, "to": 108.73362499999999, "location": 2, - "content": "So, we also add a multi-link \"actors\"" + "content": "所以,我们同样添加一个“multi”(对多)映射关系“actors”(演员)" }, { "from": 108.73362499999999, "to": 113.6885749999998, "location": 2, - "content": "to the same type \"Person\", representing uh..." + "content": "到同一个“Person”类型上,这表示..." }, { "from": 113.6885749999998, "to": 118.06794999999981, "location": 2, - "content": "the fact that every movie can actually have multiple actors associated with it." + "content": "实际上每部电影是可以有多个演员参演的这一事实。" }, { "from": 120.09496298799992, "to": 121.07094999999981, "location": 2, - "content": "Well." + "content": "好吧。" }, { "from": 122.24710998499991, "to": 125.0999749999999, "location": 2, - "content": "There is some other information that could be useful." + "content": "还有一些其他有用的信息。" }, { "from": 125.70055798299997, "to": 127.60245798300005, "location": 2, - "content": "Actors have ... Actors play characters," + "content": "演员有... 演员扮演角色," }, { "from": 127.60245798300005, "to": 132.70755497999986, "location": 2, - "content": "and it would be really neat if we could store the character name somewhere." + "content": "要是我们可以把角色名称存到哪儿,那就太好了。" }, { "from": 132.70755497999986, "to": 135.33517597599987, "location": 2, - "content": "And there is a way to do so." + "content": "有一种方式可以做到这点。" }, { "from": 135.33517597599987, "to": 139.28915000000006, "location": 2, - "content": "We can enrich the actor relationship by adding a link property to it." + "content": "我们可以通过添加一个映射属性来丰富这个演员关系。" }, { "from": 140.0899239740001, "to": 145.92074797300003, "location": 2, - "content": "And this is basically a property that's directly on the link," + "content": "其实就是直接放在映射关系上的一个属性," }, { "from": 145.92074797300003, "to": 148.4733249999998, "location": 2, - "content": "and we'll call it \"character_name\"." + "content": "我们给它命名为“character_name”(角色名称)。" }, { "from": 148.4733249999998, "to": 152.52737499999998, "location": 2, - "content": "And this will, uh ..." + "content": "而且这会,嗯..." }, { "from": 152.52737499999998, "to": 156.75659999999988, "location": 2, - "content": "this will encapsulate the information of," + "content": "这会封装一些信息," }, { "from": 156.75659999999988, "to": 159.45679549799988, "location": 2, - "content": "basically the triplet of" + "content": "主要包括" }, { "from": 159.45679549799988, "to": 162.41224999999997, "location": 2, - "content": "who played, in which movie, what character." + "content": "演员是谁、出演哪部电影、扮演什么角色这三个要素。" }, { "from": 165.73806949700008, "to": 167.5899164939999, "location": 2, - "content": "Now," + "content": "然而," }, { "from": 167.5899164939999, "to": 171.11843749, "location": 2, - "content": "this is going to be a big ..." + "content": "这是一个很大的... " }, { "from": 171.11843749, "to": 175.44776148899993, "location": 2, - "content": "big Netflix clone with a big library of stuff to see." + "content": "很大的 Netflix 片库,我们可以看到一大堆的资源。" }, { "from": 175.44776148899993, "to": 177.17448648899983, "location": 2, - "content": "And there is going to be more than just movies," + "content": "不仅仅有电影," }, { "from": 177.17448648899983, "to": 180.1049249999997, "location": 2, - "content": "there is going to be shows with episodes and such." + "content": "还会有剧集等资源。" }, { "from": 180.60291048799968, "to": 183.20802500000008, "location": 2, - "content": "So, to represent these shows," + "content": "因次,为了表示这些剧集," }, { "from": 183.20802500000008, "to": 186.18599999999998, "location": 2, - "content": "we're gonna need an another type," + "content": "我们需要另一种类型," }, { "from": 186.18599999999998, "to": 187.2370499999997, "location": 2, - "content": "similar to \"Movie\"," + "content": "类似于“Movie”(电影)," }, { "from": 187.2370499999997, "to": 190.44025, "location": 2, - "content": "with a lot of same ..." + "content": "它们拥有很多相同的..." }, { "from": 190.44025, "to": 193.5933879880001, "location": 2, - "content": "a lot of the same things like \"title\" and \"actors\"." + "content": "很多相同的属性,比如“title”(剧集名称)和“actors”(演员)。" }, { "from": 193.5933879880001, "to": 196.34615000000008, "location": 2, - "content": "But maybe we don't have \"release_year\"," + "content": "但可能我们不需要“release_year”(上映年份)这个属性," }, { "from": 196.34615000000008, "to": 200.65042797800007, "location": 2, - "content": "because it's not quite as clearly define for a \"Show\"." + "content": "因为对剧集来说并不需要那么明确的定义。" }, { "from": 200.65042797800007, "to": 204.35415000000006, "location": 2, - "content": "And \"director\" is also not as clearly define." + "content": "同样“director”(导演)属性也不需要明确定义。" }, { "from": 204.4542279779998, "to": 205.3050779779997, "location": 2, - "content": "On the other hand," + "content": "相反," }, { "from": 205.3050779779997, "to": 208.00777597599978, "location": 2, - "content": "we will have a number of episodes specified." + "content": "我们需要一个数字来表示剧集的集数。" }, { "from": 208.00777597599978, "to": 211.28607499999978, "location": 2, - "content": "So the \"Show\" will look something like this." + "content": "所以这个“Show”(剧集)类型定义看起来会是这样。" }, { "from": 211.28607499999978, "to": 212.03679396899975, "location": 2, - "content": "Well." + "content": "好吧。" }, { "from": 212.03679396899975, "to": 213.58837499999998, "location": 2, - "content": "That looks like a lot of copy pasting," + "content": "看起来这一大推的复制粘贴," }, { "from": 213.66344999999978, "to": 217.84258696199984, "location": 2, - "content": "and that's not exactly ideal in most programming settings." + "content": "对于大部分数据结构定义的编写来说并不是一个理想的方式。" }, { "from": 217.84258696199984, "to": 220.72045895899973, "location": 2, - "content": "We want to avoid copy pasting as much as possible usually," + "content": "通常我们希望尽可能地避免复制粘贴," }, { "from": 220.72045895899973, "to": 223.19793295799977, "location": 2, - "content": "and we can do so" + "content": "然而我们可以" }, { "from": 223.19793295799977, "to": 225.9006749999997, "location": 2, - "content": "in EdgeDB by" + "content": "在 EdgeDB 中使用" }, { "from": 225.9006749999997, "to": 230.50763235499969, "location": 2, - "content": "using a \"mixin\" type." + "content": "“mixin”(混入)类型来实现这一点。" }, { "from": 230.50763235499969, "to": 234.0337999999997, "location": 2, - "content": "And refactor out all the common links and properties" + "content": "我们将这些共有的映射关系和属性重构出来" }, { "from": 234.0337999999997, "to": 236.8115749999998, "location": 2, - "content": "into this mixin abstract type \"Content\"," + "content": "放到这个 mixin 抽象类型 “Content”(内容资源)中," }, { "from": 236.8115749999998, "to": 240.14225034800006, "location": 2, - "content": "we make our \"Movie\" and \"Show\" extend \"Content\"." + "content": "然后让我们的“Movie”和“Show”类型对“Content”类型进行扩展。" }, { "from": 240.14225034800006, "to": 244.76952500000007, "location": 2, - "content": "And now \"Movie\" and \"Show\" only need to contain the links and properties," + "content": "至此“Movie”和“Show”只需要包含" }, { "from": 244.76952500000007, "to": 247.27436934199983, "location": 2, - "content": "that specifically unique to them" + "content": "它们各自独有的映射关系和属性即可," }, { "from": 247.27436934199983, "to": 251.1952202759997, "location": 2, - "content": "and without any duplication." + "content": "而无需任何重复代码。" }, { "from": 251.1952202759997, "to": 252.97772499999988, "location": 2, - "content": "So," + "content": "接下来," }, { "from": 252.97772499999988, "to": 255.07443961999974, "location": 2, - "content": "what else?" + "content": "我看看还有什么?" }, { "from": 255.07443961999974, "to": 257.40175961499966, "location": 2, - "content": "We have this \"release_year\" and \"num_episodes\"," + "content": "大家看到这里的“release_year”(上映年份)和“num_episodes”(集数)," }, { "from": 257.40175961499966, "to": 261.1859249999997, "location": 2, - "content": "and we just selected int32 to represent them." + "content": "我们选用了 int32 这个数据类型来表示它们。" }, { "from": 261.1859249999997, "to": 263.98333261299973, "location": 2, - "content": "Which ... um, it's okay." + "content": "这... 呃,这没啥问题。" }, { "from": 263.98333261299973, "to": 267.9927249999999, "location": 2, - "content": "But it has negative values which is not ideal for our case," + "content": "然而 int32 是含有负值的,这对于我们的示例来说并不理想," }, { "from": 267.9927249999999, "to": 270.8205499999997, "location": 2, - "content": "and maybe we would like to restrict that." + "content": "或许我们更希望对此重新做些限制。" }, { "from": 270.8205499999997, "to": 273.648375, "location": 2, - "content": "Um, we can have constraints to our schema," + "content": "我们可以对我们的数据结构做些约束限制," }, { "from": 273.648375, "to": 277.6023249999998, "location": 2, - "content": "to make sure that completely unreasonable values" + "content": "以确保那些完全不合理的数值" }, { "from": 277.6023249999998, "to": 282.2569749999999, "location": 2, - "content": "don't get entered into our database for \"release_year\" and \"num_episodes\"." + "content": "不会当作“release_year”和“num_episodes”的值存入我们的数据库中。" }, { "from": 282.2569749999999, "to": 283.93365000000006, "location": 2, - "content": "And we have a built-in ..." + "content": "正好我们有一个内置..." }, { "from": 283.93365000000006, "to": 285.36007499999977, "location": 2, - "content": "we have a number of built-in constraints." + "content": "我们有很多内置约束。" }, { "from": 285.36007499999977, "to": 289.3390499999997, "location": 2, - "content": "We're gonna use the \"min_value\" constraint specifically here." + "content": "在这里我们会使用“min_value”(最小值)约束。" }, { "from": 289.3390499999997, "to": 291.49119999999976, "location": 2, - "content": "To generously," + "content": "我们可以毫不吝啬地" }, { "from": 291.49119999999976, "to": 295.78775225999993, "location": 2, - "content": "give a minimum value of 1900 for the \"release_year\"" + "content": "给上映年份一个 1900 年的最小值。" }, { "from": 295.78775225999993, "to": 298.16512725999996, "location": 2, - "content": "We're pretty sure nothing earlier than that," + "content": "我们非常确信不会有比这更早的电影" }, { "from": 298.16512725999996, "to": 300.7254249999997, "location": 2, - "content": "and even that is very generous," + "content": "(我简直是太慷慨了)" }, { "from": 300.7254249999997, "to": 303.1200722549999, "location": 2, - "content": "will appear in our movie library." + "content": "出现在我们的电影库中。" }, { "from": 303.1200722549999, "to": 305.20490000000007, "location": 2, - "content": "And for the shows," + "content": "然而对于剧集来说," }, { "from": 305.2972432510001, "to": 308.8257652480001, "location": 2, - "content": "the number of episodes" + "content": "我们把集数的最小值" }, { "from": 308.8257652480001, "to": 317.98177410999966, "location": 2, - "content": "will be kept at 2." + "content": "设定为 2。" }, { "from": 317.98177410999966, "to": 319.3331221079998, "location": 2, - "content": "Well." + "content": "嗯。" }, { "from": 319.3331221079998, "to": 322.34702500000003, "location": 2, - "content": "Now that we've set up ... the ... schema," + "content": "现在我们已经定义好了... 这个... 数据结构," }, { "from": 322.34702500000003, "to": 325.04972499999985, "location": 2, - "content": "we can actually get to querying." + "content": "我们可以正式开始执行查询语句了。" }, { "from": 325.04972499999985, "to": 327.8775499999997, "location": 2, - "content": "Um, what should we start with?" + "content": "我们应该从哪儿开始呢?" }, { "from": 327.8775499999997, "to": 331.29506409999965, "location": 2, - "content": "We have ..." + "content": "我们这是..." }, { "from": 331.29506409999965, "to": 333.10777500000006, "location": 2, - "content": "we have a Netflix clone," + "content": "我们这是一个 Netflix 的片库," }, { "from": 333.10777500000006, "to": 335.20987499999995, "location": 2, - "content": "so we're gonna have some kind of a" + "content": "那我们需要有一个类似" }, { "from": 335.20987499999995, "to": 336.0837229749997, "location": 2, - "content": "movie page" + "content": "电影介绍的页面," }, { "from": 336.0837229749997, "to": 337.86252500000006, "location": 2, - "content": "with all the information about the movie." + "content": "它会包含电影的所有信息。" }, { "from": 337.86252500000006, "to": 340.21284196899995, "location": 2, - "content": "So let's build up that query." + "content": "那么,让我们来构建这个查询语句吧。" }, { "from": 340.21284196899995, "to": 343.7684249999997, "location": 2, - "content": "Well if we just select the movie we get a bunch of" + "content": "然而,如果我们仅仅查询“Movie”,我们只会得到一堆 }, { "from": 343.7684249999997, "to": 346.6943109629997, "location": 2, - "content": "objects with just ids in them." + "content": "只有 id 的对象。" }, { "from": 346.6943109629997, "to": 347.84545695899976, "location": 2, - "content": "And if you remember," + "content": "如果你还记得的话," }, { "from": 347.84545695899976, "to": 350.1727769539997, "location": 2, - "content": "actually this is a good time to mention that," + "content": "现在刚好是一个说这事的好机会," }, { "from": 350.1727769539997, "to": 352.17477294999975, "location": 2, - "content": "we didn't have to specify" + "content": "其实我们不必" }, { "from": 352.17477294999975, "to": 354.87952500000006, "location": 2, - "content": "the fact that the objects have" + "content": "为对象指定“id”属性," }, { "from": 354.87952500000006, "to": 357.8554419439997, "location": 2, - "content": "\"id\" property that gets included by default" + "content": "因为它是默认被包含到" }, { "from": 357.8554419439997, "to": 360.6081839359997, "location": 2, - "content": "into every object." + "content": "每个对象中的。" }, { "from": 360.6081839359997, "to": 363.686254932, "location": 2, - "content": "They will all have unique ids" + "content": "它们都有唯一的 id" }, { "from": 363.686254932, "to": 365.46302492699976, "location": 2, - "content": "for us to use." + "content": "以便我们来使用。" }, { "from": 365.46302492699976, "to": 367.28984792499983, "location": 2, - "content": "Well, that's all nice." + "content": "嗯,很不错。" }, { "from": 367.28984792499983, "to": 368.7663199220001, "location": 2, - "content": "That's all nice but" + "content": "这很好,但其实" }, { "from": 368.7663199220001, "to": 371.6942439209999, "location": 2, - "content": "we actually need a lot more data to make it useable." + "content": "我们需要更多的数据使其可以为我们所使用。" }, { "from": 371.6942439209999, "to": 373.4209689209998, "location": 2, - "content": "So." + "content": "所以," }, { "from": 373.4209689209998, "to": 376.32594999999975, "location": 2, - "content": "We add what we call a shape." + "content": "我们添加这样一个结构。" }, { "from": 376.49904392100007, "to": 378.45307199699965, "location": 2, - "content": "Inside this curly braces," + "content": "在这个大括号中," }, { "from": 378.45307199699965, "to": 380.73034199199986, "location": 2, - "content": "we write the fields that we want to fetch." + "content": "写上了我们想要获取的字段。" }, { "from": 380.73034199199986, "to": 385.610215991, "location": 2, - "content": "And this may look actually similar to GraphQL, and" + "content": "这或许看起来很类似于 GraphQL," }, { "from": 385.610215991, "to": 390.3649629879999, "location": 2, - "content": "it works in a very similar way." + "content": "工作方式也非常相似。" }, { "from": 390.3649629879999, "to": 398.1977999999997, "location": 2, - "content": "So here we added some properties that we are now fetching." + "content": "因此我们在这添加了一些我们想要获取的属性。" }, { "from": 398.1977999999997, "to": 400.09969999999976, "location": 2, - "content": "Going forward, um ..." + "content": "言归正传,嗯..." }, { "from": 400.09969999999976, "to": 404.2538339839999, "location": 2, - "content": "we can actually nest these shapes um ..." + "content": "我们其实可以让这些结构,嗯..." }, { "from": 404.2538339839999, "to": 405.70528298299985, "location": 2, - "content": "inside each other, so" + "content": "彼此互相嵌套,所以" }, { "from": 405.70528298299985, "to": 407.55715000000004, "location": 2, - "content": "in addition to the ... to the \"Movie\" shape," + "content": "除了外面的这个... “Movie”结构外," }, { "from": 407.55715000000004, "to": 411.41099999999994, "location": 2, - "content": "we, inside of it, we can add the director link and call ..." + "content": "我们还可以在其内部添加“director”(导演)映射,并且..." }, { "from": 411.41099999999994, "to": 413.7633499999999, "location": 2, - "content": "add the name ... name to its shape," + "content": "添加“name”(导演名称)... 字段到这个结构中," }, { "from": 413.7633499999999, "to": 414.61417497499997, "location": 2, - "content": "and actors ..." + "content": "还有“actors”(演员)映射..." }, { "from": 414.61417497499997, "to": 417.8174, "location": 2, - "content": "and add their names too." + "content": "同样也写上他们的名字。" }, { "from": 417.8174, "to": 421.320872973, "location": 2, - "content": "Um, but there was something else we actually had," + "content": "不仅如此,我们还需要些别的信息," }, { "from": 421.320872973, "to": 423.2728229729998, "location": 2, - "content": "we had the character names for the actors, and " + "content": "我们存了这些演员所扮演的角色名。如果" }, { "from": 423.2728229729998, "to": 424.9995479729997, "location": 2, - "content": "that would be also nice, um," + "content": "可以将这些信息,嗯," }, { "from": 424.9995479729997, "to": 427.5270729729998, "location": 2, - "content": "a bit of information to include in this query." + "content": "放到这个查询里的话就太好了。" }, { "from": 427.5270729729998, "to": 432.30687499999993, "location": 2, - "content": "But the character names were not a property of the actors themselves," + "content": "但这些角色名并不属于“actors”本身的一个属性," }, { "from": 432.30687499999993, "to": 434.1586979729998, "location": 2, - "content": "they were the property of the link." + "content": "而是在映射关系上的一个属性。" }, { "from": 434.1586979729998, "to": 438.7132449699999, "location": 2, - "content": "So, there is special syntax for that." + "content": "所以,这就用到了一个特殊的语法," }, { "from": 438.7132449699999, "to": 440.4399669669997, "location": 2, - "content": "We use the \"@\" symbol," + "content": "我们使用“@”符号," }, { "from": 440.4399669669997, "to": 444.39391596600007, "location": 2, - "content": "to indicate to EdgeDB that" + "content": "这在 EdgeDB 里代表" }, { "from": 444.39391596600007, "to": 446.52107499999977, "location": 2, - "content": "this property is actually a link property," + "content": "它其实是一个映射属性," }, { "from": 446.52107499999977, "to": 449.89944599599977, "location": 2, - "content": "rather than a property of the object." + "content": "而不是一个对象的属性。" }, { "from": 449.89944599599977, "to": 452.50204999999966, "location": 2, - "content": "Now, finally we added a \"filter\"," + "content": "接下来,我们在最后面加上了“filter”(过滤)语句," }, { "from": 452.50204999999966, "to": 455.63017099599966, "location": 2, - "content": "because this is going to be a page for a specific movie." + "content": "因为我们实际上只想要某一个电影的介绍页。" }, { "from": 455.63017099599966, "to": 458.0826199950001, "location": 2, - "content": "And so we just select" + "content": "所以在这里我们只是用" }, { "from": 458.0826199950001, "to": 462.08661799299983, "location": 2, - "content": "filter movie by title here." + "content": "影片名称作为过滤条件来进行检索。" }, { "from": 462.08661799299983, "to": 465.71524199199996, "location": 2, - "content": "Notice that \"filter\" is using \"Movie.title\"," + "content": "需要注意的是,我们用“Movie.title”来指代过滤的字段," }, { "from": 465.71524199199996, "to": 468.5180379879997, "location": 2, - "content": "and we call that expression a \"path\"." + "content": "我们将这种表达式称之为“路径”。" }, { "from": 468.5180379879997, "to": 473.6231339840001, "location": 2, - "content": "Basically any \".\" separated expression is a path." + "content": "也就是说任何以“.”分隔的表达式都是一个路径。" }, { "from": 473.6231339840001, "to": 475.6001059809999, "location": 2, - "content": "It starts with some object," + "content": "这个路径以某个对象名开头," }, { "from": 475.6001059809999, "to": 479.2287269769999, "location": 2, - "content": "it follows by a bunch of links and properties to get to the" + "content": "紧随其后的是一连串的属于该对象的映射名和属性名," }, { "from": 479.2287269769999, "to": 484.2087019769998, "location": 2, - "content": "final set of values that it needs to consider." + "content": "最终得到想要查询的数据。" }, { "from": 484.2087019769998, "to": 485.8353269769998, "location": 2, - "content": "And," + "content": "此外," }, { "from": 485.8353269769998, "to": 487.7872769770001, "location": 2, - "content": "the thing about the path is that" + "content": "还有一点就是路径中的" }, { "from": 487.7872999999997, "to": 488.86335197699987, "location": 2, - "content": "this \"Movie\" here," + "content": "这个“Movie”," }, { "from": 488.86335197699987, "to": 492.3668519769999, "location": 2, - "content": "is actually referring to the movie we're selecting." + "content": "实际上指的是我们所查询的这部电影。" }, { "from": 492.3668519769999, "to": 495.52000097599966, "location": 2, - "content": "So we're saying select the movie with a whole bunch of stuff in it," + "content": "所以我们可以看出,我们通过这段代码查询一部电影及其相关信息," }, { "from": 495.52000097599966, "to": 497.171648974, "location": 2, - "content": "and" + "content": "然后" }, { "from": 497.171648974, "to": 500.92539897399996, "location": 2, - "content": "use the movie title in the filter." + "content": "使用片名作为过滤条件。" }, { "from": 500.92539897399996, "to": 501.80127397399997, "location": 2, - "content": "Now," + "content": "当然," }, { "from": 501.80127397399997, "to": 504.629096972, "location": 2, - "content": "there is a shorthand for this, because" + "content": "我们还一个更简洁的写法,主要是" }, { "from": 504.629096972, "to": 506.78127500000005, "location": 2, - "content": "quite often we end up referring" + "content": "我们会经常像这样用到" }, { "from": 506.83129697199985, "to": 509.2337249999999, "location": 2, - "content": "to the thing we're selecting." + "content": "当前查询的对象所关联的属性进行查询。" }, { "from": 509.2337249999999, "to": 511.9864439689998, "location": 2, - "content": "And the shorthand is" + "content": "简单写法就是" }, { "from": 511.9864439689998, "to": 513.4629499999998, "location": 2, - "content": "just start a path with a dot (\".\")." + "content": "以一个点(“.”)作为路径的起始。" }, { "from": 513.4629499999998, "to": 517.86730996, "location": 2, - "content": "What that means is that" + "content": "这代表" }, { "from": 517.86730996, "to": 519.6691089589998, "location": 2, - "content": "the path starts wherever" + "content": "路径是以 }, { "from": 519.6691089589998, "to": 523.5229589589997, "location": 2, - "content": "the scope of this expression is," + "content": "整个查询语句的作用域为起始的," }, { "from": 523.5229589589997, "to": 525.6500829579999, "location": 2, - "content": "so this expression appears in this scope of" + "content": "而我们看到当前出现在查询语句中的是" }, { "from": 525.6500829579999, "to": 526.9513819569996, "location": 2, - "content": "selecting a \"Movie\"." + "content": "“select Movie”这个作用域。" }, { "from": 526.9513819569996, "to": 528.1776049549998, "location": 2, - "content": "So \"Movie\" is the scope," + "content": "所以“Movie”就是(路径的) 作用域," }, { "from": 528.1776049549998, "to": 535.2847019520001, "location": 2, - "content": "and \".title\" becomes \"Movie.title\" internal." + "content": "其背后是将“.title”转换为“Movie.title”执行的。" }, { "from": 535.2847019520001, "to": 536.7361499499997, "location": 2, - "content": "Well." + "content": "好吧。" }, { "from": 536.7361499499997, "to": 539.8392469469999, "location": 2, - "content": "Now that we have a nice query for our movie page." + "content": "现在我们已经给咱们的电影介绍页写了一个很不错的查询语句了。" }, { "from": 539.8392469469999, "to": 544.6691249999999, "location": 2, - "content": "We can tweak it to provide a different kind of query," + "content": "我们还可以稍加改进来实现一种不同的查询方式," }, { "from": 544.6691249999999, "to": 546.5459419419999, "location": 2, - "content": "to maybe" + "content": "或许可以" }, { "from": 546.5459419419999, "to": 550.2496409409998, "location": 2, - "content": "using suggestions." + "content": "用在搜索建议上。" }, { "from": 550.2496409409998, "to": 552.9773659409997, "location": 2, - "content": "So, it looks pretty similar." + "content": "嗯,看起来(与前面的)相当类似。" }, { "from": 552.9773659409997, "to": 555.7551379379997, "location": 2, - "content": "There is our \"title\", \"release_year\", \"director\"." + "content": "“title”(片名)、“release_year”(上映年份)、“director”(导演)这些都还在。" }, { "from": 555.7551379379997, "to": 557.3067479979998, "location": 2, - "content": "We just ..." + "content": "而我们只是..." }, { "from": 557.3067479979998, "to": 558.8833249999998, "location": 2, - "content": "We dropped the actors." + "content": "去掉了“actors”(演员)。" }, { "from": 558.8833249999998, "to": 561.4442733899999, "location": 2, - "content": "Um ..., (this is) the sub-shape here." + "content": "呃... 在这是个子结构。" }, { "from": 561.4442733899999, "to": 564.272095387, "location": 2, - "content": "And the filter is different now, because" + "content": "再有就是过滤条件不一样了,现在" }, { "from": 564.272095387, "to": 566.3241453869998, "location": 2, - "content": "instead of selecting a specific single movie," + "content": "我们不再查询某部特定的电影," }, { "from": 566.3241453869998, "to": 569.1769953869997, "location": 2, - "content": "we are instead" + "content": "而是根据" }, { "from": 569.1769953869997, "to": 574.6074143809997, "location": 2, - "content": "getting suggestions based on the actor," + "content": "演员来获取(电影)搜索建议," }, { "from": 574.6074143809997, "to": 576.7761999999998, "location": 2, - "content": "the actor" + "content": "也就是" }, { "from": 576.7761999999998, "to": 579.7625593759999, "location": 2, - "content": "who played in the movie." + "content": "参演电影的演员。" }, { "from": 579.7625593759999, "to": 582.0898843759998, "location": 2, - "content": "So." + "content": "所以。" }, { "from": 582.0898843759998, "to": 583.6914843760001, "location": 2, - "content": "You can also see that" + "content": "如你所见," }, { "from": 583.6914843760001, "to": 586.1439343759998, "location": 2, - "content": "we're using the abbreviated path here as well." + "content": "在这我们仍然用到了这种简短的路径写法。" }, { "from": 586.1439343759998, "to": 593.4512343760001, "location": 2, - "content": "So this \".actors.name\" refers still to the \"Movie.actors.name\"." + "content": "也就是说“.actors.name”实际上就代表了“Movie.actors.name”。" }, { "from": 593.4512343760001, "to": 595.052834376, "location": 2, - "content": "Now, of course." + "content": "当然," }, { "from": 595.052834376, "to": 596.804584376, "location": 2, - "content": "Since this is going to be" + "content": "因为这个(查询语句)是要" }, { "from": 596.804584376, "to": 600.0328063729997, "location": 2, - "content": "used in our suggestion widget," + "content": "用到搜索栏组件上的," }, { "from": 600.0328063729997, "to": 602.7332100789997, "location": 2, - "content": "we don't want to overwhelm it by" + "content": "所以我们并不想让这个小组件" }, { "from": 602.7332100789997, "to": 604.4098830769997, "location": 2, - "content": " giving all possible results," + "content": "显示全部搜索结果," }, { "from": 604.4098830769997, "to": 606.0615300739996, "location": 2, - "content": "instead we're going to" + "content": "因此我们将" }, { "from": 606.0615300739996, "to": 607.888350069, "location": 2, - "content": "order them" + "content": "搜索结果" }, { "from": 607.888350069, "to": 611.7171730669996, "location": 2, - "content": "by \"release_year\" to keep the most recent ones on top." + "content": "按照“release_year”(上映年份)进行排序,让最新的电影保持在前面。" }, { "from": 611.7171730669996, "to": 613.5189710650001, "location": 2, - "content": "And just select the top 5." + "content": "并且选择最新的五部(电影)。" }, { "from": 613.5189710650001, "to": 618.5929749999998, "location": 2, - "content": "Using the \"order by\" and \"limit\" for this." + "content": "在这里,我们用到了“order by”和“limit”语句。" }, { "from": 618.5929749999998, "to": 620.1005460649999, "location": 2, - "content": "However," + "content": "不过," }, { "from": 620.1005460649999, "to": 622.0775210649998, "location": 2, - "content": "there was another thing that," + "content": "还有一个问题," }, { "from": 622.0775210649998, "to": 624.504946065, "location": 2, - "content": "that query didn't do." + "content": "上面这个查询并没有做到。" }, { "from": 624.504946065, "to": 627.2576950639997, "location": 2, - "content": "It was" + "content": "就是这个搜索结果" }, { "from": 627.2576950639997, "to": 628.3026749999997, "location": 2, - "content": "only selecting movies." + "content": "只包含了电影。" }, { "from": 628.3026749999997, "to": 631.3617930619997, "location": 2, - "content": "But we actually have movies and shows in our database." + "content": "然而我们数据库里其实是同时存有电影和剧集了。" }, { "from": 631.3617930619997, "to": 632.7131420609998, "location": 2, - "content": "So," + "content": "所以," }, { "from": 632.7131420609998, "to": 635.2406610549997, "location": 2, - "content": "instead we're going to use this polymorphic query," + "content": "我们在这里改用多态查询," }, { "from": 635.2406610549997, "to": 638.7441600539997, "location": 2, - "content": "selecting \"Content\" which is the abstract base type," + "content": "用这个抽象基类“Content”作为搜索对象," }, { "from": 638.7441600539997, "to": 641.015375, "location": 2, - "content": "both \"Movie\" and \"Show\" extend." + "content": "“Movie”和“Show”都是继承自它的。" }, { "from": 641.015375, "to": 645.1194749999999, "location": 2, - "content": "And inside of it, we'll specify different" + "content": "在这个查询语句内部,我们需要为那些独有的" }, { "from": 645.1194749999999, "to": 648.1035010449998, "location": 2, - "content": "properties and links that it should" + "content": "属性和映射关系指定其所属的对象类型," }, { "from": 648.1035010449998, "to": 652.0574500439998, "location": 2, - "content": "include depending whether this \"Content\" is \"Show\"," + "content": "也就是当“Content”为“Show”时," }, { "from": 652.0574500439998, "to": 653.959349043, "location": 2, - "content": "and then it should include \"num_episodes\"." + "content": "我们可以赋上“num_episodes”属性。" }, { "from": 653.959349043, "to": 654.7851740429998, "location": 2, - "content": "Or is a \"Movie\"," + "content": "或是当“Content”为“Movie”时," }, { "from": 654.7851740429998, "to": 658.463849043, "location": 2, - "content": "and then it should include the \"release_year\" and \"director\"." + "content": "则可以赋上“release_year”和“director”属性。" }, { "from": 658.463849043, "to": 661.2666490429997, "location": 2, - "content": "So the query stays" + "content": "我们看到整个查询的返回结构" }, { "from": 661.2666490429997, "to": 663.1935740429999, "location": 2, - "content": "largely the same." + "content": "基本保持不变。" }, { "from": 663.1935740429999, "to": 664.5699490429998, "location": 2, - "content": "But now," + "content": "只不过现在," }, { "from": 664.5699490429998, "to": 667.9232990429998, "location": 2, - "content": "this polymorphic query can" + "content": "这个多态查询语句可以" }, { "from": 667.9232990429998, "to": 669.6500210400001, "location": 2, - "content": "extract uniformly" + "content": "让我们" }, { "from": 669.6500210400001, "to": 673.8041670359997, "location": 2, - "content": "all these information, regarding shows and movies, based on" + "content": "按照演员(搜索),一次性获取其所参演的" }, { "from": 673.8041670359997, "to": 674.9302900339999, "location": 2, - "content": "on an actor" + "content": "剧集和电影" }, { "from": 674.9302900339999, "to": 676.0754000000001, "location": 2, - "content": "that" + "content": "的" }, { "from": 676.0754000000001, "to": 680.6860350290001, "location": 2, - "content": "star there." + "content": "全部信息。" }, { "from": 680.6860350290001, "to": 683.3769652709998, "location": 2, - "content": "Well." + "content": "接下来。" }, { "from": 683.3769652709998, "to": 686.1104249999996, "location": 2, - "content": "We probably want" + "content": "我们或许还需要" }, { "from": 686.1104249999996, "to": 687.6619749999999, "location": 2, - "content": "an actor page as well." + "content": "一个演员介绍页。" }, { "from": 687.6619749999999, "to": 690.6482623039997, "location": 2, - "content": "Or at least some kind of a" + "content": "或者至少需要一种" }, { "from": 690.6482623039997, "to": 692.2665749999998, "location": 2, - "content": "way of displaying some actor information." + "content": "展示演员信息的方式。" }, { "from": 692.4250373039998, "to": 699.84915, "location": 2, - "content": "But the actors only have one property in our schema." + "content": "但在我们的数据结构中演员只有一个属性。" }, { "from": 699.84915, "to": 702.009605297, "location": 2, - "content": "So, wouldn't that be a bit of a problem?" + "content": "那么,这样会不会有点什么问题呢?" }, { "from": 702.009605297, "to": 702.8104052969996, "location": 2, - "content": "Well." + "content": "其实。" }, { "from": 702.8104052969996, "to": 707.6402292959996, "location": 2, - "content": "We can include any arbitrary computed information in our" + "content": "我们可以在返回结构中包含任意经计算所得的" }, { "from": 707.6402292959996, "to": 708.534467641, "location": 2, - "content": "return shape." + "content": "信息。" }, { "from": 708.534467641, "to": 712.2865749999997, "location": 2, - "content": "And to do so we use this defined as (\":=\") symbol," + "content": "为此我们使用赋值运算符(“:=”)," }, { "from": 712.2865749999997, "to": 716.9929156389996, "location": 2, - "content": "also known as the walrus operator (\":=\")," + "content": "也被称作海象运算符," }, { "from": 716.9929156389996, "to": 720.0459626359997, "location": 2, - "content": "it's a colon with an equals (\":=\")." + "content": "也就是一个冒号跟着一个等号。" }, { "from": 720.0459626359997, "to": 722.0463249999997, "location": 2, - "content": "And for our example here," + "content": "在我们这个示例中," }, { "from": 722.0463249999997, "to": 724.9508596329997, "location": 2, - "content": "we just use a built-in function" + "content": "我们只是简单地调用一个内置函数" }, { "from": 724.9508596329997, "to": 728.8797816299998, "location": 2, - "content": "to split the actor's name" + "content": "将演员的姓名" }, { "from": 728.8797816299998, "to": 731.632529628, "location": 2, - "content": "into the individual components," + "content": "逐字拆分," }, { "from": 731.632529628, "to": 736.1370286269996, "location": 2, - "content": "as just a showcase of how to use" + "content": "来展示如何使用" }, { "from": 736.1370286269996, "to": 738.1374, "location": 2, - "content": "these arbitrary computed expressions." + "content": "这些计算表达式。" }, { "from": 738.1374, "to": 738.7896756239996, "location": 2, - "content": "However," + "content": "不过实际上," }, { "from": 738.7896756239996, "to": 741.317198622, "location": 2, - "content": "these expressions are in fact arbitrary," + "content": "这些表达式可以是任意的," }, { "from": 741.317198622, "to": 745.1460206189997, "location": 2, - "content": "so let's compute something else that's maybe a bit more useful," + "content": "所以让我们来计算一些其他可能更有用的信息吧," }, { "from": 745.1460206189997, "to": 749.6004676159998, "location": 2, - "content": "like the number of movies that" + "content": "比如说在我们的影片库中," }, { "from": 749.6004676159998, "to": 752.526775, "location": 2, - "content": "this particular actor has starred in" + "content": "这个指定演员所参演" }, { "from": 752.526775, "to": 754.9291749999996, "location": 2, - "content": "in our library." + "content": "影片的数量。" }, { "from": 754.9291749999996, "to": 757.508366615, "location": 2, - "content": "So we do a \"movies_count\"," + "content": "所以我们返回一个“movies_count”(影片数量), " }, { "from": 757.508366615, "to": 759.385241615, "location": 2, - "content": "and," + "content": "并且," }, { "from": 759.385241615, "to": 763.7546376459999, "location": 2, - "content": "we again use a built-in \"count\" function." + "content": "我们再次调用一个内置函数“count”来进行计算。" }, { "from": 763.7546376459999, "to": 765.656537646, "location": 2, - "content": "And the subquery," + "content": "现在这个子查询," }, { "from": 765.656537646, "to": 770.595904078, "location": 2, - "content": "this is fairly simple and" + "content": "其实是一个相当简单、" }, { "from": 770.595904078, "to": 773.0288435869998, "location": 2, - "content": "reasonably intuitive subquery, although" + "content": "直观的子查询,尽管如此," }, { "from": 773.0288435869998, "to": 775.2060165849997, "location": 2, - "content": "it's worth mentioning that" + "content": "我们还是强调一下" }, { "from": 775.2060165849997, "to": 779.7355375809998, "location": 2, - "content": "we're selecting movies where the \"actors\" ..." + "content": "表达式中所查询电影中的“actors”(演员)..." }, { "from": 779.7355375809998, "to": 785.4412405839997, "location": 2, - "content": "whether it's this person that we're selecting among the actors." + "content": "对应的这个“Person”就是我们在外面过滤出的这位演员。" }, { "from": 785.4412405839997, "to": 789.03825, "location": 2, - "content": "So the person in the subquery is actually the same person object" + "content": "也就是说子查询中的这个“Person”其实与我们在外面查询的“Person”" }, { "from": 789.03825, "to": 791.171962581, "location": 2, - "content": "as we're selecting." + "content": "是同一个“Person”对象。" }, { "from": 791.171962581, "to": 793.1489375809999, "location": 2, - "content": "And this is all fine." + "content": "整个查询语句看起来很不错。" }, { "from": 793.1489375809999, "to": 794.9257105789998, "location": 2, - "content": "It works." + "content": "可以查询成功。" }, { "from": 794.9257105789998, "to": 797.3030855789998, "location": 2, - "content": "But this is a bit bulky." + "content": "但是写法有点点臃肿。" }, { "from": 797.3030855789998, "to": 799.1299095779997, "location": 2, - "content": "There's actually a better way of doing this." + "content": "其实有更好的方式来实现这段查询。" }, { "from": 799.1299095779997, "to": 800.9000999999998, "location": 2, - "content": "Anytime that we ..." + "content": "无论何时我们..." }, { "from": 800.9000999999998, "to": 802.426625, "location": 2, - "content": "What we seem to want to do here" + "content": "我们似乎想要做的是," }, { "from": 802.426625, "to": 804.6197339179997, "location": 2, - "content": "is we seem to" + "content": "我们似乎" }, { "from": 804.6197339179997, "to": 806.3714829169999, "location": 2, - "content": "want to use the \"actors\" relationship," + "content": "想要使用“actors”的映射关系," }, { "from": 806.3714829169999, "to": 809.0992069159998, "location": 2, - "content": "and instead of going in the usual direction" + "content": "不是按照正常的方向" }, { "from": 809.0992069159998, "to": 811.7518539129998, "location": 2, - "content": "from \"Movie\" to a \"Person\", we want to" + "content": "从“Movie”到“Person”,而是" }, { "from": 811.7518539129998, "to": 813.3784779119999, "location": 2, - "content": "trace in backwards." + "content": "反过来进行查询。" }, { "from": 813.3784779119999, "to": 816.3814749089998, "location": 2, - "content": "And to do that, we have \"backlinks\"." + "content": "为了做到这点,我们用到了“backlinks”(反向链接)。" }, { "from": 816.3814749089998, "to": 818.2583499089998, "location": 2, - "content": "So." + "content": "因此。" }, { "from": 818.2583499089998, "to": 820.2603499089998, "location": 2, - "content": "We use this special symbol for the backlink." + "content": "我们使用这个特殊的符号来进行反向查询。" }, { "from": 820.2603499089998, "to": 821.8619499089997, "location": 2, - "content": "It's ... Instead of a dot (\".\")," + "content": "区别于普通链接的一个点(“.”)," }, { "from": 821.8619499089997, "to": 824.9400239079997, "location": 2, - "content": "it's a dot with a back arrow (\".<\")," + "content": "反向链接则是一个点,后面跟着一个后退箭头(“.<”)," }, { "from": 824.9400239079997, "to": 829.0281999999997, "location": 2, - "content": "which says follow the \"actors\" link backwards." + "content": "表示对“actors”进行反向查询。" }, { "from": 829.0281999999997, "to": 831.0961739079997, "location": 2, - "content": "And then," + "content": "然后," }, { "from": 831.0961739079997, "to": 834.8574594359999, "location": 2, - "content": "we also add this \"[is Movie]\" construct there." + "content": "我们同时在这里加上这个“[is Movie]”语句。" }, { "from": 834.8574594359999, "to": 841.115275, "location": 2, - "content": "And we're already familiar with this from our polymorphic queries." + "content": "我们之前已经从多态查询中介绍过这种形式了。" }, { "from": 841.115275, "to": 845.9185074339998, "location": 2, - "content": "And the ..." + "content": "那么..." }, { "from": 845.9185074339998, "to": 848.2124420769999, "location": 2, - "content": "Overall this," + "content": "总的来说," }, { "from": 848.2124420769999, "to": 851.740963073, "location": 2, - "content": "will get us from the person we're starting at," + "content": "这个语句所表达的是从“Person”开始," }, { "from": 851.740963073, "to": 854.8539999999999, "location": 2, - "content": "following the \"actors\" link back to the movies" + "content": "后面跟着个“actors”," }, { "from": 854.8539999999999, "to": 856.9711860709996, "location": 2, - "content": "that refer to them." + "content": "反向关联到所参演的电影上。" }, { "from": 856.9711860709996, "to": 859.0581999999997, "location": 2, - "content": "And get us all those movies" + "content": "在拿到这些电影之后," }, { "from": 859.0581999999997, "to": 862.9370749999997, "location": 2, - "content": "which we can now count." + "content": "我们可以继续统计其数量了。" }, { "from": 862.9370749999997, "to": 863.4375749999997, "location": 2, - "content": "Well." + "content": "那么问题来了。" }, { "from": 863.6627989989997, "to": 866.6157499999999, "location": 2, - "content": "That backlink stuff is actually quite useful. And" + "content": "既然反向链接这玩意这么有用。那" }, { "from": 866.6157499999999, "to": 868.993119995, "location": 2, - "content": "wouldn't it be nice to add to the schema?" + "content": "把它直接放到数据结构里,它不香吗?" }, { "from": 868.993119995, "to": 872.2713939939998, "location": 2, - "content": "Well, we actually can." + "content": "是的,我们其实可以做到。" }, { "from": 872.2713939939998, "to": 875.7498749999999, "location": 2, - "content": "We can define this computed link \"in_movies\"" + "content": "我们可以在数据结构中直接定义这个计算链接属性" }, { "from": 876.0001169919999, "to": 877.626740991, "location": 2, - "content": "directly in the schema," + "content": "“in_movies”," }, { "from": 877.626740991, "to": 878.877990991, "location": 2, - "content": "so that we don't have to" + "content": "这样我们就不用在查询的时候" }, { "from": 878.877990991, "to": 886.3604639889998, "location": 2, - "content": "retype the backlink syntax all over again." + "content": "再写一遍反向链接的语法了。" }, { "from": 886.3604639889998, "to": 888.4375379879997, "location": 2, - "content": "Let's ..." + "content": "接下来..." }, { "from": 888.4375379879997, "to": 890.0391369869997, "location": 2, - "content": "Let's add" + "content": "让我们" }, { "from": 890.0391369869997, "to": 892.7418359859996, "location": 2, - "content": "three of the most recent" + "content": "从数据库中找到这些演员" }, { "from": 892.7418359859996, "to": 896.1452499999999, "location": 2, - "content": "movies that the actor appeared in our data." + "content": "近期所参演的三部电影。" }, { "from": 896.2453329829999, "to": 897.9720549799998, "location": 2, - "content": "Because just saying how many is ..." + "content": "因为我们在想,与其只是拿到影片的数量..." }, { "from": 897.9720549799998, "to": 900.7322213889996, "location": 2, - "content": "is probably less interesting than" + "content": "这或许不如" }, { "from": 900.7322213889996, "to": 902.5840703879996, "location": 2, - "content": "showing the recent ..." + "content": "展示近期..." }, { "from": 902.5840703879996, "to": 903.6351193869999, "location": 2, - "content": "recent features." + "content": "近期参演的影片有意思。" }, { "from": 903.6351193869999, "to": 907.8893673849997, "location": 2, - "content": "So again, we start with a query that should be familiar" + "content": "同样地,我们还是从一个查询开始,应该已经很熟悉了," }, { "from": 907.8893673849997, "to": 911.2102999999996, "location": 2, - "content": "we're fetching the person's name and movie count." + "content": "我们获取了这个“Person”的名字和影片数量。" }, { "from": 911.2927673849998, "to": 914.571041384, "location": 2, - "content": "And in the count now we're just using" + "content": "这里返回的影片数量正是" }, { "from": 914.571041384, "to": 917.1412249999998, "location": 2, - "content": "the computed link we defined in the schema" + "content": "我们刚刚在数据结构中定义的那个计算链接属性," }, { "from": 917.1412249999998, "to": 920.4132897959996, "location": 2, - "content": "instead of the backlink explicitly." + "content": "而非显式地调用反向链接。" }, { "from": 920.4132897959996, "to": 923.9918637949996, "location": 2, - "content": "And to add the three recent movies," + "content": "为了能够找到最新的三部影片," }, { "from": 923.9918637949996, "to": 928.1460097909996, "location": 2, - "content": "we follow this computed link \"in_movies\"," + "content": "我们在这个计算链接属性“in_movies”之后," }, { "from": 928.1460097909996, "to": 930.7235817879998, "location": 2, - "content": "we fetch their \"title\" and \"release_year\"." + "content": "抓取他们的“title”(片名)和“release_year”(上映年份)。" }, { "from": 930.7235817879998, "to": 931.4743317879999, "location": 2, - "content": "And then," + "content": "然后," }, { "from": 931.4743317879999, "to": 933.0509067879997, "location": 2, - "content": "after this shape," + "content": "在此结构后面," }, { "from": 933.0509067879997, "to": 937.505356788, "location": 2, - "content": "we order this entire thing," + "content": "我们将全部返回的影片进行排序," }, { "from": 937.505356788, "to": 940.4395, "location": 2, - "content": "we order it by \"release_year\"" + "content": "按照上映年份的" }, { "from": 940.4395, "to": 944.812649781, "location": 2, - "content": "in descending order and select the top 3 again." + "content": "倒序排列并再次选择前三部影片。" }, { "from": 944.812649781, "to": 948.0220749999997, "location": 2, - "content": "This gets us" + "content": "至此我们拿到了" }, { "from": 948.0220749999997, "to": 952.4202447759995, "location": 2, - "content": "our actor information," + "content": "演员的信息," }, { "from": 952.4202447759995, "to": 955.3543999999999, "location": 2, - "content": "including the number of movies they starred in" + "content": "包含了其参演影片的数量" }, { "from": 955.3543999999999, "to": 961.9161812259999, "location": 2, - "content": "as well as the latest three features." + "content": "以及其最新的三部影片。" }, { "from": 961.9161812259999, "to": 963.9932562259997, "location": 2, - "content": "Of course." + "content": "当然了。" }, { "from": 963.9932562259997, "to": 966.195456226, "location": 2, - "content": "EdgeQL is not limited to" + "content": "EdgeQL 不仅仅局限于" }, { "from": 966.195456226, "to": 966.8158499999998, "location": 2, - "content": "selecting data," + "content": "数据查询," }, { "from": 966.8158499999998, "to": 969.1984552249996, "location": 2, - "content": "we can also insert, update and delete stuff." + "content": "我们还可以用它来执行插入、更新和删除的操作。" }, { "from": 969.1984552249996, "to": 970.2495032229997, "location": 2, - "content": "And," + "content": "在此," }, { "from": 970.2495032229997, "to": 974.8290782229999, "location": 2, - "content": "here's a little teaser for a nested insert." + "content": "我做个关于嵌套插入的小预告。" }, { "from": 974.8290782229999, "to": 976.9812272219997, "location": 2, - "content": "It uses" + "content": "我们用到了" }, { "from": 976.9812272219997, "to": 979.4336772219999, "location": 2, - "content": "the defined as or the walrus operator (\":=\")" + "content": "赋值运算符也称为海象运算符(“:=”)" }, { "from": 979.4336772219999, "to": 982.0112522219997, "location": 2, - "content": "to" + "content": "来" }, { "from": 982.0112522219997, "to": 983.4376742189999, "location": 2, - "content": "insert the data," + "content": "插入数据," }, { "from": 983.4376742189999, "to": 987.391621216, "location": 2, - "content": "except that unlike in the selection queries," + "content": "除此之外,与查询语句并无不同," }, { "from": 987.391621216, "to": 989.6748771909997, "location": 2, - "content": "of course, all the links and properties" + "content": "当然了,在此所提到的" }, { "from": 989.6748771909997, "to": 993.0782771909998, "location": 2, - "content": "mentioned here must actually exist on the object," + "content": "我们想要插入的所有链接和属性," }, { "from": 993.0782771909998, "to": 996.2564501889997, "location": 2, - "content": "into which they're being inserted." + "content": "都必须是真正存在于这个对象上的。" }, { "from": 996.2564501889997, "to": 1001.5367241879999, "location": 2, - "content": "The fact that it uses the same expression as ..." + "content": "我们使用了相同的表达式作为..." }, { "from": 1001.5367241879999, "to": 1003.5024999999999, "location": 2, - "content": "as the computed ..." + "content": "作为计算..." }, { "from": 1003.5024999999999, "to": 1005.040220184, "location": 2, - "content": "computed expressions," + "content": "计算表达式," }, { "from": 1005.040220184, "to": 1007.65665, "location": 2, - "content": "suggests that actually any valid EdgeQL expression" + "content": "这实际上表明任何合法 EdgeQL 表达式" }, { "from": 1007.65665, "to": 1012.0972641779999, "location": 2, - "content": "can appear on the other side of this operator." + "content": "都可以出现在运算符的另一边。" }, { "from": 1012.0972641779999, "to": 1013.999164178, "location": 2, - "content": "And indeed," + "content": "其实," }, { "from": 1013.999164178, "to": 1017.3775371759998, "location": 2, - "content": "for \"director\" here we include a subquery," + "content": "对于包含在子查询语句中的“director”(导演)" }, { "from": 1017.3775371759998, "to": 1022.657811175, "location": 2, - "content": "that inserts a new \"Person\" record." + "content": "其实是插入了一条新的“Person”(人员)记录。" }, { "from": 1022.657811175, "to": 1025.9861331719997, "location": 2, - "content": "We could have instead used the subqueries that selects" + "content": "我们可以改为使用检索" }, { "from": 1025.9861331719997, "to": 1027.7266999999997, "location": 2, - "content": "an existing record or anything else," + "content": "已经存在的记录或是其他任何内容的子查询语句," }, { "from": 1027.7378791679996, "to": 1032.5676991629996, "location": 2, - "content": "as long as it produces a \"Person\" at the end" + "content": "只要是它最终能够生成一个“Person”," }, { "from": 1032.5676991629996, "to": 1034.794920159, "location": 2, - "content": "that we can assign as a director." + "content": "以便我们可以将其指定为一名导演。" }, { "from": 1034.794920159, "to": 1035.6958201589996, "location": 2, - "content": "So like this," + "content": "像这样," }, { "from": 1035.6958201589996, "to": 1038.9991201589999, "location": 2, - "content": "we have a nested insert which creates two objects and" + "content": "我们有了这样一个嵌套插入语句,它同时创建了两个对象并且" }, { "from": 1038.9991201589999, "to": 1041.2263451589997, "location": 2, - "content": "links them together." + "content": "彼此链接在一起。" }, { "from": 1041.2263451589997, "to": 1043.2283451589997, "location": 2, - "content": "Well." + "content": "好吧。" }, { "from": 1043.2283451589997, "to": 1045.4305441579997, "location": 2, - "content": "This includes the primer." + "content": "这就是“快速上手”的全部内容了。" }, { "from": 1045.4305441579997, "to": 1048.2583641529995, "location": 2, - "content": "And," + "content": "然而," }, { "from": 1048.2583641529995, "to": 1052.6377381519997, "location": 2, - "content": "really there is so much more to EdgeQL than" + "content": "EdgeQL 远不止" }, { "from": 1052.6377381519997, "to": 1054.089188152, "location": 2, - "content": "that has been presented here." + "content": "你们所看到的这些。" }, { "from": 1054.089188152, "to": 1055.1040499999997, "location": 2, - "content": "And I hope this" + "content": "至少我希望这" }, { "from": 1055.1040499999997, "to": 1057.7178121509996, "location": 2, - "content": "has picked your interest enough for you to actually go and" + "content": "已经足够引起你们的兴趣" }, { "from": 1057.7178121509996, "to": 1058.5686621509997, "location": 2, - "content": " try us out," + "content": "去试用看看、" }, { "from": 1058.5686621509997, "to": 1059.3694611499998, "location": 2, - "content": "read the docs," + "content": "读读文档," }, { "from": 1059.3694611499998, "to": 1065.8340903209996, "location": 2, - "content": "and discover all the power of EdgeQL that is available." + "content": "一起探索 EdgeQL 所拥有的强大功能。" }, { "from": 1065.8340903209996, "to": 1067.1911249999998, "location": 2, - "content": "Thank you!" + "content": "谢谢大家!" } ] -} \ No newline at end of file +} -- Gitee From 0c89f08b99d53556e00eeb9d4b8a233a26315aec Mon Sep 17 00:00:00 2001 From: Xenia Lu Date: Fri, 26 Aug 2022 12:24:05 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20JSON=20=E8=BD=AC?= =?UTF-8?q?=E4=B9=89=E5=8F=8A=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- video/edgedb-day-1.0/subtitles/zh/3.bcc | 154 ++++++++++++------------ 1 file changed, 77 insertions(+), 77 deletions(-) diff --git a/video/edgedb-day-1.0/subtitles/zh/3.bcc b/video/edgedb-day-1.0/subtitles/zh/3.bcc index 11bc3ca..e861739 100644 --- a/video/edgedb-day-1.0/subtitles/zh/3.bcc +++ b/video/edgedb-day-1.0/subtitles/zh/3.bcc @@ -9,7 +9,7 @@ "from": 6.631625, "to": 9.90990000000009, "location": 2, - "content": "大家好,欢迎来到“EdgeQL:快速上手”。" + "content": "大家好,欢迎来到\u201cEdgeQL:快速上手\u201d。" }, { "from": 10.310299999999726, @@ -21,7 +21,7 @@ "from": 11.636624999999999, "to": 14.839824999999816, "location": 2, - "content": "是 EdgeDB 的高级软件工程师。 + "content": "是 EdgeDB 的高级软件工程师。" }, { "from": 15.848333500999864, @@ -111,7 +111,7 @@ "from": 63.61354999999972, "to": 66.69162499999999, "location": 2, - "content": "这是一个类型定义,“Movie”(电影)类型。" + "content": "这是一个类型定义,\u201cMovie\u201d(电影)类型。" }, { "from": 66.70803539399975, @@ -123,7 +123,7 @@ "from": 68.4183499999999, "to": 72.37229999999973, "location": 2, - "content": "“title”(片名)以及一个可选属性“release_year”(上映年份)。" + "content": "\u201ctitle\u201d(片名)以及一个可选属性\u201crelease_year\u201d(上映年份)。" }, { "from": 72.97290000000008, @@ -171,25 +171,25 @@ "from": 87.61252500000008, "to": 88.7886999999998, "location": 2, - "content": "现在我们有了一个新的类型“Person”(人员)," + "content": "现在我们有了一个新的类型\u201cPerson\u201d(人员)," }, { "from": 88.7886999999998, "to": 90.55454007599974, "location": 2, - "content": "还有一个映射关系“director”(导演)," + "content": "还有一个映射关系\u201cdirector\u201d(导演)," }, { "from": 90.55454007599974, "to": 93.29319999999981, "location": 2, - "content": "从“Movie”到“Person”的映射关系。" + "content": "从\u201cMovie\u201d到\u201cPerson\u201d的映射关系。" }, { "from": 93.91882499999981, "to": 95.4453499999999, "location": 2, - "content": "他是一个“single”(对一)映射关系。" + "content": "他是一个\u201csingle\u201d(对一)映射关系。" }, { "from": 95.4453499999999, @@ -207,13 +207,13 @@ "from": 103.12802500000008, "to": 108.73362499999999, "location": 2, - "content": "所以,我们同样添加一个“multi”(对多)映射关系“actors”(演员)" + "content": "所以,我们同样添加一个\u201cmulti\u201d(对多)映射关系\u201cactors\u201d(演员)" }, { "from": 108.73362499999999, "to": 113.6885749999998, "location": 2, - "content": "到同一个“Person”类型上,这表示..." + "content": "到同一个\u201cPerson\u201d类型上,这表示..." }, { "from": 113.6885749999998, @@ -267,7 +267,7 @@ "from": 145.92074797300003, "to": 148.4733249999998, "location": 2, - "content": "我们给它命名为“character_name”(角色名称)。" + "content": "我们给它命名为\u201ccharacter_name\u201d(角色名称)。" }, { "from": 148.4733249999998, @@ -339,7 +339,7 @@ "from": 186.18599999999998, "to": 187.2370499999997, "location": 2, - "content": "类似于“Movie”(电影)," + "content": "类似于\u201cMovie\u201d(电影)," }, { "from": 187.2370499999997, @@ -351,13 +351,13 @@ "from": 190.44025, "to": 193.5933879880001, "location": 2, - "content": "很多相同的属性,比如“title”(剧集名称)和“actors”(演员)。" + "content": "很多相同的属性,比如\u201ctitle\u201d(剧集名称)和\u201cactors\u201d(演员)。" }, { "from": 193.5933879880001, "to": 196.34615000000008, "location": 2, - "content": "但可能我们不需要“release_year”(上映年份)这个属性," + "content": "但可能我们不需要\u201crelease_year\u201d(上映年份)这个属性," }, { "from": 196.34615000000008, @@ -369,7 +369,7 @@ "from": 200.65042797800007, "to": 204.35415000000006, "location": 2, - "content": "同样“director”(导演)属性也不需要明确定义。" + "content": "同样\u201cdirector\u201d(导演)属性也不需要明确定义。" }, { "from": 204.4542279779998, @@ -387,7 +387,7 @@ "from": 208.00777597599978, "to": 211.28607499999978, "location": 2, - "content": "所以这个“Show”(剧集)类型定义看起来会是这样。" + "content": "所以这个\u201cShow\u201d(剧集)类型定义看起来会是这样。" }, { "from": 211.28607499999978, @@ -429,7 +429,7 @@ "from": 225.9006749999997, "to": 230.50763235499969, "location": 2, - "content": "“mixin”(混入)类型来实现这一点。" + "content": "\u201cmixin\u201d(混入)类型来实现这一点。" }, { "from": 230.50763235499969, @@ -441,19 +441,19 @@ "from": 234.0337999999997, "to": 236.8115749999998, "location": 2, - "content": "放到这个 mixin 抽象类型 “Content”(内容资源)中," + "content": "放到这个 mixin 抽象类型 \u201cContent\u201d(内容资源)中," }, { "from": 236.8115749999998, "to": 240.14225034800006, "location": 2, - "content": "然后让我们的“Movie”和“Show”类型对“Content”类型进行扩展。" + "content": "然后让我们的\u201cMovie\u201d和\u201cShow\u201d类型对\u201cContent\u201d类型进行扩展。" }, { "from": 240.14225034800006, "to": 244.76952500000007, "location": 2, - "content": "至此“Movie”和“Show”只需要包含" + "content": "至此\u201cMovie\u201d和\u201cShow\u201d只需要包含" }, { "from": 244.76952500000007, @@ -483,7 +483,7 @@ "from": 255.07443961999974, "to": 257.40175961499966, "location": 2, - "content": "大家看到这里的“release_year”(上映年份)和“num_episodes”(集数)," + "content": "大家看到这里的\u201crelease_year\u201d(上映年份)和\u201cnum_episodes\u201d(集数)," }, { "from": 257.40175961499966, @@ -525,7 +525,7 @@ "from": 277.6023249999998, "to": 282.2569749999999, "location": 2, - "content": "不会当作“release_year”和“num_episodes”的值存入我们的数据库中。" + "content": "不会当作\u201crelease_year\u201d和\u201cnum_episodes\u201d的值存入我们的数据库中。" }, { "from": 282.2569749999999, @@ -543,7 +543,7 @@ "from": 285.36007499999977, "to": 289.3390499999997, "location": 2, - "content": "在这里我们会使用“min_value”(最小值)约束。" + "content": "在这里我们会使用\u201cmin_value\u201d(最小值)约束。" }, { "from": 289.3390499999997, @@ -657,7 +657,7 @@ "from": 340.21284196899995, "to": 343.7684249999997, "location": 2, - "content": "然而,如果我们仅仅查询“Movie”,我们只会得到一堆 + "content": "然而,如果我们仅仅查询\u201cMovie\u201d,我们只会得到一堆" }, { "from": 343.7684249999997, @@ -687,7 +687,7 @@ "from": 352.17477294999975, "to": 354.87952500000006, "location": 2, - "content": "为对象指定“id”属性," + "content": "为对象指定\u201cid\u201d属性," }, { "from": 354.87952500000006, @@ -795,25 +795,25 @@ "from": 405.70528298299985, "to": 407.55715000000004, "location": 2, - "content": "除了外面的这个... “Movie”结构外," + "content": "除了外面的这个... \u201cMovie\u201d结构外," }, { "from": 407.55715000000004, "to": 411.41099999999994, "location": 2, - "content": "我们还可以在其内部添加“director”(导演)映射,并且..." + "content": "我们还可以在其内部添加\u201cdirector\u201d(导演)映射,并且..." }, { "from": 411.41099999999994, "to": 413.7633499999999, "location": 2, - "content": "添加“name”(导演名称)... 字段到这个结构中," + "content": "添加\u201cname\u201d(导演名称)... 字段到这个结构中," }, { "from": 413.7633499999999, "to": 414.61417497499997, "location": 2, - "content": "还有“actors”(演员)映射..." + "content": "还有\u201cactors\u201d(演员)映射..." }, { "from": 414.61417497499997, @@ -849,7 +849,7 @@ "from": 427.5270729729998, "to": 432.30687499999993, "location": 2, - "content": "但这些角色名并不属于“actors”本身的一个属性," + "content": "但这些角色名并不属于\u201cactors\u201d本身的一个属性," }, { "from": 432.30687499999993, @@ -867,7 +867,7 @@ "from": 438.7132449699999, "to": 440.4399669669997, "location": 2, - "content": "我们使用“@”符号," + "content": "我们使用\u201c@\u201d符号," }, { "from": 440.4399669669997, @@ -891,7 +891,7 @@ "from": 449.89944599599977, "to": 452.50204999999966, "location": 2, - "content": "接下来,我们在最后面加上了“filter”(过滤)语句," + "content": "接下来,我们在最后面加上了\u201cfilter\u201d(过滤)语句," }, { "from": 452.50204999999966, @@ -915,19 +915,19 @@ "from": 462.08661799299983, "to": 465.71524199199996, "location": 2, - "content": "需要注意的是,我们用“Movie.title”来指代过滤的字段," + "content": "需要注意的是,我们用\u201cMovie.title\u201d来指代过滤的字段," }, { "from": 465.71524199199996, "to": 468.5180379879997, "location": 2, - "content": "我们将这种表达式称之为“路径”。" + "content": "我们将这种表达式称之为\u201c路径\u201d。" }, { "from": 468.5180379879997, "to": 473.6231339840001, "location": 2, - "content": "也就是说任何以“.”分隔的表达式都是一个路径。" + "content": "也就是说任何以\u201c.\u201d分隔的表达式都是一个路径。" }, { "from": 473.6231339840001, @@ -963,7 +963,7 @@ "from": 487.7872999999997, "to": 488.86335197699987, "location": 2, - "content": "这个“Movie”," + "content": "这个\u201cMovie\u201d," }, { "from": 488.86335197699987, @@ -1023,7 +1023,7 @@ "from": 511.9864439689998, "to": 513.4629499999998, "location": 2, - "content": "以一个点(“.”)作为路径的起始。" + "content": "以一个点(\u201c.\u201d)作为路径的起始。" }, { "from": 513.4629499999998, @@ -1035,7 +1035,7 @@ "from": 517.86730996, "to": 519.6691089589998, "location": 2, - "content": "路径是以 + "content": "路径是以" }, { "from": 519.6691089589998, @@ -1053,19 +1053,19 @@ "from": 525.6500829579999, "to": 526.9513819569996, "location": 2, - "content": "“select Movie”这个作用域。" + "content": "\u201cselect Movie\u201d这个作用域。" }, { "from": 526.9513819569996, "to": 528.1776049549998, "location": 2, - "content": "所以“Movie”就是(路径的) 作用域," + "content": "所以\u201cMovie\u201d就是(路径的) 作用域," }, { "from": 528.1776049549998, "to": 535.2847019520001, "location": 2, - "content": "其背后是将“.title”转换为“Movie.title”执行的。" + "content": "其背后是将\u201c.title\u201d转换为\u201cMovie.title\u201d执行的。" }, { "from": 535.2847019520001, @@ -1107,7 +1107,7 @@ "from": 552.9773659409997, "to": 555.7551379379997, "location": 2, - "content": "“title”(片名)、“release_year”(上映年份)、“director”(导演)这些都还在。" + "content": "\u201ctitle\u201d(片名)、\u201crelease_year\u201d(上映年份)、\u201cdirector\u201d(导演)这些都还在。" }, { "from": 555.7551379379997, @@ -1119,7 +1119,7 @@ "from": 557.3067479979998, "to": 558.8833249999998, "location": 2, - "content": "去掉了“actors”(演员)。" + "content": "去掉了\u201cactors\u201d(演员)。" }, { "from": 558.8833249999998, @@ -1185,7 +1185,7 @@ "from": 586.1439343759998, "to": 593.4512343760001, "location": 2, - "content": "也就是说“.actors.name”实际上就代表了“Movie.actors.name”。" + "content": "也就是说\u201c.actors.name\u201d实际上就代表了\u201cMovie.actors.name\u201d。" }, { "from": 593.4512343760001, @@ -1233,7 +1233,7 @@ "from": 607.888350069, "to": 611.7171730669996, "location": 2, - "content": "按照“release_year”(上映年份)进行排序,让最新的电影保持在前面。" + "content": "按照\u201crelease_year\u201d(上映年份)进行排序,让最新的电影保持在前面。" }, { "from": 611.7171730669996, @@ -1245,7 +1245,7 @@ "from": 613.5189710650001, "to": 618.5929749999998, "location": 2, - "content": "在这里,我们用到了“order by”和“limit”语句。" + "content": "在这里,我们用到了\u201corder by\u201d和\u201climit\u201d语句。" }, { "from": 618.5929749999998, @@ -1299,13 +1299,13 @@ "from": 635.2406610549997, "to": 638.7441600539997, "location": 2, - "content": "用这个抽象基类“Content”作为搜索对象," + "content": "用这个抽象基类\u201cContent\u201d作为搜索对象," }, { "from": 638.7441600539997, "to": 641.015375, "location": 2, - "content": "“Movie”和“Show”都是继承自它的。" + "content": "\u201cMovie\u201d和\u201cShow\u201d都是继承自它的。" }, { "from": 641.015375, @@ -1323,25 +1323,25 @@ "from": 648.1035010449998, "to": 652.0574500439998, "location": 2, - "content": "也就是当“Content”为“Show”时," + "content": "也就是当\u201cContent\u201d为\u201cShow\u201d时," }, { "from": 652.0574500439998, "to": 653.959349043, "location": 2, - "content": "我们可以赋上“num_episodes”属性。" + "content": "我们可以赋上\u201cnum_episodes\u201d属性。" }, { "from": 653.959349043, "to": 654.7851740429998, "location": 2, - "content": "或是当“Content”为“Movie”时," + "content": "或是当\u201cContent\u201d为\u201cMovie\u201d时," }, { "from": 654.7851740429998, "to": 658.463849043, "location": 2, - "content": "则可以赋上“release_year”和“director”属性。" + "content": "则可以赋上\u201crelease_year\u201d和\u201cdirector\u201d属性。" }, { "from": 658.463849043, @@ -1461,7 +1461,7 @@ "from": 708.534467641, "to": 712.2865749999997, "location": 2, - "content": "为此我们使用赋值运算符(“:=”)," + "content": "为此我们使用赋值运算符(\u201c:=\u201d)," }, { "from": 712.2865749999997, @@ -1551,7 +1551,7 @@ "from": 754.9291749999996, "to": 757.508366615, "location": 2, - "content": "所以我们返回一个“movies_count”(影片数量), " + "content": "所以我们返回一个\u201cmovies_count\u201d(影片数量), " }, { "from": 757.508366615, @@ -1563,7 +1563,7 @@ "from": 759.385241615, "to": 763.7546376459999, "location": 2, - "content": "我们再次调用一个内置函数“count”来进行计算。" + "content": "我们再次调用一个内置函数\u201ccount\u201d来进行计算。" }, { "from": 763.7546376459999, @@ -1593,25 +1593,25 @@ "from": 775.2060165849997, "to": 779.7355375809998, "location": 2, - "content": "表达式中所查询电影中的“actors”(演员)..." + "content": "表达式中所查询电影中的\u201cactors\u201d(演员)..." }, { "from": 779.7355375809998, "to": 785.4412405839997, "location": 2, - "content": "对应的这个“Person”就是我们在外面过滤出的这位演员。" + "content": "对应的这个\u201cPerson\u201d就是我们在外面过滤出的这位演员。" }, { "from": 785.4412405839997, "to": 789.03825, "location": 2, - "content": "也就是说子查询中的这个“Person”其实与我们在外面查询的“Person”" + "content": "也就是说子查询中的这个\u201cPerson\u201d其实与我们在外面查询的\u201cPerson\u201d" }, { "from": 789.03825, "to": 791.171962581, "location": 2, - "content": "是同一个“Person”对象。" + "content": "是同一个\u201cPerson\u201d对象。" }, { "from": 791.171962581, @@ -1659,7 +1659,7 @@ "from": 804.6197339179997, "to": 806.3714829169999, "location": 2, - "content": "想要使用“actors”的映射关系," + "content": "想要使用\u201cactors\u201d的映射关系," }, { "from": 806.3714829169999, @@ -1671,7 +1671,7 @@ "from": 809.0992069159998, "to": 811.7518539129998, "location": 2, - "content": "从“Movie”到“Person”,而是" + "content": "从\u201cMovie\u201d到\u201cPerson\u201d,而是" }, { "from": 811.7518539129998, @@ -1683,7 +1683,7 @@ "from": 813.3784779119999, "to": 816.3814749089998, "location": 2, - "content": "为了做到这点,我们用到了“backlinks”(反向链接)。" + "content": "为了做到这点,我们用到了\u201cbacklinks\u201d(反向链接)。" }, { "from": 816.3814749089998, @@ -1701,19 +1701,19 @@ "from": 820.2603499089998, "to": 821.8619499089997, "location": 2, - "content": "区别于普通链接的一个点(“.”)," + "content": "区别于普通链接的一个点(\u201c.\u201d)," }, { "from": 821.8619499089997, "to": 824.9400239079997, "location": 2, - "content": "反向链接则是一个点,后面跟着一个后退箭头(“.<”)," + "content": "反向链接则是一个点,后面跟着一个后退箭头(\u201c.<\u201d)," }, { "from": 824.9400239079997, "to": 829.0281999999997, "location": 2, - "content": "表示对“actors”进行反向查询。" + "content": "表示对\u201cactors\u201d进行反向查询。" }, { "from": 829.0281999999997, @@ -1725,7 +1725,7 @@ "from": 831.0961739079997, "to": 834.8574594359999, "location": 2, - "content": "我们同时在这里加上这个“[is Movie]”语句。" + "content": "我们同时在这里加上这个\u201c[is Movie]\u201d语句。" }, { "from": 834.8574594359999, @@ -1749,13 +1749,13 @@ "from": 848.2124420769999, "to": 851.740963073, "location": 2, - "content": "这个语句所表达的是从“Person”开始," + "content": "这个语句所表达的是从\u201cPerson\u201d开始," }, { "from": 851.740963073, "to": 854.8539999999999, "location": 2, - "content": "后面跟着个“actors”," + "content": "后面跟着个\u201cactors\u201d," }, { "from": 854.8539999999999, @@ -1809,7 +1809,7 @@ "from": 876.0001169919999, "to": 877.626740991, "location": 2, - "content": "“in_movies”," + "content": "\u201cin_movies\u201d," }, { "from": 877.626740991, @@ -1881,7 +1881,7 @@ "from": 907.8893673849997, "to": 911.2102999999996, "location": 2, - "content": "我们获取了这个“Person”的名字和影片数量。" + "content": "我们获取了这个\u201cPerson\u201d的名字和影片数量。" }, { "from": 911.2927673849998, @@ -1911,13 +1911,13 @@ "from": 923.9918637949996, "to": 928.1460097909996, "location": 2, - "content": "我们在这个计算链接属性“in_movies”之后," + "content": "我们在这个计算链接属性\u201cin_movies\u201d之后," }, { "from": 928.1460097909996, "to": 930.7235817879998, "location": 2, - "content": "抓取他们的“title”(片名)和“release_year”(上映年份)。" + "content": "抓取他们的\u201ctitle\u201d(片名)和\u201crelease_year\u201d(上映年份)。" }, { "from": 930.7235817879998, @@ -2019,7 +2019,7 @@ "from": 976.9812272219997, "to": 979.4336772219999, "location": 2, - "content": "赋值运算符也称为海象运算符(“:=”)" + "content": "赋值运算符也称为海象运算符(\u201c:=\u201d)" }, { "from": 979.4336772219999, @@ -2097,13 +2097,13 @@ "from": 1013.999164178, "to": 1017.3775371759998, "location": 2, - "content": "对于包含在子查询语句中的“director”(导演)" + "content": "对于包含在子查询语句中的\u201cdirector\u201d(导演)" }, { "from": 1017.3775371759998, "to": 1022.657811175, "location": 2, - "content": "其实是插入了一条新的“Person”(人员)记录。" + "content": "其实是插入了一条新的\u201cPerson\u201d(人员)记录。" }, { "from": 1022.657811175, @@ -2121,7 +2121,7 @@ "from": 1027.7378791679996, "to": 1032.5676991629996, "location": 2, - "content": "只要是它最终能够生成一个“Person”," + "content": "只要是它最终能够生成一个\u201cPerson\u201d," }, { "from": 1032.5676991629996, @@ -2157,7 +2157,7 @@ "from": 1043.2283451589997, "to": 1045.4305441579997, "location": 2, - "content": "这就是“快速上手”的全部内容了。" + "content": "这就是\u201c快速上手\u201d的全部内容了。" }, { "from": 1045.4305441579997, -- Gitee