Help:SPARQL query examples: Difference between revisions

From DataTrek
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
__NOTOC__
Questa pagina conterrà esempi dettagliati per usare lo endpoint SPARQL.
 
Si tratta di una caratteristica '''sperimentale'''.
 
== Dove si trova ==
https://wdqs.wikitrek.org
 
== A cosa serve ==
https://en.wikipedia.org/wiki/SPARQL
 
<div class="mw-heading mw-heading2">
<div class="mw-heading mw-heading2">
   <h2>Queries with cats</h2>
   <h2>Wikitrek</h2>
</div>
</div>
<div class="mw-heading mw-heading3">
<div class="mw-heading mw-heading3">
   <h3>Cats</h3>
   <h3>Episodi di Lower Decks</h3>
</div>
</div>
<syntaxhighlight lang="sparql">
Elenco di episodi di '''''[[wikitrek:Star Trek: Lower Decks|Lower Decks]]'''''
SELECT ?cat ?catLabel WHERE {
<syntaxhighlight lang="sparql" line>
   ?cat prefix:P1 prefix:Q2
PREFIX wd: <https://data.wikitrek.org/entity/>
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
PREFIX wdt: <https://data.wikitrek.org/prop/direct/>
}
SELECT ?episode ?episodeLabel ?publication ?production WHERE {
   ?episode wdt:P14 wd:Q10317;
          wdt:P101 ?publication;
          wdt:P1 ?production
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
  }
ORDER BY ASC (?production)
</syntaxhighlight>
</syntaxhighlight>
<div class="mw-heading mw-heading2">
  <h2>Queries with dogs</h2>
</div>
<div class="mw-heading mw-heading3">
<div class="mw-heading mw-heading3">
   <h3>Dogs</h3>
   <h3>Episodi di Prodigy</h3>
</div>
</div>
Elenco di episodi di '''''[[wikitrek:Star Trek: Prodigy|Prodigy]]'''''
<syntaxhighlight lang="sparql">
<syntaxhighlight lang="sparql">
SELECT ?dog ?dogLabel WHERE {
PREFIX wd: <https://data.wikitrek.org/entity/>
  ?dog prefix:P1 prefix:Q3
PREFIX wdt: <https://data.wikitrek.org/prop/direct/>
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
}
SELECT ?episode ?episodeLabel ?publication ?production WHERE {
</syntaxhighlight>
   ?episode wdt:P14 wd:Q10692;
 
          wdt:P101 ?publication;
 
          wdt:P1 ?production
== Queries with dogs ==
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
=== Dogs ===
  }
<syntaxhighlight lang="sparql">
ORDER BY ASC (?production)
SELECT ?dog ?dogLabel WHERE {
   ?dog prefix:P1 prefix:Q3
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
}
</syntaxhighlight>
</syntaxhighlight>

Revision as of 00:14, 10 January 2025

Questa pagina conterrà esempi dettagliati per usare lo endpoint SPARQL.

Si tratta di una caratteristica sperimentale.

Dove si trova

https://wdqs.wikitrek.org

A cosa serve

https://en.wikipedia.org/wiki/SPARQL

Wikitrek

Episodi di Lower Decks

Elenco di episodi di Lower Decks

PREFIX wd: <https://data.wikitrek.org/entity/>
PREFIX wdt: <https://data.wikitrek.org/prop/direct/>
	
SELECT ?episode ?episodeLabel ?publication ?production WHERE {
  ?episode wdt:P14 wd:Q10317;
           wdt:P101 ?publication;
           wdt:P1 ?production
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
  }
ORDER BY ASC (?production)

Episodi di Prodigy

Elenco di episodi di Prodigy

PREFIX wd: <https://data.wikitrek.org/entity/>
PREFIX wdt: <https://data.wikitrek.org/prop/direct/>
	
SELECT ?episode ?episodeLabel ?publication ?production WHERE {
  ?episode wdt:P14 wd:Q10692;
           wdt:P101 ?publication;
           wdt:P1 ?production
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
  }
ORDER BY ASC (?production)