User:Bangbang.S

From Wikidata
Jump to navigation Jump to search

todo[edit]

  • 父子(母女)都是政治人物列表
  • 教育机构排名数据
Babel user information
zh-N 中文是这位用户的母语
en-3 This user has advanced knowledge of English.
Users by language

Query[edit]

中华人民共和国政治人物[edit]

连同父亲都是政府官员的官员[edit]

SELECT ?politician ?politician_label ?parent_label  WHERE {
  ?politician wdt:P106 wd:Q82955;
    wdt:P27 wd:Q148.
  OPTIONAL {
    ?politician rdfs:label ?politician_label.
    FILTER((LANG(?politician_label)) = "zh")
  }
  ?politician wdt:P22 ?parent.
  ?parent wdt:P106 wd:Q82955.
    OPTIONAL {
    ?parent rdfs:label ?parent_label.
    FILTER((LANG(?parent_label)) = "zh")
  }
}
ORDER BY (?politician)
Try it!

中国签订的条约及所有的条约语言版本(wikisource)[edit]

SELECT DISTINCT ?treaty ?treatyLabel ?countryLabel ?wikisourceSitelink ?wikisourceLanguage WHERE {
  ?wikisourceSitelink schema:isPartOf [ wikibase:wikiGroup "wikisource" ];
                      schema:inLanguage ?wikisourceLanguage;
                      schema:about ?treaty.
  ?treaty wdt:P31 wd:Q131569;
         wdt:P17 ?country.
  #?country wdt:P31  wd:Q50068795.
  FILTER(?wikisourceLanguage = "zh")
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "zh,[AUTO_LANGUAGE],en". }
}
ORDER BY ?wikisourceLanguage
LIMIT 300
}
ORDER BY ?wikisourceLanguage
LIMIT 300
Try it!

以onion 结尾的网站[edit]

SELECT ?item ?itemLabel ?officialSite
WHERE {
  ?item wdt:P856 ?officialSite
  FILTER (regex(STR(?officialSite), "onion$")).

  SERVICE wikibase:label { bd:serviceParam wikibase:language "zh,[AUTO_LANGUAGE],en". }
}
Try it!

杭州车牌[edit]

table view 下order 正确,但linechard下却不对???

#defaultView:LineChart

SELECT 
#?item
?date  ?price 
#?pointTimeMonthNorm
WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?item wdt:P31/(wdt:P279)* wd:Q114885389.
  ?item p:P2284 ?priceStatement.
  ?priceStatement ps:P2284 ?price.
  ?priceStatement pq:P366 wd:Q215627.
  ?priceStatement pq:P1552 wd:Q10585806.
  
  OPTIONAL{
    ?item wdt:P585 ?itemPointTime.
    }
  
   OPTIONAL{
    ?priceStatement pq:P585 ?priceStatementPointTime.
    }.
  
  BIND(IF(BOUND(?itemPointTime),?itemPointTime, ?priceStatementPointTime) as ?pointTime)
  
    BIND(YEAR(?pointTime) as ?pointTimeYear)
    BIND(MONTH(?pointTime) as ?pointTimeMonth)
#    IF(?pointTimeMonth < 10,
#       BIND(CONCAT("0",?pointTimeMonth) AS ?pointTimeMonth),       
#       BIND(CONCAT("0",?pointTimeMonth) AS ?pointTimeMonth)
#      )
#    IF( 1 < 2, BIND(?pointTimeMonth as ?A), (?pointTimeMonth as ?A))
    BIND(IF(?pointTimeMonth < 10, CONCAT("0",Str(?pointTimeMonth)), Str(?pointTimeMonth)) as ?pointTimeMonthNorm)
    BIND(CONCAT(Str(?pointTimeYear), "年", Str(?pointTimeMonthNorm), "月") as ?date)
}
ORDER BY ASC(?date)
LIMIT 10000
Try it!

Noble Prize[edit]

原始列表[edit]

