Property talk:P2364

From Wikidata
Jump to navigation Jump to search

Documentation

production code
production code of a television episode
[create Create a translatable help page (preferably in English) for this property to be included here]
Single value: this property generally contains a single value. (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303). Known exceptions: Lost City (Q3207489)
List of violations of this constraint: Database reports/Constraint violations/P2364#Single value, SPARQL
Format “[A-Z0-9./-]+: value must be formatted using this pattern (PCRE syntax). (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/P2364#Format, SPARQL
Scope is as main value (Q54828448): the property must be used by specified way only (Help)
List of violations of this constraint: Database reports/Constraint violations/P2364#Scope, hourly updated report, SPARQL
Format “.{1,50}|: value must be formatted using this pattern (PCRE syntax). (Help)
List of violations of this constraint: Database reports/Constraint violations/P2364#Format, hourly updated report, SPARQL
Item “instance of (P31): Items with this property should also have “instance of (P31)”. (Help)
List of violations of this constraint: Database reports/Constraint violations/P2364#Item P31, hourly updated report, search, SPARQL
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/P2364#Conflicts with P31, SPARQL
Allowed entity types are Wikibase item (Q29934200), Wikibase MediaInfo (Q59712033): 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/P2364#Entity types
Codes that are not mere numbers are generally unique
TODO: fix code or define applicable exceptions (Help)
Violations query: SELECT (SAMPLE(?entity) as ?item) ?value (COUNT(DISTINCT ?entity) as ?ct) (GROUP_CONCAT(DISTINCT(strafter(str(?entity), "/entity/"));separator=", ") as ?items) (GROUP_CONCAT(DISTINCT(?entityLabel);separator=" // ") as ?itemLabels) (GROUP_CONCAT(DISTINCT(?seriesLabel);separator=" // ") as ?seriesLabels) WHERE { ?value ^wdt:P2364 ?entity . SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . ?entity rdfs:label ?entityLabel . ?value rdfs:label ?valueLabel . ?series rdfs:label ?seriesLabel } . FILTER ( !REGEX(STR(?value), "^\\d{1,4}$") ) ?entity wdt:P179 ?series . FILTER ( ?entity not in ( wd:Q4115189,wd:Q13406268,wd:Q15397819 ) ) } GROUP BY ?value HAVING (?ct>1) ORDER BY DESC(?ct) LIMIT 500
List of this constraint violations: Database reports/Complex constraint violations/P2364#Codes that are not mere numbers are generally unique
Codes should be unique within a series
TODO: add missing series statements, fix code or define applicable exceptions (Help)
Violations query: SELECT DISTINCT ?item ?itemLabel ?item2 ?item2Label ?productioncode ?series ?seriesLabel ?age { ?item wdt:P2364 ?productioncode ; wdt:P179 ?series . ?item2 wdt:P2364 ?productioncode ; wdt:P179 ?series . FILTER( ?item != ?item2 && str(?item) > str(?item2) ) . FILTER( ?item not in ( wd:Q4115189,wd:Q13406268,wd:Q15397819 ) ) SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } BIND(IF(?item in (wd:Q14508187,wd:Q7758715),"<2018","") as ?age) } ORDER BY ?age ?seriesLabel ?productioncode LIMIT 500
List of this constraint violations: Database reports/Complex constraint violations/P2364#Codes should be unique within a series
The Simpsons
(Help)
Violations query: SELECT ?item ?value { ?item wdt:P2364 ?value. ?item wdt:P179 wd:Q886. FILTER(REGEX( STR( ?value ), "^([A-Z0-9\\.\\/-]{4,6})$" ) = false) }
List of this constraint violations: Database reports/Complex constraint violations/P2364#The Simpsons
Check format
(suggestion) (Help)
Violations query: SELECT ?item ?value ?serie { ?item wdt:P2364 ?value. ?item wdt:P179 ?serie. FILTER NOT EXISTS { ?item wdt:P179 wd:Q23043159 } # complex FILTER NOT EXISTS { ?item wdt:P179 wd:Q23043149 } # O M G FILTER(REGEX( STR( ?value ), "^(BFPDWLS|T\\d*|DWUN|BDU|DACX|BABE|3ABE|.ABE|CACX|1ACX|6ATS|AACX|9ACX|7AJN|.AJN|.ARC|.AKJ|.ACV|.ADH|.ACV|.WAH|2T|2J|2ATS|INS|4C|MPI|1WBF|BFPDWCDMG|4X|.AYD|.ACX|.ABB|.X51|06-0\\d-|.ALH|.ABX|173-|3T|1\\.|9ATS|.ATS|S|.AFF|5V|60043-|6149\\-|3X|\\d\\d\\d\\d\\d?-|.APK|.AGE|.[A-Z]{3}|1X|\\d\\.|2X|BDH|3J|4V|4E|5C|5E|T13\\.|SS|V0|5X|..?ARG|E|T\\d\\d\\.|BDH\\d\\d\\d\\/S|6149-16.|692-|[AB]|TBA|XAA|BFPUNIT..|MG|XFO0|XCK0|XAR0|AR0|HOC-|BFPDWCC|62015-08-|)\\d*$" ) = false) FILTER(REGEX( STR( ?value ), "^([A-Z0-9\\.\\/-]+)$" ) ) FILTER(REGEX( STR( ?value ), "^([A-Z0-9\\.\\/-]{4,6})$" ) = false) FILTER NOT EXISTS { ?item wdt:P31 wd:Q21664088 } # avoid wd:Q60740904, ie: 411-412 }
List of this constraint violations: Database reports/Complex constraint violations/P2364#Check format

Values are not unique[edit]

Please do not set a unique-value requirement for this property. Many items will have the same production codes, for example 201 for the first episode of a second season.

Setting this as unique will generate many false constraint violation reports.

The values are only unique within a series, and we have no means to do that kind of validation, unless someone knows better. Danrok (talk) 01:16, 12 October 2016 (UTC)[reply]

I tried to refine the constraint with two complex ones.
--- Jura 11:55, 19 October 2016 (UTC)[reply]