Help:SPARQL query examples: Difference between revisions

From DataTrek
Jump to navigation Jump to search
(Marked this version for translation)
Line 19: Line 19:
<!--T:6-->
<!--T:6-->
== Esempi ==
== Esempi ==
Elenco di episodi di '''''[[wikitrek:Star Trek: Lower Decks|Lower Decks]]'''''
{{Help:SPARQL_query_examples/queries}}
<syntaxhighlight lang="sparql" line>
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)
</syntaxhighlight>
</translate>
</translate>

Revision as of 18:02, 28 December 2024

Other languages:

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

Si tratta di una caratteristica sperimentale.

Dove si strova

https://wdqs.wikitrek.org

Cosa serve

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

Esempi da Wikidata

https://www.wikidata.org/wiki/Wikidata:SPARQL_tutorial

Esempi

Queries with cats

Cats

SELECT ?cat ?catLabel WHERE {
  ?cat prefix:P1 prefix:Q2
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
}

Queries with dogs

Dogs

SELECT ?dog ?dogLabel WHERE {
  ?dog prefix:P1 prefix:Q3
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
}


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)

Planets

A list of planets.

SELECT ?planet WHERE {
  ?planet wdt:P31 wd:Q634.
}

Starships

Starships in the galaxy.

SELECT ?starship WHERE {
  ?starship wdt:P31 wd:Q170383.
}