query-05d2c298f8dc79a04c10a6f8e0e22e62

rq turtle/ttl

ORDER وLIMITنعود إلى برنامجنا المنتظم المقرر لميزات سباركل. بطريقة ما، ثم نهتم بالنتائج القليلة الأولى (تلك التي تحتوي على أفضل رتبة). مصنفةحتى الآن، كانت لدينا فقط استعلامات حيث كنا مهتمين بجميع النتائج، ولكن من الشائع جدا ألا نهتم إلا بعدد قليل من النتائج: تلك الأكثر تطرفا بطريقة أو بأخرى - أقدمها، وأعلاها، وأحدثها وأعلاها سكانا، وأقلها في نقطة الانصهار والأكثر أطفالا والمواد والأكثر استخداما وما إلى ذلك، العامل المشترك هنا هو أن النتائج . LIMIT وORDER BY (بعد الأقواس وليس داخلها!): WHERE {}يتم التحكم في هذا عن طريق جملتين، يتم إلحاقهما بكتلة .) something يساوي فقط ASC(something)). (إذا لم تقم بتحديد أي منهما، فسيكون الإعداد الافتراضي هو الفرز التصاعدي; لذ تنازليأو إنهاء تصاعدي' لتحديد ترتيب الفرز (إنهاء DESC() أو ASC())، لكننا سنرى بعض الأنواع الأخرى في وقت لاحق، يمكن أيضا تغليف هذا التعبير إما في ?something يمكن أن يكون أي تعبير، في الوقت الحالي، النوع الوحيد من التعبيرات التي نعرفها هي متغيرات بسيطة (something. something يفرز النتائج حسب ORDER BY something فقط يعرض نتيجة واحدة. LIMIT 1 يحد الاستعلام إلى عشر نتائج، LIMIT 10 هو أي رقم طبيعي، على سبيل المثال، count، حيث count يقطع قائمة النتائج في نتائج LIMIT count يمكنها تسريع الاستعلام بدرجة كبيرة; حيث يمكن لخدمة استعلام ويكي بيانات التوقف عن البحث عن النتائج بمجرد العثور على ما يكفي لملء الحد.) LIMIT النتائج، ولكن لا يهمك أي منها، وفي كلتا الحالتين، إضافة بعض، وفي هذه الحالة، لا يتم فرز النتائج; لذلك ليس لديك أي ضمان للنتائج التي ستحصل عليها، وهو أمر جيد إذا عرفت أن هناك عددا معينا من النتائج، أو كنت مهتما فقط بORDER BY بدون LIMIT(يمكنك أيضا استخدام clauses. LIMIT وORDER BY)، يمكنك البدء بالبحث عن البلدان مع سكانها، ثم إضافة عبارتي P:P1082، والخاصية الخاصة بالسكان هي (Q3624078)sovereign state وقت التمرين! حاول كتابة استعلام يُرجِع الدول العشر الأكثر اكتظاظا بالسكان. (البلد هو ها هو الحل الخاص بي: ORDER i LIMITTornem al nostre programa habitual per a més característiques d'SPARQL. d'alguna forma, i després ens interessen els primers resultats (els que son més importants). classifiquenFins ara, només hem vist consultes en les que volíem totes les coincidències. Però és prou habitual necessitar només uns quants resultats: aquells que son més extrems, d'alguna manera - més vells, més joves, primers, últims, amb més població, amb menor punt de fusió, amb més fills, més materials usats, etc. El factor comú és que els resultats es . LIMIT i ORDER BY (després de les claus, no dins!): WHERE {}Això es controla amb dues clàusules, les quals s'afegeixen al bloc .) alguna cosa equival a només ASC(something)endent). (Si no voleu especificar cap de les dues coses, l'opció predeterminada és ordenació ascendent, així que descendent o asc per a especificar l'ordre d'ordenació (DESC() o ASC()), però aviat en veurem algunes d'altres tipus. Aquesta expressió també es pot embolcallar dins ?alguna cosa pot ser qualsevol expressió -per ara i tant, l'única forma d'expressió que coneixem son variables senzilles (alguna cosa. alguna cosa ordena els resultats per ORDER BY alguna cosa només retorna un resultat. LIMIT 1 limita la consulta a 10 resultats. LIMIT 10 és qualsevol nombre natural. Per exemple, nombre resultats, on nombre retalla la llista de resultats a LIMIT nombre pot accelerar de forma significativa la consulta, perquè WDQS aturarà la cerca bon punt tingui la quantitat de resultats que se li han demanat.) LIMIT resultats, però no us preocupa quins. En qualsevol cas, afegint alguns. En aquest cas, els resultats sortiran sense ordenar, així que no tindrem cap garantia de quin resultat obtindrem. El qual està bé si sabem que hi ha un nombre limitat de resultats, o si només estem interessats en ORDER BY sense LIMIT(També es pot utilitzar . LÍMIT i ORDER BY.) Podeu començar buscant països amb la seva població, i després afegir-hi les clàusules P:P1082, i la propietat per a població és (Q3624078)sovereign state Temps d'exercici! Proveu d'escriure una consulta que retorni el deu països més poblats. (Un país és un Aquesta és la solució proposada: ORDER and LIMIT We return to our regular scheduled program of more SPARQL features. in some way, and then we care about the first few results (those with the best rank). rankedSo far, we’ve only had queries where we were interested in all results. But it’s quite common to care only about a few results: those that are most extreme in some way – oldest, youngest, earliest, latest, highest population, lowest melting point, most children, most materials used, and so on. The common factor here is that the results are . LIMIT and ORDER BY block (after the braces, not inside!): WHERE {}This is controlled by two clauses, which are appended to the .) something is equivalent to just ASC(something)ending). (If you don’t specify either, the default is ascending sort, so descending or asc to specify the sorting order (DESC() or ASC()), but we’ll see some other kinds later. This expression can also be wrapped in either ?something can be any expression – for now, the only kind of expression we know are simple variables (something. something sorts the results by ORDER BY something only returns a single result. LIMIT 1 limits the query to ten results. LIMIT 10 is any natural number. For example, count results, where count cuts off the result list at LIMIT count can significantly speed up the query, since WDQS can stop searching for results as soon as it’s found enough to fill the limit.) LIMIT result, but don’t care about which one. In either case, adding the some. In this case, the results aren’t sorted, so you don’t have any guarantee which results you’ll get. Which is fine if you happen to know that there’s only a certain number of results, or you’re just interested in ORDER BY without LIMIT(You can also use clauses. LIMIT and ORDER BY.) You can start by searching for countries with their population, and then add the P:P1082, and the property for population is (Q3624078)sovereign state Exercise time! Try to write a query that returns the ten most populous countries. (A country is a Her er min løsning: ORDER and LIMITWe return to our regular scheduled program of more SPARQL features. in some way, and then we care about the first few results (those with the best rank). rankedSo far, we’ve only had queries where we were interested in all results. But it’s quite common to care only about a few results: those that are most extreme in some way – oldest, youngest, earliest, latest, highest population, lowest melting point, most children, most materials used, and so on. The common factor here is that the results are . LIMIT and ORDER BY block (after the braces, not inside!): WHERE {}This is controlled by two clauses, which are appended to the .) something is equivalent to just ASC(something)ending). (If you don’t specify either, the default is ascending sort, so descending or asc to specify the sorting order (DESC() or ASC()), but we’ll see some other kinds later. This expression can also be wrapped in either ?something can be any expression – for now, the only kind of expression we know are simple variables (something. something sorts the results by ORDER BY something only returns a single result. LIMIT 1 limits the query to ten results. LIMIT 10 is any natural number. For example, count results, where count cuts off the result list at LIMIT count can significantly speed up the query, since WDQS can stop searching for results as soon as it’s found enough to fill the limit.) LIMIT result, but don’t care about which one. In either case, adding the some. In this case, the results aren’t sorted, so you don’t have any guarantee which results you’ll get. Which is fine if you happen to know that there’s only a certain number of results, or you’re just interested in ORDER BY without LIMIT(You can also use clauses. LIMIT and ORDER BY.) You can start by searching for countries with their population, and then add the P:P1082, and the property for population is (Q3624078)sovereign state Exercise time! Try to write a query that returns the ten most populous countries. (A country is a Here’s my solution: ORDER and LIMITWe return to our regular scheduled program of more SPARQL features. in some way, and then we care about the first few results (those with the best rank). rankedSo far, we’ve only had queries where we were interested in all results. But it’s quite common to care only about a few results: those that are most extreme in some way – oldest, youngest, earliest, latest, highest population, lowest melting point, most children, most materials used, and so on. The common factor here is that the results are . LIMIT and ORDER BY block (after the braces, not inside!): WHERE {}This is controlled by two clauses, which are appended to the .) something is equivalent to just ASC(something)ending). (If you don’t specify either, the default is ascending sort, so descending or asc to specify the sorting order (DESC() or ASC()), but we’ll see some other kinds later. This expression can also be wrapped in either ?something can be any expression – for now, the only kind of expression we know are simple variables (something. something sorts the results by ORDER BY something only returns a single result. LIMIT 1 limits the query to ten results. LIMIT 10 is any natural number. For example, count results, where count cuts off the result list at LIMIT count can significantly speed up the query, since WDQS can stop searching for results as soon as it’s found enough to fill the limit.) LIMIT result, but don’t care about which one. In either case, adding the some. In this case, the results aren’t sorted, so you don’t have any guarantee which results you’ll get. Which is fine if you happen to know that there’s only a certain number of results, or you’re just interested in ORDER BY without LIMIT(You can also use clauses. LIMIT and ORDER BY.) You can start by searching for countries with their population, and then add the P:P1082, and the property for population is (Q3624078)sovereign state Exercise time! Try to write a query that returns the ten most populous countries. (A country is a Here’s my solution: ORDER ו־LIMIT (סידור והגבלה)אנו חוזרים לתוכנית המקורית שלנו עם עוד יכולות של SPARQL. באופן כלשהו, ואז אכפת לנו מכמות מסוימת של כמה תוצאות ראשונות בלבד (אלו עם הדירוג הטוב ביותר). מדורגותעד עכשיו, נתקלנו בשאילתות שבהן היינו מעוניינים בכל התוצאות. בקשה יחסית נפוצה היא שרק חלק מהתוצאות נחוצות: בדרך כלל לקיצון מסוים - הוותיקות ביותר, הצעירות ביותר, הקדומות ביותר, העדכניות ביותר, עם כמות האוכלוסיה הגדולה ביותר, נקודת ההתכה הנמוכה ביותר, הכי הרבה ילדים, הכי הרבה חומרים לייצור וכן הלאה. הגורם המשותף כאן הוא שהתוצאות . LIMIT ו־ORDER BY‎ (אחרי הסוגריים, לא בתוכם!): WHERE {}השליטה הזאת מתאפשרת באמצעות שתי פסוקיות שמצטרפות למקטע כפי שהוא.) משהו שקול לחלוטין לביטוי ‪ASC(משהו)‬ending - עולה או יורד בהתאמה). (כשלא מציינים אף אחד מהם, ברירת המחדל היא סדר עולה, לכן descending או asc‎ כדי לציין את כיוון הסידור (DESC()‎ או ב־ASC()‎), אך בהמשך נראה סוגים אחרים. אפשר לעטוף את הביטוי הזה ב־?something יכול להיות כל ביטוי שהוא – לבינתיים, הביטוי היחידי שאנחנו מכירים הם משתנים פשוטים (‎משהו. משהו מסדר את התוצאות לפי ‪ORDER BY משהו‬ מחזיר תוצאה אחת בלבד. LIMIT 1 מגביל את השאילתה ל־10 תוצאות. LIMIT 10 הוא כל מספר טבעי שהוא. למשל, כמות תוצאות, כאשר כמות חותכת את רשימת התוצאות ל‪LIMIT כמות‬ יכולה להאיץ את השאילתה משמעותית, מאחר ש־WDQS יכול לעצור את החיפוש ברגע שנמצאו מספיק תוצאות למלא את הכמות.) LIMIT אבל לא אכפת לך איזה בדיוק. בכל מקרה, הוספת כלשהן. במקרה שכזה, התוצאות לא תסודרנה כך שאין שום ערובה לתוצאות שתתקבלנה. שזה בסדר אם במקרה ברור לך שיש כמות מסוימת של תוצאות, או שפשוט מעניין אותך להציג תוצאות ORDER BY בלי LIMIT(אפשר גם להשתמש ב־. LIMIT ו־ORDER BY.) אפשר להתחיל על ידי חיפוש אחר מדינות עם האוכלוסיה שלהן, ואז להוסיף את הפסוקיות P:P1082, ומאפיין האוכלוסיה הוא (Q3624078)sovereign state זמן לתרגל! נא לנסות לכתוב שאילתה שמחזירה את עשר המדינות המאוכלסות ביותר. (מדינה זה הינה הפתרון שלי: ORDER and LIMIT We return to our regular scheduled program of more SPARQL features. in some way, and then we care about the first few results (those with the best rank). rankedSo far, we’ve only had queries where we were interested in all results. But it’s quite common to care only about a few results: those that are most extreme in some way – oldest, youngest, earliest, latest, highest population, lowest melting point, most children, most materials used, and so on. The common factor here is that the results are . LIMIT and ORDER BY block (after the braces, not inside!): WHERE {}This is controlled by two clauses, which are appended to the .) something is equivalent to just ASC(something)ending). (If you don’t specify either, the default is ascending sort, so descending or asc to specify the sorting order (DESC() or ASC()), but we’ll see some other kinds later. This expression can also be wrapped in either ?something can be any expression – for now, the only kind of expression we know are simple variables (something. something sorts the results by ORDER BY something only returns a single result. LIMIT 1 limits the query to ten results. LIMIT 10 is any natural number. For example, count results, where count cuts off the result list at LIMIT count can significantly speed up the query, since WDQS can stop searching for results as soon as it’s found enough to fill the limit.) LIMIT result, but don’t care about which one. In either case, adding the some. In this case, the results aren’t sorted, so you don’t have any guarantee which results you’ll get. Which is fine if you happen to know that there’s only a certain number of results, or you’re just interested in ORDER BY without LIMIT(You can also use clauses. LIMIT and ORDER BY.) You can start by searching for countries with their population, and then add the P:P1082, and the property for population is (Q3624078)sovereign state Exercise time! Try to write a query that returns the ten most populous countries. (A country is a Here’s my solution: ORDERとLIMITさて、SPARQLの機能の紹介にもどります。 これまで私達はマッチするすべての結果を取得するクエリを学んできました。ですが、数件だけとってきたいというシチュエーションはよくあるはずです。典型的には、一番突出している値をとってくるケース、例えば最も古い、最も若い、最も早い、最も新しい、最も人口が多い、最も低い融点、最も子供の人数が多い、最もよく使われた物質、などです。これらの共通項は結果が何らかの値で「順位付け」されているということです。したがって私達は一番最初の結果 (順位付けで一番になるような結果) だけ考えたいということです。 です。 LIMITとORDER BYの中括弧の後に書く2つの節によって達成されます。それがWHERE {}これはと一緒です。) somethingはASC(something)ending に対応します)。 (もしどちらも指定しなかった場合、デフォルトでは昇順にソートされます。つまり、descending と降順 ascで囲むことができます (それぞれ、昇順 DESC()やASC()) だけですが、あとで他の式も見ることにします。この式はソートの順序を指定するために?somethingは任意の式です。今の所、私達が知っているのは単なる変数 (somethingによって結果を並び替えます。somethingは、ORDER BY somethingは一つの結果を返すようにします。 LIMIT 1は結果を10件に制限し、LIMIT 10には任意の自然数を指定することができます。例えば、count件に制限します。countは結果のリストをLIMIT countはクエリの処理時間を大きく縮めます。それは、指定された件数の結果をWDQSが見つけると、検索を止めても良くなるからです。) LIMITを使うこともできます。この場合、結果は並び替えされていないので、マッチする結果の内どのような結果がヒットするかは保証されません。これはあなたがマッチする件数の上限を知っている場合や、個々の結果には興味がなくマッチする中で一部の結果にだけ興味がある場合には気にならないものでしょう。どちらのケースでも、LIMITをつけずにORDER BY(句を追加できます。 LIMIT句とORDER BYです。)人口のある国を検索することから始めて、P:P1082で、人口のプロパティは(Q3624078)sovereign state エクササイズの時間です!最も人口の多い10の国を返すクエリを作成してみてください。(国は私の解答はこうです。 ORDER and LIMIT We return to our regular scheduled program of more SPARQL features. in some way, and then we care about the first few results (those with the best rank). rankedSo far, we’ve only had queries where we were interested in all results. But it’s quite common to care only about a few results: those that are most extreme in some way – oldest, youngest, earliest, latest, highest population, lowest melting point, most children, most materials used, and so on. The common factor here is that the results are . LIMIT and ORDER BY block (after the braces, not inside!): WHERE {}This is controlled by two clauses, which are appended to the .) something is equivalent to just ASC(something)ending). (If you don’t specify either, the default is ascending sort, so descending or asc to specify the sorting order (DESC() or ASC()), but we’ll see some other kinds later. This expression can also be wrapped in either ?something can be any expression – for now, the only kind of expression we know are simple variables (something. something sorts the results by ORDER BY something only returns a single result. LIMIT 1 limits the query to ten results. LIMIT 10 is any natural number. For example, count results, where count cuts off the result list at LIMIT count can significantly speed up the query, since WDQS can stop searching for results as soon as it’s found enough to fill the limit.) LIMIT result, but don’t care about which one. In either case, adding the some. In this case, the results aren’t sorted, so you don’t have any guarantee which results you’ll get. Which is fine if you happen to know that there’s only a certain number of results, or you’re just interested in ORDER BY without LIMIT(You can also use clauses. LIMIT and ORDER BY.) You can start by searching for countries with their population, and then add the P:P1082, and the property for population is (Q3624078)sovereign state Exercise time! Try to write a query that returns the ten most populous countries. (A country is a Hei ass meng Léisung: ORDER en LIMITWe gaan terug naar ons reguliere programma met meer SPARQL-functies. Tot nu toe hebben we alleen queries gedaan waar we geïnteresseerd waren in alle resultaten. Maar het is heel gebruikelijk om alleen maar om een paar resultaten te willen zoeken: die die op een of andere manier het meest extreme zijn - oudste, jongste, vroegste, nieuwste, hoogste bevolking, laagste smeltpunt, de meeste kinderen, de meeste gebruikte materialen, enzovoort. De gemeenschappelijke factor hier is dat de resultaten op een of andere manier "rangschikt" zijn, en dan geven we om de eerste resultaten (de resultaten met de beste rang). . LIMIT en ORDER BY (na de accolades, niet binnen!) worden gehecht: WHERE {}Dit wordt gecontroleerd door twee clausules, die aan de om de sorteervolgorde ("'ascending" of "desc"'ending) te specificeren. Als u het niet aangeeft dan is het ascending, dus oplopend. DESC() of ASC()) dat we nu kennen zijn eenvoudige variabelen, maar we zullen later andere soorten zien. Deze expressie kan ook worden omwikkelt met iets. Het enige soort expressie (ORDER BY ietsDe resultaten worden volgens op iets gesorteerd met geeft dus maar maximaal één regel in het resultaat. LIMIT 1 zorgt ervoor dat de query maximaal 10 regels teruggeeft. LIMIT 10 gewoon een getal is. Voorbeeld: count resultaten, waar count kapt het aantal vondsten in het resultaat af op LIMIT count de zoekopdracht aanzienlijk versnellen, omdat WDQS het zoeken kan stoppen zodra er genoeg gevonden zijn volgens de limiet.) LIMIT. In dit geval worden de resultaten niet gesorteerd, dus u heeft geen garantie welke resultaten u krijgt. Wat goed is als u weet dat er slechts een bepaald aantal resultaten zijn, of u gewoon geïnteresseerd bent in "sommige" resultaten, maar het u niet uitmaakt, welke dat zijn. In beide gevallen kan het toevoegen van de ORDER BYgebruiken zonder LIMIT(U kunt ook clausules toevoegen. LIMIT en ORDER BY. U kunt beginnen met het zoeken naar landen met een bevolking en vervolgens de P:P1082, en de eigenschap voor bevolking is (Q3624078)sovereign state Tijd om te oefenen! Probeer een query te schrijven die de tien meest bevolkte landen teruggeeft. Een land is een Dit is mijn oplossing: ORDER and LIMIT We return to our regular scheduled program of more SPARQL features. in some way, and then we care about the first few results (those with the best rank). rankedSo far, we’ve only had queries where we were interested in all results. But it’s quite common to care only about a few results: those that are most extreme in some way – oldest, youngest, earliest, latest, highest population, lowest melting point, most children, most materials used, and so on. The common factor here is that the results are . LIMIT and ORDER BY block (after the braces, not inside!): WHERE {}This is controlled by two clauses, which are appended to the .) something is equivalent to just ASC(something)ending). (If you don’t specify either, the default is ascending sort, so descending or asc to specify the sorting order (DESC() or ASC()), but we’ll see some other kinds later. This expression can also be wrapped in either ?something can be any expression – for now, the only kind of expression we know are simple variables (something. something sorts the results by ORDER BY something only returns a single result. LIMIT 1 limits the query to ten results. LIMIT 10 is any natural number. For example, count results, where count cuts off the result list at LIMIT count can significantly speed up the query, since WDQS can stop searching for results as soon as it’s found enough to fill the limit.) LIMIT result, but don’t care about which one. In either case, adding the some. In this case, the results aren’t sorted, so you don’t have any guarantee which results you’ll get. Which is fine if you happen to know that there’s only a certain number of results, or you’re just interested in ORDER BY without LIMIT(You can also use clauses. LIMIT and ORDER BY.) You can start by searching for countries with their population, and then add the P:P1082, and the property for population is (Q3624078)sovereign state Exercise time! Try to write a query that returns the ten most populous countries. (A country is a Here’s my solution: ORDER and LIMIT We return to our regular scheduled program of more SPARQL features. in some way, and then we care about the first few results (those with the best rank). rankedSo far, we’ve only had queries where we were interested in all results. But it’s quite common to care only about a few results: those that are most extreme in some way – oldest, youngest, earliest, latest, highest population, lowest melting point, most children, most materials used, and so on. The common factor here is that the results are . LIMIT and ORDER BY block (after the braces, not inside!): WHERE {}This is controlled by two clauses, which are appended to the .) something is equivalent to just ASC(something)ending). (If you don’t specify either, the default is ascending sort, so descending or asc to specify the sorting order (DESC() or ASC()), but we’ll see some other kinds later. This expression can also be wrapped in either ?something can be any expression – for now, the only kind of expression we know are simple variables (something. something sorts the results by ORDER BY something only returns a single result. LIMIT 1 limits the query to ten results. LIMIT 10 is any natural number. For example, count results, where count cuts off the result list at LIMIT count can significantly speed up the query, since WDQS can stop searching for results as soon as it’s found enough to fill the limit.) LIMIT result, but don’t care about which one. In either case, adding the some. In this case, the results aren’t sorted, so you don’t have any guarantee which results you’ll get. Which is fine if you happen to know that there’s only a certain number of results, or you’re just interested in ORDER BY without LIMIT(You can also use clauses. LIMIT and ORDER BY.) You can start by searching for countries with their population, and then add the P:P1082, and the property for population is (Q3624078)sovereign state Exercise time! Try to write a query that returns the ten most populous countries. (A country is a Here’s my solution: ORDER and LIMIT We return to our regular scheduled program of more SPARQL features. in some way, and then we care about the first few results (those with the best rank). rankedSo far, we’ve only had queries where we were interested in all results. But it’s quite common to care only about a few results: those that are most extreme in some way – oldest, youngest, earliest, latest, highest population, lowest melting point, most children, most materials used, and so on. The common factor here is that the results are . LIMIT and ORDER BY block (after the braces, not inside!): WHERE {}This is controlled by two clauses, which are appended to the .) something is equivalent to just ASC(something)ending). (If you don’t specify either, the default is ascending sort, so descending or asc to specify the sorting order (DESC() or ASC()), but we’ll see some other kinds later. This expression can also be wrapped in either ?something can be any expression – for now, the only kind of expression we know are simple variables (something. something sorts the results by ORDER BY something only returns a single result. LIMIT 1 limits the query to ten results. LIMIT 10 is any natural number. For example, count results, where count cuts off the result list at LIMIT count can significantly speed up the query, since WDQS can stop searching for results as soon as it’s found enough to fill the limit.) LIMIT result, but don’t care about which one. In either case, adding the some. In this case, the results aren’t sorted, so you don’t have any guarantee which results you’ll get. Which is fine if you happen to know that there’s only a certain number of results, or you’re just interested in ORDER BY without LIMIT(You can also use clauses. LIMIT and ORDER BY.) You can start by searching for countries with their population, and then add the P:P1082, and the property for population is (Q3624078)sovereign state Exercise time! Try to write a query that returns the ten most populous countries. (A country is a Here’s my solution: ORDER and LIMIT We return to our regular scheduled program of more SPARQL features. in some way, and then we care about the first few results (those with the best rank). rankedSo far, we’ve only had queries where we were interested in all results. But it’s quite common to care only about a few results: those that are most extreme in some way – oldest, youngest, earliest, latest, highest population, lowest melting point, most children, most materials used, and so on. The common factor here is that the results are . LIMIT and ORDER BY block (after the braces, not inside!): WHERE {}This is controlled by two clauses, which are appended to the .) something is equivalent to just ASC(something)ending). (If you don’t specify either, the default is ascending sort, so descending or asc to specify the sorting order (DESC() or ASC()), but we’ll see some other kinds later. This expression can also be wrapped in either ?something can be any expression – for now, the only kind of expression we know are simple variables (something. something sorts the results by ORDER BY something only returns a single result. LIMIT 1 limits the query to ten results. LIMIT 10 is any natural number. For example, count results, where count cuts off the result list at LIMIT count can significantly speed up the query, since WDQS can stop searching for results as soon as it’s found enough to fill the limit.) LIMIT result, but don’t care about which one. In either case, adding the some. In this case, the results aren’t sorted, so you don’t have any guarantee which results you’ll get. Which is fine if you happen to know that there’s only a certain number of results, or you’re just interested in ORDER BY without LIMIT(You can also use clauses. LIMIT and ORDER BY.) You can start by searching for countries with their population, and then add the P:P1082, and the property for population is (Q3624078)sovereign state Exercise time! Try to write a query that returns the ten most populous countries. (A country is a Here’s my solution: ORDER і LIMIT We return to our regular scheduled program of more SPARQL features. in some way, and then we care about the first few results (those with the best rank). rankedSo far, we’ve only had queries where we were interested in all results. But it’s quite common to care only about a few results: those that are most extreme in some way – oldest, youngest, earliest, latest, highest population, lowest melting point, most children, most materials used, and so on. The common factor here is that the results are . LIMIT and ORDER BY block (after the braces, not inside!): WHERE {}This is controlled by two clauses, which are appended to the .) something is equivalent to just ASC(something)ending). (If you don’t specify either, the default is ascending sort, so descending or asc to specify the sorting order (DESC() or ASC()), but we’ll see some other kinds later. This expression can also be wrapped in either ?something can be any expression – for now, the only kind of expression we know are simple variables (something. something sorts the results by ORDER BY something only returns a single result. LIMIT 1 limits the query to ten results. LIMIT 10 is any natural number. For example, count results, where count cuts off the result list at LIMIT count can significantly speed up the query, since WDQS can stop searching for results as soon as it’s found enough to fill the limit.) LIMIT result, but don’t care about which one. In either case, adding the some. In this case, the results aren’t sorted, so you don’t have any guarantee which results you’ll get. Which is fine if you happen to know that there’s only a certain number of results, or you’re just interested in ORDER BY without LIMIT(You can also use clauses. LIMIT and ORDER BY.) You can start by searching for countries with their population, and then add the P:P1082, and the property for population is (Q3624078)sovereign state Exercise time! Try to write a query that returns the ten most populous countries. (A country is a Here’s my solution: 顺序(ORDER)和限制(LIMIT) We return to our regular scheduled program of more SPARQL features. in some way, and then we care about the first few results (those with the best rank). rankedSo far, we’ve only had queries where we were interested in all results. But it’s quite common to care only about a few results: those that are most extreme in some way – oldest, youngest, earliest, latest, highest population, lowest melting point, most children, most materials used, and so on. The common factor here is that the results are . LIMIT and ORDER BY block (after the braces, not inside!): WHERE {}This is controlled by two clauses, which are appended to the .) something is equivalent to just ASC(something)ending). (If you don’t specify either, the default is ascending sort, so descending or asc to specify the sorting order (DESC() or ASC()), but we’ll see some other kinds later. This expression can also be wrapped in either ?something can be any expression – for now, the only kind of expression we know are simple variables (something. something sorts the results by ORDER BY something only returns a single result. LIMIT 1 limits the query to ten results. LIMIT 10 is any natural number. For example, count results, where count cuts off the result list at LIMIT count can significantly speed up the query, since WDQS can stop searching for results as soon as it’s found enough to fill the limit.) LIMIT result, but don’t care about which one. In either case, adding the some. In this case, the results aren’t sorted, so you don’t have any guarantee which results you’ll get. Which is fine if you happen to know that there’s only a certain number of results, or you’re just interested in ORDER BY without LIMIT(You can also use clauses. LIMIT and ORDER BY.) You can start by searching for countries with their population, and then add the P:P1082, and the property for population is (Q3624078)sovereign state Exercise time! Try to write a query that returns the ten most populous countries. (A country is a Here’s my solution:

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?country ?countryLabel ?population
WHERE
{
  ?country wdt:P31/wdt:P279* wd:Q3624078;
           wdt:P1082 ?population.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY DESC(?population)
LIMIT 10

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?country"):::projected v1("?population"):::projected a1((" ")) c3(["wd:Q3624078"]):::iri c6(["bd:serviceParam"]):::iri c8(["en"]):::literal v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c3 v2 --"wdt:P1082"--> v1 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end