/
wikidata.txt
6381 lines (5472 loc) · 175 KB
/
wikidata.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
####
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 ?item ?itemLabel
WHERE
{
?item wdt:P31 wd:Q146 .
}
####
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#>
#added before 2016-10
#Illustrates optional fields, instances of subclasses, language fallback on label service, date to year conversion
# Chevaux sur Wikidata
SELECT DISTINCT ?cheval ?chevalLabel ?mere ?pere (year(?naissance) AS ?naissance_) (year(?deces) as ?Décès) ?sexeLabel
WHERE
{
?cheval wdt:P31/wdt:P279* wd:Q726 . # Instance et sous-classes de Q726-Cheval
OPTIONAL{?cheval wdt:P25 ?mere .} # P25 : Mère
OPTIONAL{?cheval wdt:P22 ?pere .} # P22 : Père
OPTIONAL{?cheval wdt:P569 ?naissance .} # P569 : Date de naissance
OPTIONAL{?cheval wdt:P570 ?deces .} # P570 : Date de décès
OPTIONAL{?cheval wdt:P21 ?sexe .} # P21 : Sexe
}
ORDER BY ?cheval
####
PREFIX schema: <http://schema.org/>
PREFIX https: <http://https>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#added before 2016-10
#illustrates sitelink selection, ";" notation
SELECT ?item ?itemLabel ?article
WHERE
{
?article schema:about ?item ;
schema:isPartOf <https://species.wikimedia.org/> .
}
LIMIT 200
####
PREFIX schema: <http://schema.org/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX https: <http://https>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?author ?authorLabel (COUNT(?paper) AS ?count)
WHERE
{
?article schema:about ?author ;
schema:isPartOf <https://species.wikimedia.org/> .
?author wdt:P31 wd:Q5.
?paper wdt:P50 ?author.
}
GROUP BY ?author ?authorLabel
ORDER BY DESC(?count)
LIMIT 200
####
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?event ?eventLabel ?date
WHERE
{
# find events
?event wdt:P31/wdt:P279* wd:Q1190554.
# with a point in time or start date
OPTIONAL { ?event wdt:P585 ?date. }
OPTIONAL { ?event wdt:P580 ?date. }
# but at least one of those
FILTER(BOUND(?date) && DATATYPE(?date) = xsd:dateTime).
# not in the future, and not more than 31 days ago
BIND(NOW() - ?date AS ?distance).
FILTER(0 <= ?distance && ?distance < 31).
# and get a label as well
OPTIONAL {
?event rdfs:label ?eventLabel.
FILTER(LANG(?eventLabel) = "en").
}
}
# limit to 10 results so we don't timeout
LIMIT 10
####
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX defaultView: <http://defaultView>
PREFIX bd: <http://www.bigdata.com/rdf#>
#added before 2016-10
#illustrates bubblechart view, count
#defaultView:BubbleChart
SELECT ?eyeColorLabel (COUNT(?person) AS ?count)
WHERE
{
?person wdt:P1340 ?eyeColor.
}
GROUP BY ?eyeColorLabel
####
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX defaultView: <http://defaultView>
PREFIX bd: <http://www.bigdata.com/rdf#>
#added before 2016-10
#defaultView:ImageGrid
SELECT ?item ?itemLabel ?pic
WHERE
{
?item ?prop wd:Q146 .
OPTIONAL {
?item wdt:P18 ?pic
}
}
####
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#added before 2016-10
#Demonstrates "unknown value" handling
SELECT ?human ?humanLabel
WHERE
{
?human wdt:P21 ?gender
FILTER isBLANK(?gender) .
}
####
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX wdno: <http://www.wikidata.org/prop/novalue/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#added before 2016-10
#Demonstrates "no value" handling
SELECT ?human ?humanLabel
WHERE
{
?human wdt:P31 wd:Q5 . #find humans
?human rdf:type wdno:P40 . #with at least one P40 (child) statement defined to be "no value"
}
####
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX wdno: <http://www.wikidata.org/prop/novalue/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?human ?humanLabel {
?human wdt:P31 wd:Q5 . #find humans
?human p:P40 ?childStatement . #with at least one P40 (child) statement
?childStatement a wdno:P40 . #where the P40 (child) statement is defined to be "no value"
}
####
PREFIX mayor: <http://mayor>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#added before 2016-10
#TEMPLATE={"template":"Largest ?c with ?sex head of government","variables":{"?sex":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q48264 . } "},"?c":{"query":"SELECT DISTINCT ?id WHERE { ?c wdt:P31 ?id. ?c p:P6 ?mayor. }"} } }
SELECT DISTINCT ?city ?cityLabel ?mayor ?mayorLabel
WHERE
{
BIND(wd:Q6581072 AS ?sex)
BIND(wd:Q515 AS ?c)
?city wdt:P31/wdt:P279* ?c . # find instances of subclasses of city
?city p:P6 ?statement . # with a P6 (head of goverment) statement
?statement ps:P6 ?mayor . # ... that has the value ?mayor
?mayor wdt:P21 ?sex . # ... where the ?mayor has P21 (sex or gender) female
FILTER NOT EXISTS { ?statement pq:P582 ?x } # ... but the statement has no P582 (end date) qualifier
# Now select the population value of the ?city
# (wdt: properties use only statements of "preferred" rank if any, usually meaning "current population")
?city wdt:P1082 ?population .
# Optionally, find English labels for city and mayor:
}
ORDER BY DESC(?population)
LIMIT 10
####
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX fallback: <http://fallback>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#added before 2016-10
SELECT ?country ?countryLabel (count(*) AS ?count)
WHERE
{
?city wdt:P31/wdt:P279* wd:Q515 . # find instances of subclasses of city
?city p:P6 ?statement . # with a P6 (head of goverment) statement
?statement ps:P6 ?mayor . # ... that has the value ?mayor
?mayor wdt:P21 wd:Q6581072 . # ... where the ?mayor has P21 (sex or gender) female
FILTER NOT EXISTS { ?statement pq:P582 ?x } # ... but the statement has no P582 (end date) qualifier
?city wdt:P17 ?country . # Also find the country of the city
# If available, get the "ru" label of the country, use "en" as fallback:
}
GROUP BY ?country ?countryLabel
ORDER BY DESC(?count)
LIMIT 100
####
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX defaultView: <http://defaultView>
PREFIX bd: <http://www.bigdata.com/rdf#>
#added before 2016-10
#defaultView:BubbleChart
SELECT ?surname ?surnameLabel ?count
WHERE
{
{
SELECT ?surname (COUNT(?person) AS ?count) WHERE {
?person wdt:P31 wd:Q5.
?person wdt:P734 ?surname.
}
GROUP BY ?surname
}
}
ORDER BY DESC(?count)
LIMIT 100
####
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
#added before 2016-10
SELECT ?name (COUNT(?otherName) AS ?count)
WHERE
{
?name wdt:P31 wd:Q202444;
wdt:P460 ?otherName.
}
GROUP BY ?name
ORDER BY DESC(?count)
LIMIT 10
####
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX defaultView: <http://defaultView>
PREFIX bd: <http://www.bigdata.com/rdf#>
#added before 2016-10
#defaultView:BubbleChart
SELECT ?surname ?surnameLabel ?count
WHERE
{
{
SELECT ?surname (COUNT(?person) AS ?count) WHERE {
?person (wdt:P31/wdt:P279*) wd:Q95074.
?person wdt:P734 ?surname.
}
GROUP BY ?surname
}
}
ORDER BY DESC(?count)
LIMIT 100
####
PREFIX schema: <http://schema.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
#added before 2016-10
SELECT ?s ?desc (COUNT(DISTINCT ?sitelink) as ?linkcount)
WHERE
{
?s wdt:P31 wd:Q5 .
?s wdt:P21 wd:Q6581072 .
?s wdt:P569 ?born .
FILTER (?born >= "1921-01-01T00:00:00Z"^^xsd:dateTime) .
?sitelink schema:about ?s .
OPTIONAL {
?s wdt:P18 ?dummy
}
FILTER ( !bound(?dummy) ) .
OPTIONAL {
?s rdfs:label ?desc filter (lang(?desc) = "en").
}
}
GROUP BY ?s ?desc
ORDER BY DESC(?linkcount)
LIMIT 50
####
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX defaultView: <http://defaultView>
PREFIX bd: <http://www.bigdata.com/rdf#>
#added before 2016-10
#defaultView:Map
SELECT ?place ?placeLabel ?location
WHERE
{
# Berlin coordinates
wd:Q64 wdt:P625 ?berlinLoc .
SERVICE wikibase:around {
?place wdt:P625 ?location .
bd:serviceParam wikibase:center ?berlinLoc .
bd:serviceParam wikibase:radius "100" .
}
# Is an airport
?place wdt:P31/wdt:P279* wd:Q1248784 .
}
####
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX defaultView: <http://defaultView>
#added before 2016-10
#List of airports in Belgium
#defaultView:Map
SELECT DISTINCT ?airport ?coor ?range
WHERE
{
?airport wdt:P31 wd:Q1248784 ;
?range wd:Q31;
wdt:P625 ?coor.
}
####
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX defaultView: <http://defaultView>
PREFIX bd: <http://www.bigdata.com/rdf#>
#added before 2016-10
# Schools between San Jose, CA and Sacramento, CA
#defaultView:Map
SELECT *
WHERE
{
wd:Q16553 wdt:P625 ?SJloc .
wd:Q18013 wdt:P625 ?SCloc .
SERVICE wikibase:box {
?place wdt:P625 ?location .
bd:serviceParam wikibase:cornerWest ?SJloc .
bd:serviceParam wikibase:cornerEast ?SCloc .
}
?place wdt:P31/wdt:P279* wd:Q3914 .
}
####
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Whose birthday is today?
SELECT ?entityLabel (YEAR(?date) as ?year)
WHERE
{
BIND(MONTH(NOW()) AS ?nowMonth)
BIND(DAY(NOW()) AS ?nowDay)
?entity wdt:P569 ?date .
FILTER (MONTH(?date) = ?nowMonth && DAY(?date) = ?nowDay)
}
LIMIT 10
####
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
#added before 2016-10
SELECT * WHERE {
?p wdt:P1080 wd:Q620588 .
?p rdfs:label ?pl .
FILTER (lang(?pl) = "en")
?p wdt:P25 ?m .
?m rdfs:label ?ml .
FILTER (lang(?ml) = "en")
}
####
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX entity: <http://entity>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX hint: <http://www.bigdata.com/queryHints#>
PREFIX http: <http://http>
#added before 2016-10
PREFIX entity: <http://www.wikidata.org/entity/>
#partial results
SELECT ?propUrl ?propLabel ?valUrl ?valLabel ?picture
WHERE
{
hint:Query hint:optimizer 'None' .
{ BIND(entity:Q42 AS ?valUrl) .
BIND("N/A" AS ?propUrl ) .
BIND("identity"@en AS ?propLabel ) .
}
UNION
{ entity:Q42 ?propUrl ?valUrl .
?property ?ref ?propUrl .
?property a wikibase:Property .
?property rdfs:label ?propLabel
}
?valUrl rdfs:label ?valLabel
FILTER (LANG(?valLabel) = 'en') .
OPTIONAL{ ?valUrl wdt:P18 ?picture .}
FILTER (lang(?propLabel) = 'en' )
}
ORDER BY ?propUrl ?valUrl
LIMIT 200
####
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX defaultView: <http://defaultView>
#added before 2016-10
#defaultView:BubbleChart
SELECT ?cid ?cause (count(*) as ?count)
WHERE
{
?pid wdt:P31 wd:Q5 .
?pid wdt:P509 ?cid .
OPTIONAL {
?cid rdfs:label ?cause
filter (lang(?cause) = "en")
}
}
GROUP BY ?cid ?cause
ORDER BY DESC(?count) ASC(?cause)
####
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX defaultView: <http://defaultView>
PREFIX bd: <http://www.bigdata.com/rdf#>
#added before 2016-10
#defaultView:BubbleChart
SELECT DISTINCT ?item ?itemLabel (?end - ?start AS ?duration)
WHERE
{
?item wdt:P361* wd:Q362 .
?item wdt:P31/wdt:P279* wd:Q178561 .
?item wdt:P580 ?start .
?item wdt:P582 ?end .
}
####
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX defaultView: <http://defaultView>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Timeline
SELECT ?item ?itemLabel ?launchdate (SAMPLE(?image) AS ?image_)
WHERE
{
?item wdt:P31 wd:Q26529 .
?item wdt:P619 ?launchdate .
OPTIONAL { ?item wdt:P18 ?image }
}
GROUP BY ?item ?itemLabel ?launchdate
####
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX defaultView: <http://defaultView>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Dimensions
SELECT ?elementLabel ?_boiling_point ?_melting_point ?_electronegativity ?_density ?_mass WHERE {
?element wdt:P31 wd:Q11344;
wdt:P2102 ?_boiling_point;
wdt:P2101 ?_melting_point;
wdt:P1108 ?_electronegativity;
wdt:P2054 ?_density;
wdt:P2067 ?_mass.
}
LIMIT 100
####
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX gas: <http://www.bigdata.com/rdf/gas#>
PREFIX http: <http://http>
PREFIX defaultView: <http://defaultView>
PREFIX bd: <http://www.bigdata.com/rdf#>
#added before 2016-10
#defaultView:Graph
PREFIX gas: <http://www.bigdata.com/rdf/gas#>
SELECT ?item ?itemLabel ?pic ?linkTo
WHERE
{
SERVICE gas:service {
gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.SSSP" ;
gas:in wd:Q720 ;
gas:traversalDirection "Forward" ;
gas:out ?item ;
gas:out1 ?depth ;
gas:maxIterations 4 ;
gas:linkType wdt:P40 .
}
OPTIONAL { ?item wdt:P40 ?linkTo }
OPTIONAL { ?item wdt:P18 ?pic }
}
####
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX defaultView: <http://defaultView>
PREFIX bd: <http://www.bigdata.com/rdf#>
#added before 2016-10
#defaultView:Graph
SELECT ?item ?itemLabel ?_image ?_subclass_of ?_subclass_ofLabel
WHERE
{
?item wdt:P31 wd:Q188451.
OPTIONAL { ?item wdt:P279 ?_subclass_of. }
OPTIONAL { ?item wdt:P18 ?_image. }
}
####
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX defaultView: <http://defaultView>
#defaultView:LineChart
SELECT (str(?year) AS ?year_) (AVG( ?_number_of_children ) AS ?count) WHERE {
?item wdt:P31 wd:Q5.
?item wdt:P1971 ?_number_of_children.
?item wdt:P569 ?_date_of_birth.
BIND( year(?_date_of_birth) as ?year ).
FILTER( ?year > 1900)
}
GROUP BY ?year
####
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX defaultView: <http://defaultView>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:LineChart
SELECT ?country ?year ?population ?countryLabel WHERE {
{
SELECT ?country ?year (AVG(?population) AS ?population_) WHERE {
{
SELECT ?country (str(YEAR(?date)) AS ?year) ?population WHERE {
?country wdt:P47 wd:Q183.
?country p:P1082 ?populationStatement.
?populationStatement ps:P1082 ?population.
?populationStatement pq:P585 ?date.
}
}
}
GROUP BY ?country ?year
}
}
####
PREFIX defaultView: <http://defaultView>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
#defaultView:LineChart
SELECT ?year (COUNT(?_genre) AS ?count ) (SAMPLE(?_genreLabel) AS ?_genreLabel_ ) WHERE {
?item wdt:P31 wd:Q571.
?item wdt:P577 ?_publication_date.
?item wdt:P136 ?_genre.
?_genre rdfs:label ?_genreLabel.
BIND(str(YEAR(?_publication_date)) AS ?year)
FILTER((LANG(?_genreLabel)) = "en")
FILTER (?_publication_date >= "2000-00-00T00:00:00Z"^^xsd:dateTime)
}
GROUP BY ?_genreLabel ?year
HAVING (?count > 10)
####
PREFIX defaultView: <http://defaultView>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
#defaultView:LineChart
SELECT ?year (COUNT(?_genre) AS ?count) (SAMPLE(?_genreLabel) AS ?_genreLabel_) WHERE {
?item wdt:P31 wd:Q215380.
?item wdt:P571 ?_date.
?item wdt:P136 ?_genre.
?_genre rdfs:label ?_genreLabel.
BIND(str(YEAR(?_date)) AS ?year)
FILTER((LANG(?_genreLabel)) = "en")
FILTER(?_date >= "1960-00-00T00:00:00Z"^^xsd:dateTime)
}
GROUP BY ?_genreLabel ?year
HAVING (?count > 10)
####
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX defaultView: <http://defaultView>
#defaultView:BarChart
SELECT(SAMPLE(?year) AS ?year_) (COUNT(?_country) AS ?battles) (SAMPLE(?_countryLabel) AS ?_countryLabel_) WHERE {
?subj wdt:P31 wd:Q178561.
OPTIONAL { ?subj wdt:P580 ?d1. }
OPTIONAL { ?subj wdt:P585 ?d2. }
OPTIONAL { ?subj wdt:P582 ?d3. }
BIND(IF(!BOUND(?d1), IF(!BOUND(?d2), ?d3, ?d2), ?d1) AS ?date)
BIND(str(YEAR(?date)) AS ?year)
?subj wdt:P276 ?_loc.
?_loc wdt:P17 ?_country.
?_country rdfs:label ?_countryLabel.
BIND((NOW()) - ?date AS ?distance)
FILTER(BOUND(?year))
FILTER((LANG(?_countryLabel)) = "en")
FILTER((0 <= ?distance) && (?distance < 31 * 12 * 80))
}
GROUP BY ?year ?_country
ORDER BY ?_countryLabel
####
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX defaultView: <http://defaultView>
#defaultView:BarChart
SELECT (SAMPLE(?_continentLabel) AS ?contient) (COUNT(?_country) AS ?battles) (SAMPLE(?_countryLabel) AS ?_countryLabel_) (SAMPLE(?year) AS ?year_) WHERE {
?subj wdt:P31 wd:Q178561.
OPTIONAL { ?subj wdt:P580 ?d1. }
OPTIONAL { ?subj wdt:P585 ?d2. }
OPTIONAL { ?subj wdt:P582 ?d3. }
BIND(IF(!BOUND(?d1), IF(!BOUND(?d2), ?d3, ?d2), ?d1) AS ?date)
BIND(str(YEAR(?date)) AS ?year)
?subj wdt:P276 ?_loc.
?_loc wdt:P17 ?_country.
?_country wdt:P30 ?_continent.
?_country rdfs:label ?_countryLabel.
?_continent rdfs:label ?_continentLabel.
BIND((NOW()) - ?date AS ?distance)
FILTER(BOUND(?year))
FILTER((LANG(?_countryLabel)) = "en")
FILTER((LANG(?_continentLabel)) = "en")
FILTER((0 <= ?distance) && (?distance < 31 * 12 * 80))
}
GROUP BY ?year ?_country
ORDER BY ?_countryLabel
####
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX defaultView: <http://defaultView>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:BarChart
SELECT ?year ?population ?objectLabel
WHERE
{
?object wdt:P31 wd:Q6256
; p:P1082 ?populationStatement .
?populationStatement ps:P1082 ?population
; pq:P585 ?date .
BIND(str(YEAR(?date)) AS ?year)
}
ORDER BY ?year ?country
####
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX defaultView: <http://defaultView>
#defaultView:BarChart
SELECT DISTINCT (SAMPLE(?year) AS ?year_) (COUNT(?_country) AS ?count) (SAMPLE(?_countryLabel) AS ?_countryLabel_) WHERE {
?object (wdt:P31/wdt:P279*) wd:Q134447.
BIND(str(YEAR(?_inception)) AS ?year)
?object wdt:P571 ?_inception.
?object wdt:P17 ?_country.
?_country rdfs:label ?_countryLabel.
FILTER((LANG(?_countryLabel)) = "en")
}
GROUP BY ?year ?_country
ORDER BY ?_countryLabel
####
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX defaultView: <http://defaultView>
#defaultView:AreaChart
SELECT ?cid (str(SAMPLE(?year)) AS ?year_ ) (COUNT(*) AS ?count) ?cause WHERE {
?pid wdt:P31 wd:Q5.
?pid wdt:P509 ?cid.
?cid wdt:P279* wd:Q12078.
OPTIONAL {
?cid rdfs:label ?cause.
FILTER((LANG(?cause)) = "en")
}
?pid wdt:P570 ?_date_of_death.
BIND ( YEAR(?_date_of_death) AS ?year )
FILTER( BOUND(?cause) )
FILTER( BOUND(?year) )
FILTER( ?year > 1960 )
}
GROUP BY ?cid ?cause ?year
####
PREFIX defaultView: <http://defaultView>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#added before 2016-10
#defaultView:TreeMap
SELECT ?show ?showLabel ?season ?cleanSeasonLabel ?episode ?episodeLabel
WHERE
{
{
BIND(wd:Q886 as ?show) .
?season wdt:P361 ?show .
?season rdfs:label ?_seasonLabel.
FILTER((LANG(?_seasonLabel)) = "en")
BIND(SUBSTR(?_seasonLabel, 0, STRLEN(?_seasonLabel)-23) AS ?cleanSeasonLabel)
?episode wdt:P361 ?season .
}
UNION
{
BIND(wd:Q16538 as ?show) .
?season wdt:P361 ?show .
?season rdfs:label ?_seasonLabel.
FILTER((LANG(?_seasonLabel)) = "en")
BIND(SUBSTR(?_seasonLabel, 0, STRLEN(?_seasonLabel)-20) AS ?cleanSeasonLabel)
?episode wdt:P361 ?season .
}
UNION
{
BIND(wd:Q147235 as ?show) .
?season wdt:P361 ?show .
?season rdfs:label ?_seasonLabel.
FILTER((LANG(?_seasonLabel)) = "en")
BIND(CONCAT("S", SUBSTR(?_seasonLabel, 25)) AS ?cleanSeasonLabel)
?episode wdt:P361 ?season .
}
}
####
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX defaultView: <http://defaultView>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:TreeMap
SELECT ?eyes ?hairColorLabel (COUNT(?person) as ?count)
WHERE
{
?person wdt:P1340 ?eyeColor.
?person wdt:P1884 ?hairColor.
?person wdt:P2048 ?height.
?eyeColor rdfs:label ?_eyeColorLabel.
FILTER((LANG(?_eyeColorLabel)) = "en")
BIND(CONCAT(?_eyeColorLabel, " eyes") AS ?eyes)
}
GROUP BY ?eyes ?hairColorLabel
####
PREFIX defaultView: <http://defaultView>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
#defaultView:ScatterChart
SELECT ?year (COUNT(?_genre) AS ?count ) (SAMPLE(?_genreLabel) AS ?label ) (?year as ?year_shown) WHERE {
?item wdt:P31 wd:Q11424.
?item wdt:P577 ?_publication_date.
?item wdt:P136 ?_genre.
?_genre rdfs:label ?_genreLabel.
BIND(str(YEAR(?_publication_date)) AS ?year)
FILTER((LANG(?_genreLabel)) = "en")
FILTER (?_publication_date >= "2000-00-00T00:00:00Z"^^xsd:dateTime)
}
GROUP BY ?_genreLabel ?year
HAVING (?count > 30)
####
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX defaultView: <http://defaultView>
PREFIX bd: <http://www.bigdata.com/rdf#>
#added before 2016-10
#defaultView:Map
SELECT ?objectLabel ?objectDescription ?link ?coord
WHERE {
?object wdt:P31 wd:Q46169 ;
wdt:P856 ?link ;
wdt:P625 ?coord .
}
####
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX defaultView: <http://defaultView>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map
SELECT DISTINCT ?city ?cityLabel (SAMPLE(?location) AS ?location_) (MAX(?population) AS ?population_) (SAMPLE(?layer) AS ?layer_)
WHERE
{
?city wdt:P31/wdt:P279* wd:Q515;
wdt:P625 ?location;
wdt:P1082 ?population.
FILTER(?population >= 500000).
BIND(
IF(?population < 1000000, "<1M",
IF(?population < 2000000, "1M-2M",
IF(?population < 5000000, "2M-5M",
IF(?population < 10000000, "5M-10M",
IF(?population < 20000000, "10M-20M",
">20M")))))
AS ?layer).
}
GROUP BY ?city ?cityLabel
####
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#>
#added before 2016-10
# Places with free wi-fi
SELECT ?item ?itemLabel ?coord
WHERE
{
?item wdt:P2848 wd:Q1543615 ;
wdt:P625 ?coord .
}
####
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX defaultView: <http://defaultView>
PREFIX bd: <http://www.bigdata.com/rdf#>
#added before 2016-10
#defaultView:Map
SELECT ?stationLabel ?coord
WHERE {
?station wdt:P81 wd:Q99691 ;
wdt:P625 ?coord .
}
####
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX defaultView: <http://defaultView>
PREFIX bd: <http://www.bigdata.com/rdf#>
#added before 2016-10
#defaultView:Map
SELECT ?universityLabel ?universityDescription ?website ?coord
WHERE {
?university wdt:P31/wdt:P279* wd:Q3918 ;
wdt:P17 wd:Q183 ;
wdt:P625 ?coord .
OPTIONAL {
?university wdt:P856 ?website
}
}
####
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX defaultView: <http://defaultView>
#added before 2016-10
#defaultView:Map
SELECT ?item ?itemLabel ?coord
WHERE