Property talk:P3962

From Wikidata
Jump to navigation Jump to search

Documentation

Global Trade Item Number
GTIN (or EAN, UCC) is used to identify products via their barcodes
[create Create a translatable help page (preferably in English) for this property to be included here]
Format “\d{8}(\d{4,6})?: value must be formatted using this pattern (PCRE syntax). (Help)
List of violations of this constraint: Database reports/Constraint violations/P3962#Format, hourly updated report, SPARQL
Distinct values: this property likely contains a value that is different from all other items. (Help)
List of violations of this constraint: Database reports/Constraint violations/P3962#Unique value, hourly updated report, SPARQL (every item), SPARQL (by value)
Allowed entity types are Wikibase item (Q29934200): the property may only be used on a certain entity type (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P3962#Entity types
Scope is as main value (Q54828448): the property must be used by specified way only (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P3962#Scope, SPARQL
Conflicts with “ISBN-13 (P212): this property must not be used with the listed properties and values. (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P3962#Conflicts with P212, search, SPARQL
Trailing check digit in a GTIN must be correct
Algorithm for checking whether the trailing check digit is correct (Help)
Violations query: SELECT ?item WHERE { ?item wdt:P3962 ?GTIN. BIND(CONCAT("000000", ?GTIN) AS ?extended). BIND(SUBSTR(?extended, STRLEN(?extended) - 13, 14) AS ?padded). BIND(xsd:decimal(SUBSTR(?padded, 1, 1)) AS ?digit1). BIND(xsd:decimal(SUBSTR(?padded, 2, 1)) AS ?digit2). BIND(xsd:decimal(SUBSTR(?padded, 3, 1)) AS ?digit3). BIND(xsd:decimal(SUBSTR(?padded, 4, 1)) AS ?digit4). BIND(xsd:decimal(SUBSTR(?padded, 5, 1)) AS ?digit5). BIND(xsd:decimal(SUBSTR(?padded, 6, 1)) AS ?digit6). BIND(xsd:decimal(SUBSTR(?padded, 7, 1)) AS ?digit7). BIND(xsd:decimal(SUBSTR(?padded, 8, 1)) AS ?digit8). BIND(xsd:decimal(SUBSTR(?padded, 9, 1)) AS ?digit9). BIND(xsd:decimal(SUBSTR(?padded, 10, 1)) AS ?digit10). BIND(xsd:decimal(SUBSTR(?padded, 11, 1)) AS ?digit11). BIND(xsd:decimal(SUBSTR(?padded, 12, 1)) AS ?digit12). BIND(xsd:decimal(SUBSTR(?padded, 13, 1)) AS ?digit13). BIND(xsd:decimal(SUBSTR(?padded, 14, 1)) AS ?digit14). BIND(?digit1 * 3 + ?digit2 + ?digit3 * 3 + ?digit4 + ?digit5 * 3 + ?digit6 + ?digit7 * 3 + ?digit8 + ?digit9 * 3 + ?digit10 + ?digit11 * 3 + ?digit12 + ?digit13 * 3 AS ?sum). BIND(xsd:decimal(SUBSTR(xsd:string(?sum), STRLEN(xsd:string(?sum)), 1)) AS ?lastsumdigit). BIND(IF(?lastsumdigit = 0, 0, 10 - ?lastsumdigit) AS ?checkdigit). FILTER(?digit14 != ?checkdigit) } LIMIT 1000
List of this constraint violations: Database reports/Complex constraint violations/P3962#Trailing check digit in a GTIN must be correct
GTIN matches ISBN
Use ISBN-13 (P212) instead of Global Trade Item Number (P3962) for published works. (Help)
Violations query: SELECT ?item ?value ?value2 { ?item wdt:P3962 ?value . ?item wdt:P212 ?value2 . FILTER( ?value = REPLACE(?value2, "-", "") ) }
List of this constraint violations: Database reports/Complex constraint violations/P3962#GTIN matches ISBN

Relation to ISBN-13 (P212)[edit]

What's the plan for items with the same value? The query above finds ca. 250. --- Jura 12:13, 10 February 2022 (UTC)[reply]

Actually there is Property:P212#P1647 [1], which would mean we shouldn't have P3962 if P212 is present. Accordingly, the P3962 statements can be deleted. --- Jura 12:48, 11 February 2022 (UTC)[reply]