Common

edit

Coordinates

edit

User Scripting

edit

Integration

edit

Development

edit

Sources and Citations

edit

SPARQL

edit
 
Wikidata RDF model

Working with Properties

edit

The following query uses these:

  • Properties: connecting line (P81)     , crosses (P177)     , carries (P2505)     
    SELECT ?subject ?subjectLabel ?pedicateLabel ?p ?pLabel ?pedicate 
    WHERE
    {
      ?subject ?p wd:Q819045.
    
      # if you need wd + wdt
      # VALUES ?p { wdt:P81 wdt:P177 wdt:P2505 }.
      # ?pedicate wikibase:directClaim ?p.
    
      # if you need wds + ps
      VALUES ?p { ps:P81 ps:P177 ps:P2505 }.
      ?pedicate wikibase:statementProperty ?p. 
      
      SERVICE wikibase:label { bd:serviceParam wikibase:language "de". }
    }
    ORDER BY ?subject
    

Working with Qualifiers

edit

The following query uses these:

  • Items: Twin Peaks (Q2085)     , Dale Cooper (Q2629231)     
    SELECT * WHERE {
      ?property1 wikibase:claim ?p1 .
      ?property1 wikibase:statementProperty ?ps1 .
      ?property1 wikibase:qualifier ?pq1 .
      ?property1 a wikibase:Property .
      #
      ?property2 wikibase:claim ?p2 .
      ?property2 wikibase:qualifier ?pq2 .
      ?property2 a wikibase:Property .
      #
      #wd:Q2085 ?p1 ?_p1 .
      #?_p1 ?ps1 ?_ps1 .
      #?_p1 ?pq2 ?_pq2 .
      #
      ?subject ?p1 ?_p1 .
      ?_p1 ?ps1 ?_ps1 .
      ?_p1 ?pq2 wd:Q2629231 .
    }
    

Images in Qualifiers

edit

qualifers "image" (or user P180 "depicts")

The following query uses these:

  • Properties: instance of (P31)     , taxon rank (P105)     , image (P18)     
    SELECT ?item ?itemLabel ?typeLabel ?property1Label ?property2Label ?_pq2 WHERE {
      ?item wdt:P31 wd:Q16521 .
      #?item wdt:P105 wd:Q7432 .
      
      ?property1 wikibase:claim ?p1 .
      #?property1 wikibase:statementProperty ?ps1 .
      #?property1 wikibase:qualifier ?pq1 .
      ?property1 a wikibase:Property .
    
      #?property2 wikibase:claim ?p2 .
      ?property2 wikibase:qualifier ?pq2 .
      ?property2 a wikibase:Property .  
    
      ?item wdt:P31 ?type .
      ?item ?p1 ?_p1 .
      #?_p1 ?ps1 ?_ps1 .
      ?_p1 ?pq2 ?_pq2 .
      ?_p1 pq:P18 ?_pq2 .
      
      SERVICE wikibase:label {bd:serviceParam wikibase:language "en".}
    }
    LIMIT 100