I found a query retrieving all properties of Wikidata together with property id, label, description and aliases
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX schema: <http://schema.org/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX wikibase: <http://wikiba.se/ontology#>
SELECT ?p ?pt ?pLabel ?d ?aliases WHERE {
{
SELECT ?p ?pt ?d
(GROUP_CONCAT(DISTINCT ?alias; separator="|") as ?aliases)
WHERE {
?p wikibase:propertyType ?pt .
OPTIONAL {?p skos:altLabel ?alias FILTER (LANG (?alias) = "en")}
OPTIONAL {?p schema:description ?d FILTER (LANG (?d) = "en") .}
} GROUP BY ?p ?pt ?d
}
SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
}
}
and a query counting properties used by items pointing to Q46 through a statement
SELECT ?property ?count
WHERE {
SELECT ?property (COUNT(?item) AS ?count)
WHERE {
?item ?statement wd:Q46 . # items pointing to Q46 through a statement
?property wikibase:statementProperty ?statement . # property used for that statement
} GROUP BY ?property # count usage for each property pointing to that entity
} ORDER BY DESC(?count) # show in descending order of uses
I would combine them without depending on Q46 but I don't know exactly how.
Such SPARQL query will take too much time leading to execution time out. The alternatives are:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.