# 所有获得
SELECT ?human ?humanLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
   #诺贝尔奖
  ?human (wdt:P166/(wdt:P279*)) wd:Q7191.
  #  的人类
  ?human wdt:P31 wd:Q5.
}
LIMIT 10000
Try it!

原始列表 (+ 所属国家)[edit]

SELECT ?human ?humanLabel ?country ?countryLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "zh,[AUTO_LANGUAGE],". }
  ?human (wdt:P166/(wdt:P279*)) wd:Q7191;
    wdt:P31 wd:Q5;
    wdt:P27 ?country.
}
LIMIT 10000
Try it!

原始列表 按所属国家统计得奖人数[edit]

#defaultView:LineChart
SELECT ?countryLabel (COUNT(?human) AS ?TotalPrizeNumber)  ?country   WHERE {
#SELECT ?countryLabel ?country ?humanLabel   WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "zh,[AUTO_LANGUAGE],". }
  ?human (wdt:P166/(wdt:P279*)) wd:Q7191;
    wdt:P31 wd:Q5;
    wdt:P27 ?country.
}
GROUP BY ?countryLabel ?country
ORDER  BY  DESC(?TotalPrizeNumber)
LIMIT 10000
Try it!


原始列表 按年所属国家当年统计得奖人数[edit]

#defaultView:LineChart
SELECT  ?year (COUNT(?human) AS ?TotalYearlyPrizeNumberByCountry) ?countryLabel  
#SELECT  ?year ?human ?countryLabel  
WITH
{
  SELECT * WHERE {
    ?human (p:P166) ?awardStatement.
    ?awardStatement ps:P166/wdt:P279* wd:Q7191.
          ?awardStatement pq:P585 ?date.
    ?human  wdt:P27 ?country.
          bind(str(YEAR(?date)) AS ?year)
                    #SERVICE wikibase:label { bd:serviceParam wikibase:language "zh,[AUTO_LANGUAGE],". }
    }
  LIMIT 10000
} AS %results
WHERE
{
    INCLUDE %results.
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?year ?countryLabel
Try it!

按年所属国家累计年统计得奖人数[edit]

SELECT * 

WITH {
SELECT ?year ?country ?human ?yearOther ?countryOther ?humanOther WHERE {
    ?human (p:P166) ?awardStatement.
    ?awardStatement ps:P166/wdt:P279* wd:Q7191.
          ?awardStatement pq:P585 ?date.
    ?human  wdt:P27 ?country.
    bind(str(YEAR(?date)) AS ?year)
  
    ?humanOther (p:P166) ?awardStatement.
      ?awardStatement ps:P166/wdt:P279* wd:Q7191.
          ?awardStatement pq:P585 ?date.
  ?humanOther  wdt:P27 ?countryOther.
   bind(str(YEAR(?date)) AS ?yearOther)
   FILTER (?year >= ?yearOther)
}
} AS %rawResult

WHERE {
  INCLUDE %rawResult.
}
#GROUP BY ?year
ORDER BY ASC(?year)
Try it!

将数据排列[edit]

SELECT * 

WITH {
SELECT ?year ?country ?human ?yearOther ?countryOther ?humanOther WHERE {
    ?human (p:P166) ?awardStatement.
    ?awardStatement ps:P166/wdt:P279* wd:Q7191.
    ?awardStatement pq:P585 ?date.
    bind(str(YEAR(?date)) AS ?year)
  
    ?humanOther (p:P166) ?awardStatementOther.
    ?awardStatementOther ps:P166/wdt:P279* wd:Q7191.
    ?awardStatementOther pq:P585 ?dateOther.
    bind(str(YEAR(?dateOther)) AS ?yearOther)
  
    FILTER (?year >= ?yearOther).
    FILTER (?year >= "1901" && ?year <= "1903").
}
} AS %rawResult

WHERE {
  INCLUDE %rawResult.
  
  ?human  wdt:P27 ?country.
  ?humanOther  wdt:P27 ?countryOther.
  FILTER(?country = ?countryOther)
}

#GROUP BY ?year
ORDER BY ASC(?year)
Try it!

FSM java lib[edit]

SELECT DISTINCT ?item ?itemLabel ?language ?languageLabel
WHERE 
{
  
  ?item wdt:P366 wd:Q176452.
  ?item wdt:P277 ?language
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "zh,[AUTO_LANGUAGE]". }
}
Try it!

