Shortcut: wd:WDQS/Result views

ויקינתונים:שירות תשאול SPARQL/עזרה בשאילתות ויקינתונים/תצוגות תוצאות

From Wikidata
Jump to navigation Jump to search
This page is a translated version of the page Wikidata:SPARQL query service/Wikidata Query Help/Result Views and the translation is 84% complete.
Outdated translations are marked like this.
כפתור תצוגה

הדף הזה יסייע לך להבין את מגוון האפשרויות להצגת תוצאות בשירות התשאול ב־SPARQL. דף התשאול לדוגמה מכיל המון דוגמאות טובות שאפשר לנסות!

לאחר הרצת שאילתה, אפשר לבחור באמצעות כפתור ה„תצוגה” איזו תצוגת תוצאות תופיע. בהתאם לשאילתה שלך ולסוג הנתונים, חלק מהתצוגות תהיינה זמינות.

טבלה (ברירת מחדל)

מציג את התוצאות כטבלה. זאת תצוגת ברירת המחדל לתוצאות והיא יכולה להציג כל סוג של נתונים.

תמפה כל משתנה מפסוקית הבחירה (select) של SPARQL לעמודה מסודרת בטבלה.

רשת תמונות

רשת תמונות התנסות

מציג את נתוני התוצאות כרשת עם תמונות.

לכל פריט ברשת יש תמונה גדולה והגלריה נפתחת בלחיצה עליו.

תוכן של פריט הוא נתוני שורה מסודרים

משתנה סוג נתונים מיפוי תיאור
* מדיה של ויקישיתוף פריט ברשת עמודות תונות תיצורנה פריט ברשת.

שורות שלא מכילות תמונות לא תופענה.

