Project:SPARQL query service/queries/examples: Difference between revisions
From SCDB
No edit summary |
No edit summary |
||
Line 9: | Line 9: | ||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } | ||
} | } | ||
}} | |||
=== Ships ordered by cargo capacity === | |||
{{SPARQL2|query=SELECT ?item ?itemLabel ?cargoCapacity WHERE | |||
{ | |||
?item scdbt:P1 scdb:Q842; | |||
scdbt:P61 ?cargoCapacity. | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } | |||
} ORDER BY DESC(?cargoCapacity) | |||
}} | }} | ||
Revision as of 22:35, 18 July 2020
Simple Queries
These basic queries help to understand SPARQL and the Wikibase RDF format.
Ships
SELECT ?item ?itemLabel
WHERE
{
?item scdbt:P1 scdb:Q842.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Ships ordered by cargo capacity
SELECT ?item ?itemLabel ?cargoCapacity WHERE
{
?item scdbt:P1 scdb:Q842;
scdbt:P61 ?cargoCapacity.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY DESC(?cargoCapacity)
List of systems
SELECT ?item ?itemLabel WHERE {
?item scdbt:P1 scdb:Q16.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
List of jump points of Stanton system
SELECT ?item ?itemLabel WHERE {
?item scdbt:P1 scdb:Q916;
scdbt:P48 scdb:Q24.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
STAR arkmap type
SELECT ?item ?itemLabel
WHERE
{
?item scdbt:P10 "STAR".
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}