在联合国及其附属单位工作的中国人 [查询][edit]

SELECT DISTINCT ?item ?itemLabel 
WHERE 
{
  BIND (wd:Q148 as ?rpc)
  BIND (wdt:P31 as ?instanceof)
  BIND (wdt:P108 as ?employer)
  BIND (wdt:P27 as ?coutry)
  BIND (wd:Q15925165 as ?UN)
  VALUES ?cn {wd:Q148 wd:Q8646 wd:Q14773}
  
  ?item ?employer ?group.
  ?group ?instanceof ?UN.
  ?item ?coutry ?cn.
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "zh". }
}
Try it!

RPC with criminal[edit]

原始数据[edit]

SELECT ?People_s_Republic_of_China ?People_s_Republic_of_ChinaLabel ?criminal ?criminalLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "zh". }
  ?People_s_Republic_of_China wdt:P27 wd:Q148.
  ?People_s_Republic_of_China wdt:P1399 ?criminal
}
LIMIT 9999999
Try it!

合并罪名[edit]

SELECT ?People_s_Republic_of_China ?People_s_Republic_of_ChinaLabel (GROUP_CONCAT(?label; SEPARATOR = ",") AS ?criminals) WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "zh". }
  ?People_s_Republic_of_China wdt:P27 wd:Q148.
  ?People_s_Republic_of_China wdt:P1399 ?criminal.
  ?criminal rdfs:label ?label.
  FILTER(LANG(?label) = "zh-cn")
}
GROUP BY ?People_s_Republic_of_China ?People_s_Republic_of_ChinaLabel
LIMIT 9999999
Try it!

音乐[edit]

各乐器的音域图片[edit]

#defaultView:ImageGrid
SELECT ?item ?itemLabel ?playing_range_image WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "zh,[AUTO_LANGUAGE],en". }
  OPTIONAL { ?item wdt:P2343 ?playing_range_image. }
}
LIMIT 1000
Try it!

铁路[edit]

全世界地铁站[edit]

#defaultView:Map{"hide":["?coord1", "?coord1lat", "?coord1lon", "?coord2", "?coord2lat", "?coord2lon", "?str", "?line"]}
SELECT DISTINCT ?comm1 ?coord1 WHERE {
  ?comm1 wdt:P31/wdt:P279* wd:Q928830 ; 
         #wdt:P17 wd:Q148 ; 
         #wdt:P131/wdt:P279* wd:Q4970;
         wdt:P625 ?coord1 ; 
}
Try it!

有地铁的城市[edit]

SELECT 
DISTINCT
?cityLabel
#?stationLabel ?lineLabel ?line

#
WITH {
  SELECT *
  WHERE {
    ?station wdt:P31/wdt:P279* wd:Q928830.
    #?station wdt:P625 ?location.
    #?station wdt:P81 ?line.
  }
}
AS %rawResult


WITH {
  SELECT *
  WHERE {
  INCLUDE %rawResult
      
  ?station wdt:P131/wdt:P279* ?city.
  ?city wdt:P31/wdt:P279* wd:Q515.
  }  
} AS %resultWithoutLabel  

WHERE {
  INCLUDE %resultWithoutLabel.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "zh,[AUTO_LANGUAGE],zh". }
}
Try it!

杭州地铁[edit]

