query: SELECT ?item { { ?item wdt:P212 ?value } UNION { ?statement pq:P212 ?value . ?item ?p ?statement . ?prop wikibase:claim ?p } UNION { ?ref pr:P212 ?value . ?statement prov:wasDerivedFrom ?ref . ?item ?p ?statement . ?prop wikibase:claim ?p } . BIND(REPLACE(STR(?value), "-", "") AS ?nohyphen) . FILTER(STRLEN(?nohyphen) = 13) . BIND(xsd:integer(SUBSTR(?nohyphen, 1, 1)) + xsd:integer(SUBSTR(?nohyphen, 2, 1)) * 3 + xsd:integer(SUBSTR(?nohyphen, 3, 1)) + xsd:integer(SUBSTR(?nohyphen, 4, 1)) * 3 + xsd:integer(SUBSTR(?nohyphen, 5, 1)) + xsd:integer(SUBSTR(?nohyphen, 6, 1)) * 3 + xsd:integer(SUBSTR(?nohyphen, 7, 1)) + xsd:integer(SUBSTR(?nohyphen, 8, 1)) * 3 + xsd:integer(SUBSTR(?nohyphen, 9, 1)) + xsd:integer(SUBSTR(?nohyphen, 10, 1)) * 3 + xsd:integer(SUBSTR(?nohyphen, 11, 1)) + xsd:integer(SUBSTR(?nohyphen, 12, 1)) * 3 + xsd:integer(SUBSTR(?nohyphen, 13, 1)) AS ?checksum) . FILTER(FLOOR(?checksum / 10) != (?checksum / 10)) }