SPARQL examples
Revision as of 15:26, 31 March 2023 by Admin (talk | contribs) (Created page with "== Items == === Entities with labels === {{SPARQL|query= SELECT DISTINCT ?entity ?entityLabel WHERE { ?entity rdfs:label ?entityLabel. FILTER((LANG(?entityLabel)) = "en") } }} === Properties with labels, aliases, descriptions and datatypes === {{SPARQL|query= SELECT DISTINCT ?propertyWikibase ?propertyLabel ?propertyAlias ?propertyDescription ?propertyType WHERE { ?propertyWikibase wikibase:directClaim ?p; wikibase:propertyType ?propertyType; schema:d...")
Items
Entities with labels
SELECT DISTINCT ?entity ?entityLabel WHERE {
?entity rdfs:label ?entityLabel.
FILTER((LANG(?entityLabel)) = "en")
}
Properties with labels, aliases, descriptions and datatypes
SELECT DISTINCT ?propertyWikibase ?propertyLabel ?propertyAlias ?propertyDescription ?propertyType WHERE {
?propertyWikibase wikibase:directClaim ?p;
wikibase:propertyType ?propertyType;
schema:description ?propertyDescription;
rdfs:label ?propertyLabel.
FILTER((LANG(?propertyLabel)) = "en")
FILTER((LANG(?propertyDescription)) = "en")
OPTIONAL { ?propertyWikibase skos:altLabel ?propertyAlias. }
FILTER((LANG(?propertyAlias)) = "en")
}