#defaultView:Map{"hide":["?cds","?line","?layer"],"layer":"?trackLabel"}
SELECT ?station ?stationLabel ?cds ?line ?trackLabel ?track ?image {
{
  SELECT * {
  SERVICE gas:service {
       gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS" ; gas:in wd:Q17163817 ; gas:linkType wdt:P197 ; gas:out ?station ; gas:out1 ?depth ; gas:out2 ?pred . }
  FILTER(?station != wd:Q17163817)
                      ?station wdt:P625 ?cds ;
                               wdt:P17 wd:Q148.
                             
  ?station p:P197 ?adjST .
  ?adjST ps:P197 ?adj ;
                pq:P81 ?track .

  ?adj p:P625/psv:P625/wikibase:geoLatitude ?lat1 ; p:P625/psv:P625/wikibase:geoLongitude ?lon1 .
  ?station p:P625/psv:P625/wikibase:geoLatitude ?lat2 ; p:P625/psv:P625/wikibase:geoLongitude ?lon2 .
  BIND(CONCAT('LINESTRING(', STR(?lon1), ' ', STR(?lat1), ',', STR(?lon2), ' ', STR(?lat2), ')') AS ?str) . BIND(STRDT(?str, geo:wktLiteral) AS ?line)}
 
}
  OPTIONAL { ?station wdt:P18 ?image .}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
Try it!

各大(百万人口)城市地铁[edit]

#TEMPLATE={"template":"行政区域 ?city 的地铁","variables":{"?city":{"query":"SELECT DISTINCT ?cityLabel where {?city wdt:P31/wdt:P279* wd:Q1637706.  SERVICE wikibase:label { bd:serviceParam wikibase:language \"zh,[AUTO_LANGUAGE]\"}}"}}}
#defaultView:Map
SELECT * WHERE {
  BIND(wd:Q4970 AS ?city)
  ?comm1 wdt:P31/wdt:P279* wd:Q928830 ; 
        # wdt:P17 wd:Q213 ; 
         wdt:P131*/wdt:P279* ?city;
         wdt:P625 ?coord1 ;
        wdt:P197 ?comm2 .
        
  ?comm2 wdt:P625 ?coord2 .
  ?comm1 p:P625 [# ps:P625 []; 
                  psv:P625 [ wikibase:geoLongitude ?coord1lon; wikibase:geoLatitude ?coord1lat; ] ] .
  ?comm2 p:P625 [# ps:P625 []; 
                  psv:P625 [ wikibase:geoLongitude ?coord2lon; wikibase:geoLatitude ?coord2lat; ] ] .
  BIND(CONCAT('LINESTRING (', STR(?coord1lon), ' ', STR(?coord1lat), ',', STR(?coord2lon), ' ', STR(?coord2lat), ')') AS ?str) .
  BIND(STRDT(?str, geo:wktLiteral) AS ?line) .
}

空难列表[edit]

初始版本[edit]

#defaultView:Map
SELECT ?item ?itemLabel ?deathNumber ?aircraftLabel ?geo ?date WHERE {
  ?item (wdt:P31/(wdt:P279*)) wd:Q744913.
  OPTIONAL {
    ?item wdt:P121 ?aircraft;
      wdt:P585 ?date;
      wdt:P1120 ?deathNumber.
  }
  OPTIONAL { ?item wdt:P625 ?geo. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],zh". }
}
Try it!

带图例[edit]

#defaultView:Map
SELECT DISTINCT ?item ?itemLabel ?deathNumber ?aircraftLabel ?geo ?date ?layer WHERE {
  ?item (wdt:P31/(wdt:P279*)) wd:Q744913.
  OPTIONAL {
    ?item wdt:P121 ?aircraft;
      wdt:P585 ?date;
      wdt:P625 ?geo;
      wdt:P1120 ?deathNumber.
  }
  BIND (
    IF(?deathNumber <=1, "<=1",
    IF(?deathNumber <=5, "1,5",
    IF(?deathNumber <=10, "5,10",
    IF(?deathNumber <=50, "10,50",
    ">=50"))))
    AS ?layer)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],zh". }
}
Try it!

带图例+自定义表头[edit]

#defaultView:Map
SELECT DISTINCT ?item ?itemLabel ?deathNumberText ?aircraftLabel ?geo ?date ?layer WHERE {
  ?item (wdt:P31/(wdt:P279*)) wd:Q744913.
  OPTIONAL {
    ?item wdt:P121 ?aircraft;
      wdt:P585 ?date;
      wdt:P625 ?geo;
      wdt:P1120 ?deathNumber.
  }
  #自定义表头内容
  BIND( CONCAT("死亡人数:", STR(?deathNumber)) AS ?deathNumberText)
  BIND (
    IF(?deathNumber <=1, "<=1",
    IF(?deathNumber <=5, "1,5",
    IF(?deathNumber <=10, "5,10",
    IF(?deathNumber <=50, "10,50",
      IF(?deathNumber <=100, "50,100",
    ">=100")))))
    AS ?layer)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],zh". }
}
Try it!

