579
edits
Line 1,940: | Line 1,940: | ||
<sparql tryit="1"> | <sparql tryit="1"> | ||
## ** | |||
## **NOTES** | |||
## a few properties have a linked wikidata "Q" rather than "P" ID. These will unfortunately not link correctly to Wikidata so wd_label/wd_description won't be present. | |||
## a few other properties may have wikidata=yes but no wd_label and/or wd_description. This could be because the property on Wikidata has been deleted (eg performed at). | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | ||
Line 1,950: | Line 1,953: | ||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | ||
SELECT DISTINCT ?property | SELECT DISTINCT ?property (if(bound(?wikidata_id), "yes", "no") as ?has_wikidata) ?bn_label ?wd_label ?bn_description | ||
(if(bound(?wikidata_id), "yes", "no") as ?has_wikidata) ? | ?wd_description ?wikidata ?bn_propertyType | ||
WHERE { | WHERE { | ||
?property a wikibase:Property ; | ?property a wikibase:Property ; | ||
wikibase:propertyType ? | wikibase:propertyType ?bn_propertyType . # datatype | ||
service wikibase:label { | |||
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb,en". | |||
?property rdfs:label ?bn_label . | |||
?property schema:description ?bn_description . | |||
} | |||
# wikidata P117 | |||
optional { ?property bnp:P117 ?wikidata_id . | |||
?wikidata_id bnpq:P14 ?wikidata_url . | |||
# the string to replace needs to be different for properties! | |||
BIND(IRI(REPLACE(?wikidata_url, "https://www.wikidata.org/wiki/Property:", "http://www.wikidata.org/entity/")) as ?wikidata ) | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb,en". | |||
?wikidata schema:description ?wd_description . | |||
?wikidata rdfs:label ?wd_label . | |||
} # / label service | |||
} # /wikidata service | |||
} #/wikidata optional | |||
} | } | ||
order by ? | order by ?bn_label | ||
</sparql> | </sparql> | ||
edits