Property talk:P5236

From Wikidata
Jump to navigation Jump to search

Documentation

prime factor
one of the prime numbers that can be multiplied to give this number
[create Create a translatable help page (preferably in English) for this property to be included here]
Type “natural number (Q21199): item must contain property “instance of (P31)” with classes “natural number (Q21199)” or their subclasses (defined using subclass of (P279)). (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303). Known exceptions: 1 (Q199)
List of violations of this constraint: Database reports/Constraint violations/P5236#Type Q21199, SPARQL
Value type “prime number (Q49008): This property should use items as value that contain property “instance of (P31)”. On these, the value for instance of (P31) should be an item that uses subclass of (P279) with value prime number (Q49008) (or a subclass thereof). (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/P5236#Value type Q49008, SPARQL
Item “numeric value (P1181): Items with this property should also have “numeric value (P1181)”. (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/P5236#Item P1181, SPARQL
Qualifiers “quantity (P1114), reason for deprecated rank (P2241): this property should be used only with the listed qualifiers. (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/P5236#allowed qualifiers, SPARQL
Property “prime factor (P5236)” declared by target items of “prime factor (P5236): If [item A] has this property with value [item B], [item B] is required to have property “prime factor (P5236)”. (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/P5236#Target required claim P5236, SPARQL, SPARQL (by value)
None of 1 (Q199): value must not be any of the specified items.
Replacement property:
Replacement 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/P5236#none of, SPARQL
Item “number of decimal digits (P7316): Items with this property should also have “number of decimal digits (P7316)”. (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/P5236#Item P7316, SPARQL
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/P5236#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/P5236#Scope, SPARQL
Items with self-links should be prime numbers
(Help)
Violations query: SELECT ?item { ?item wdt:P5236 ?item . MINUS { ?item wdt:P31 wd:Q49008 } } LIMIT 100
List of this constraint violations: Database reports/Complex constraint violations/P5236#Items with self-links should be prime numbers
Items with prime factor 2 should be even numbers
(Help)
Violations query: SELECT ?item { ?item wdt:P5236 wd:Q200 . MINUS { ?item wdt:P31 wd:Q13366104 } } LIMIT 100
List of this constraint violations: Database reports/Complex constraint violations/P5236#Items with prime factor 2 should be even numbers
Check on numeric values
FIXME. Currently just sum of factors, not product nor qualifier. See Wikidata:Request_a_query#Multiplication_(a*b*c)/PRODUCT()_instead_of_SUM(?factor) (Help)
Violations query: SELECT ?item ?value (SUM(?factor) as ?a) (GROUP_CONCAT(?factor;separator="*") as ?product) WHERE { ?item wdt:P5236 / wdt:P1181 ?factor . ?item wdt:P1181 ?value . } GROUP BY ?item ?value HAVING ( ?a > ?value )
List of this constraint violations: Database reports/Complex constraint violations/P5236#Check on numeric values
A factor should be listed just once
Use qualifier "quantity" instead (Help)
Violations query: SELECT ?item ?factor { hint:Query hint:optimizer "None". ?item p:P5236 ?st1 . ?st1 ps:P5236 ?factor . ?item p:P5236 ?st2 . ?st2 ps:P5236 ?factor . FILTER( ?st1 != ?st2 ) } LIMIT 100
List of this constraint violations: Database reports/Complex constraint violations/P5236#A factor should be listed just once
Check value of factors
Doesn't work for very large numbers (Help)
Violations query: SELECT ?item ?value { ?item wdt:P5236 ?factor ; wdt:P1181 ?value . ?factor wdt:P1181 ?factorvalue . FILTER ( ?value < 9223372036854775807 ) FILTER( round ( ?value / ?factorvalue ) != ( ?value / ?factorvalue ) ) } LIMIT 100
List of this constraint violations: Database reports/Complex constraint violations/P5236#Check value of factors
Even numbers should have prime factor 2
(Help)
Violations query: SELECT ?item { ?item wdt:P31 wd:Q13366104 . MINUS { ?item wdt:P5236 wd:Q200 } } LIMIT 500
List of this constraint violations: Database reports/Complex constraint violations/P5236#Even numbers should have prime factor 2
Natural numbers would generally have this property
(Help)
Violations query: SELECT ?item { ?item wdt:P31 wd:Q21199 . MINUS { ?item wdt:P5236 [] } } LIMIT 1000
List of this constraint violations: Database reports/Complex constraint violations/P5236#Natural numbers would generally have this property

In case power of prime factor is 1[edit]

@ArthurPSmith: Is it need to use qualifier quantity (P1114) when the power of prime factor is 1? Or is it redundant? I think whichever's good, but we have to unify the data format. --Okkn (talk) 01:44, 5 June 2018 (UTC)[reply]

Probably redundant... It does make things a little more compact to leave it out. ArthurPSmith (talk) 14:06, 5 June 2018 (UTC)[reply]

@Okkn, ArthurPSmith I see that a lot of data about numbers is redundant, e.g., 2 (Q200) is an instance of Sophie Germain prime (Q624025) but also of prime number (Q49008) though Sophie Germain prime (Q624025) is a subclass of prime number (Q49008). Is this desired? Type constraint: “Entities using the prime factor property should be instances of positive integer (or of a subclass of it), but RSA-100 currently isn't.” – But RSA-100 (Q15990637) is an instance of RSA number (Q1072840) which is a subclass of almost prime (Q936614) which is a subclass of composite number (Q50707) which is a subclass of positive integer (Q28920044), does this not suffice? (On another note, Eisenstein prime (Q898675) is currently a subclass of prime number (Q49008) but there are Eisenstein primes that are not prime numbers in the normal sense; I think prime element (Q240651) would be better.) -- IvanP (talk) 17:22, 5 June 2018 (UTC)[reply]

@IvanP: at least some of those things have been fixed since the last time the constraint check ran, it's often out of date. ArthurPSmith (talk) 18:09, 5 June 2018 (UTC)[reply]
As to the general question of P31 relations for the numbers, one should be careful as the precise definitions may not quite overlap - there are issues of whether 0 or negative numbers, or negative powers are included in the precise class, etc. But yes, in cases where it is clear I would say that it is sufficient to just say for example 2 is a particular subclass of prime rather than also state that it is prime. ArthurPSmith (talk) 18:12, 5 June 2018 (UTC)[reply]
I would propose to use the qualifier for homogeneity. --Infovarius (talk) 08:08, 6 June 2018 (UTC)[reply]

Checks on values[edit]

See Property talk:P5236/checks. --- Jura 18:49, 13 September 2019 (UTC)[reply]