אפשר, למרות זאת, לכלול שורות ללא תמונות בתוצאות על ידי שינוי ה־SPARQL כך שיכלול תמונת ברירת מחדל אם משתנה התמונה לא תחום:

  optional {
    ?item wdt:P18 ?img_ .
  }
  bind (if(bound(?img_), 
           ?img_, 
           <http://commons.wikimedia.org/wiki/Special:FilePath/File:Profile_avatar_placeholder_large.png>) as ?image) # [[:commons:File:Profile_avatar_placeholder_large.png]] as a placeholder

כאן הקובץ commons:File:Profile avatar placeholder large.png משמש כממלא מקום, אפשר להשתמש גם במשהו משלך

דוגמה לשאילתה שלמה שמשתמשת בטכניקה הזאת.

אפשרויות

שם האפשרות סוג תיאור
hide שם משתנה אחד או יותר (מחרוזות, שמתחילות ב־ ?), ערך בודד או מערך לא להציג את המשתנים האלה בתוצאה.

מפה

מציג את התוצאות כמפה עם הנתונים של Open Street Map.

משתנה סוג נתונים מיפוי תיאור
* נקודת ציון או צורה גאוגרפית סמן במפה עמודות תיצורנה סמן על המפה.

תוכן הסמן הוא נתוני השורה המסודרים.

?layer שכבת סמני מפה יוצר שכבת מפה צבעונית שמאפשרת סינון.
?rgb צבע סמן מפת צבעים למשל 000000 לצבע השחור.


Technically, any well-known text literal can be displayed, not just a point coordinate.

Non-point geometry values are never stored on Wikidata, but they can be constructed in SPARQL using functions like CONCAT() and STRDT() – see this map of Czech railway lines for an example of LINESTRING() geometry.

אפשרויות

specify using e.g. #defaultView:Map{"hide":["?foo", "?bar"],"layer":"?bar"}, using an array when there are multiple variables.

שם האפשרות סוג תיאור
hide One or more variable names (strings, starting with ?), single value or array לא להציג את המשתנים האלו בתוצאה.
layer One or more variable names (strings, starting with ?), single value or array Use these variables for the map layer, instead of the default ?layerLabel, ?layer.
markercluster בוליאני או עצם
  • If the value is an object, pass these options to Leaflet.markercluster, a map plugin for clustering nearby map markers. (If the value is the empty object {}, Leaflet.markercluster is enabled with its default options.)
  • If the value is true (default for queries without map layers), Leaflet.markercluster is enabled with a special set of options that doesn’t cluster any nearby map markers (it only “spiderfies” markers with exactly identical coordinates) and attempts to replicate the default map look as much as possible.
  • If the value is false (default for queries with map layers), Leaflet.markercluster is not enabled.

Line, Bar, Scatter and Area Chart

מציג את אחד מסוגי התרשימים האלה.

משתנה סוג נתונים מיפוי תיאור
* מספר

תווית

תאריך ושעה

ציר X

ציר Y

הראשון יהיה ציר X, השני ציר Y
* תווית פריט בקטגוריה / מקרא (רשות) ישמש רק לאחר שאלו שלעיל מופו
* תווית Storyboard / Animation (optional) ישמש רק לאחר שאלו שלעיל מופו


תרשים בועות

תרשים בועות התנסות

מציג תרשים בועות בו הגודל והצבע של הבועה נתון להגדרה.

כאשר מסופק פריט בועה מקושרת ל־Wikidata.org.

משתנה סוג נתונים מיפוי
* תווית תווית בועה
* מספר גודל בועה
* פריט קישור בועה (רשות)
?rgb צבע צבע בועה (רשות)

מפת עץ

מפת עץ התנסות

מציג מפת עץ עם אפשרות תקריב.

משתנה סוג נתונים מיפוי תיאור
* תווית תווית תווית ראשונה בשורה תהיה הרמה הראשונה במפת העץ.

התווית השנייה תהיה הרמה השנייה.

התווית השלישית תהיה הרמה השלישית וכו׳.

* פריט קישור (רשות)
* כמות גודל

עץ

מציג עץ מתרחב.

עץ התנסות
משתנה סוג נתונים מיפוי תיאור
* פריט מזהה מפרק הפריט הראשון יהיה מפרק השורש שהפריטים הבאים מאותה השורה יחוברו תחתיו.
* תווית תווית המפרק (רשות) תתווספנה תוויות למפרק הנוכחי.
* מספר תווית המפרק (רשות)
* מדיה של ויקישיתוף תמונת פריט

ציר זמן

ציר זמן התנסות

מציג ציר זמן שניתן לחקור.

משתנה סוג נתונים מיפוי תיאור
* תאריך ושעה פריט נקודה בזמן

פריט סיום נקודה בזמן

תאריך ראשון בשורה מגדיר את מיקום הפריט בציר הזמן.

אם קיים תאריך שני יוגדרו תאריכי התחלה וסיום.

* מדיה של ויקישיתוף תמונת פריט

אפשרויות

שם האפשרות סוג תיאור
hide שם של משתנה אחד או יותר (מחרוזות, מתחילות ב־?), ערך או מערך בודד לא להציג את המשתנים האלה בתוצאה.

ממדים

ממדים התנסות

הצגת ממדים ואת הקישורים שלהם.

מאפשר גם לסנן אותם על ידי בחירת חלק מציר.

סוג התרשים הזה ידוע בתור parallel coordinates.

משתנה סוג נתונים מיפוי תיאור
* תווית ממד כל עמודה בשורת התוצאה ממופה לממד
* מספר
* תאריך ושעה


תרשים

תרשים לחקר אברהם לינקולן התנסות

הצגת תרשים אינטראקטיבי שמציג סדר היררכי ופריטים לחקירה.

משתנה סוג נתונים מיפוי תיאור
* פריט מזהה מפרק לפריט הראשון בשורה יהיה חץ שמצביע על הפריטים באותה השורה
* תווית תווית המפרק (רשות)
* מדיה של ויקישיתוף תווית המפרק (רשות)
?rgb צבע צבע המפרק (רשות) למשל 000000 לצבע שחור.
* מספר גודל המפרק (רשות)
?edgeLabel תווית תווית הקצה (רשות)
תרשים התנסות


מידע נוסף

מיפוי סוג נתוני RDF

סוג RDF סוג נתוני RDF אילוץ סוג נתונים
URI המחרוזת מתחילה ב־
http://www.wikidata.org/entity/Q
Entity
URI המחרוזת מתחילה ב־
http://commons.wikimedia.org/wiki/Special:FilePath
מדיה בוויקישיתוף
Literal http://www.w3.org/2001/XMLSchema#dateTime DateTime
Literal http://www.opengis.net/ont/geosparql#wktLiteral Coordinate
Literal http://www.w3.org/2001/XMLSchema#double

http://www.w3.org/2001/XMLSchema#float

http://www.w3.org/2001/XMLSchema#decimal

http://www.w3.org/2001/XMLSchema#integer

http://www.w3.org/2001/XMLSchema#long

http://www.w3.org/2001/XMLSchema#int

http://www.w3.org/2001/XMLSchema#short

http://www.w3.org/2001/XMLSchema#nonNegativeInteger

http://www.w3.org/2001/XMLSchema#positiveInteger

http://www.w3.org/2001/XMLSchema#unsignedLong

http://www.w3.org/2001/XMLSchema#unsignedInt

http://www.w3.org/2001/XMLSchema#unsignedShort

http://www.w3.org/2001/XMLSchema#nonPositiveInteger

http://www.w3.org/2001/XMLSchema#negativeInteger

מספר
Literal אין סוג נתוני RDF תווית
Literal יש מאפיין
xml:lang
תווית
Literal המחרוזת תואמת ל־
/^[0-9A-F]{6}$/
צבע

עיצוב

יש עיצוב מיוחד לסוגי הנתונים הבאים:

סוג נתונים עיצוב
Entity קישור ל־Wikidata.org

התווית מוקצרת ל־wd:Qxx

חקירת פריט (סמל זכוכית מגדלת)

DateTime MM DD, YYYY

Tooltip shows raw ISO timestamp

Commons Media Link to Commons.Wikimedia.org

Displaying Gallery ( image icon )

Mobile / Responsive

Result views are made to work on different devices and resolutions. Their appearance may change depending on the space they can use.

Embed Mode

Result views can be linked or embedded via iframes. You can get the regarding link or code by clicking Link in the above menu.

See the difference: link to a query and link to a result or the embed code:

<iframe style="width:80vw; height:50vh;" scrolling="yes" frameborder="0" src="http://tinyurl.com/zwf4k2w">

Download results

Download results buttons

There are several ways to export the results of a query.

JSON, TSV and CSV are three different open-standard formats to download the data, offered under the Download tab. To get results in XML format, click on Link > SPARQL endpoint.

You can also download some of the graphic views as a SVG file: this feature works with all the views except table, image grid, timeline, graph builder, map, and graph.

Default View

The default view can be change for each SPARQL query by using a comment:

#defaultView:[NAME]

For example:

#defaultView:ImageGrid

Result view options

Result views can be configured with various options, which are specified in JSON (Q2063) format, either following the defaultView comment (see previous section) or following a separate view comment.

#defaultView:Map{"layer": "?typeLabel"}
#view:ImageGrid{"hide": "?coords"}

Title

Result views can show a title. The title can be set via a title comment.

#title:A title of your choice

Auto language

When using the magic keyword [AUTO_LANGUAGE] it is replaced by the users language when submitting the query. This allows writing a query with where the result is displayed in the users language.

Example:

#<span lang="en" dir="ltr" class="mw-content-ltr">Use language of the user for display labels and fallback to english as default</span>
SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
}


Auto coordinates

When using the magic keyword [AUTO_COORDINATES] it is replaced by the users location when submitting the query. This allows writing a query with the users' location.

Example:

  SERVICE wikibase:around {
    ?place wdt:P625 ?coordinate_location.
    bd:serviceParam wikibase:center "[AUTO_COORDINATES]".
    bd:serviceParam wikibase:radius "1".
    bd:serviceParam wikibase:distance ?dist.
  }