Plantilla:SPARQL

De Viquipèdia
Icona de documentació de mòdul Documentació de la plantilla [ mostra ] [ modifica el codi ] [ mostra l'historial ] [ refresca ]

Descripció[modifica]

This template displays SPARQL query with syntax highlighting, prefixes and link to WDQS beta site to run the query.

Paràmetres de la plantilla

ParàmetreDescripcióTipusEstat
queryquery

SPARQL query

Exemple
SELECT * WHERE { ?x wdt:P31 wd:Q5 } LIMIT 1
Cadenaobligatori
pp

Produce p: prefix if set

Booleàopcional
qq

Produce q: prefix if set

Booleàopcional
vv

Produce v: prefix if set

Booleàopcional
extraprefixextraprefix

Extra prefixes to be added

Exemple
PREFIX wikibase: <http://wikiba.se/ontology#>
Cadenaopcional

Example[modifica]

  • {{SPARQL|query=SELECT DISTINCT ?person ?name ?language ?death (URI(CONCAT("https://www.gutenberg.org/ebooks/author/", ?gutenberg)) AS ?gberglink) WHERE { ?person wdt:P1938 ?gutenberg. ?person wdt:P570 ?death. # Dead people only MINUS { ?enws schema:about ?person. ?enws schema:isPartOf <https://en.wikisource.org/> } OPTIONAL {?person wdt:P1412 ?lang}. FILTER (!BOUND(?lang) {{!}}{{!}} ?lang = wd:Q1860) # Language: English or absent BIND(IF(BOUND(?lang),"English","Not specified") AS ?language ) ?person rdfs:label ?name. FILTER((LANG(?name)) = "en") } ORDER BY ?death }}
SELECT DISTINCT ?person ?name ?language ?death (URI(CONCAT("https://www.gutenberg.org/ebooks/author/", ?gutenberg)) AS ?gberglink) WHERE {
  ?person wdt:P1938 ?gutenberg.
  ?person wdt:P570 ?death. # Dead people only
  MINUS {
    ?enws schema:about ?person.
    ?enws schema:isPartOf <https://en.wikisource.org/>
  }
  OPTIONAL {?person wdt:P1412 ?lang}.
  FILTER (!BOUND(?lang) || ?lang = wd:Q1860) # Language: English or absent
  BIND(IF(BOUND(?lang),"English","Not specified") AS ?language
)  ?person rdfs:label ?name.
  FILTER((LANG(?name)) = "en")
}
ORDER BY ?death
Prova-ho !

Vegeu també[modifica]

Sintaxi[modifica]

== Vegeu també ==

Prova-ho !