同时是总统(职位)又是演员(职业)的人物列表[edit]

SELECT DISTINCT ?politician ?politicianLabel ?country ?countryLabel 
WHERE
{

  ?politician wdt:P39/wdt:P279* wd:Q48352 . 
  ?politician wdt:P106/wdt:P279* wd:Q33999.
  ?politician wdt:P27 ?country.

  SERVICE wikibase:label { bd:serviceParam wikibase:language "zh-cn,en". }
}
Try it!


使用模版[edit]

#TEMPLATE={"template":"职务上既是 ?occupation 职业上也是 ?carrer 的人物列表","variables":{"?occupation":{"query":" SELECT ?id WHERE { ?id wdt:P279* wd:Q48352 . }"},"?carrer":{"query":" SELECT ?id WHERE { ?id wdt:P279* wd:Q12737077 . }"}}}
#_title: 点击“显示查看说明”
SELECT DISTINCT ?politician ?politicianLabel ?country ?countryLabel WHERE {
  BIND(wd:Q50684 AS ?occupation)
  BIND(wd:Q82955 AS ?carrer)
  ?politician (wdt:P39/(wdt:P279*)) ?occupation;
    (wdt:P106/(wdt:P279*)) ?carrer.
  OPTIONAL { ?politician wdt:P27 ?country. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "zh-cn,zh,en". }
}

Polar 公司的设备[edit]

SELECT ?item ?itemLabel ?classLabel ?property ?propertyLabel ?targetLabel
WHERE {
  {
    SELECT ?item ?property {
      hint:Query hint:optimizer "None" .
      ?property wikibase:claim ?p ;
        wikibase:statementProperty ?ps .
      ?st ?ps wd:Q1500857 .
      ?item ?p ?st .
    }
    LIMIT 1000
  }
  ?item wdt:P31 ?class
  BIND(wd:Q1500857 AS ?target)
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
  }
}
Try it!

TODO 没有完整的数据


Problem[edit]

新创建的Item在其它Item的属性录入时不生效(三国志(陈寿撰_裴松之注_建阳刊本))


如何统计国内各学校跟知网的作用费用?

Q111666771 Q111667360


编辑 音频编解码器 时 输入 "编解码" 不会自动关联到 音频编解码器 (好像是从第一个字严格匹配)

模板:Item documentation[edit]

Autodescription — contract (Q93288)

description: agreement having a lawful object entered into voluntarily by multiple parties (may be explicitly written or oral)
Useful links:
Classification of the class contract (Q93288)  View with Reasonator View with SQID
For help about classification, see Wikidata:Classification.
Parent classes (classes of items which contain this one item)
Subclasses (classes which contain special kinds of items of this class)
contract⟩ on wikidata tree visualisation (external tool)(depth=1)
Generic queries for classes
See also


Q1148747== Autodescription — finite-state machine (Q176452) ==

description: mathematical model of computation; abstract machine that can be in exactly one of a finite number of states at any given time
Useful links:
Classification of the class finite-state machine (Q176452)  View with Reasonator View with SQID
For help about classification, see Wikidata:Classification.
Parent classes (classes of items which contain this one item)
Subclasses (classes which contain special kinds of items of this class)
finite-state machine⟩ on wikidata tree visualisation (external tool)(depth=1)
Generic queries for classes
See also


== Autodescription — payment (Q1148747) ==

description: transfer of an item of value from one party (such as a person or company) to another, in exchange for goods or services or to fulfill a legal obligation
Useful links:
See also


== Autodescription — mechanical keyboard (Q4292133) ==

description: type of computer keyboard that uses mechanical switches
Useful links:
Classification of the class mechanical keyboard (Q4292133)  View with Reasonator View with SQID
For help about classification, see Wikidata:Classification.
Parent classes (classes of items which contain this one item)
Subclasses (classes which contain special kinds of items of this class)
mechanical keyboard⟩ on wikidata tree visualisation (external tool)(depth=1)
Generic queries for classes
See also


== Autodescription — packet analyzer (Q54366) ==

description: computer network equipment or software that analyzes network traffic
Useful links:
Classification of the class packet analyzer (Q54366)  View with Reasonator View with SQID
For help about classification, see Wikidata:Classification.
Parent classes (classes of items which contain this one item)
Subclasses (classes which contain special kinds of items of this class)
packet analyzer⟩ on wikidata tree visualisation (external tool)(depth=1)
Generic queries for classes
See also


Autodescription — documentation generator (Q2164323)

description: computer program that creates software documents
Useful links:
Classification of the class documentation generator (Q2164323)  View with Reasonator View with SQID
See also


Autodescription — national economy (Q6456916)

description: totality of all economic subjects associated in an economic area (a state)
Useful links:
See also


BUG[edit]

没有全部的站点???

#defaultView:Map{"hide":["?coord1", "?coord1lat", "?coord1lon", "?coord2", "?coord2lat", "?coord2lon", "?str", "?line"]}
SELECT * WHERE {
  ?comm1 wdt:P31/wdt:P279* wd:Q928830 ; 
        # wdt:P17 wd:Q213 ; 
         wdt:P131/wdt:P279* wd:Q4970;
         wdt:P625 ?coord1 ; 
         wdt:P197 ?comm2 .
 # MINUS { ?comm1 p:P31 [ ps:P31 wd:Q55488 ; pq:P582 [] ] } .
 # MINUS { ?comm2 p:P31 [ ps:P31 wd:Q55488 ; pq:P582 [] ] } .
 # MINUS { ?comm1 p:P31 [ ps:P31 wd:Q928830 ] } .
 # MINUS { ?comm2 p:P31 [ ps:P31 wd:Q928830 ] } .
  ?comm2 wdt:P625 ?coord2 .
 # ?comm1 p:P625 [# ps:P625 []; 
 #                 psv:P625 [ wikibase:geoLongitude ?coord1lon; wikibase:geoLatitude ?coord1lat; ] ] .
#  ?comm2 p:P625 [# ps:P625 []; 
#                  psv:P625 [ wikibase:geoLongitude ?coord2lon; wikibase:geoLatitude ?coord2lat; ] ] .
  BIND(CONCAT('LINESTRING (', STR(?coord1lon), ' ', STR(?coord1lat), ',', STR(?coord2lon), ' ', STR(?coord2lat), ')') AS ?str) .
  BIND(STRDT(?str, geo:wktLiteral) AS ?line) .
}
Try it!

对讲机[edit]

所有的电信设备[edit]

SELECT ?item ?itemLabel
WHERE
{
  ?item wdt:P31/wdt:P279* wd:Q954187. 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } 
}
Try it!

参考[edit]

没有找到一个直接连接到对应id的URL???

https://cmiitid.cn/search?q=2019FP6299