Template:All instances
Experimental template.
Generates a query to lists instances of some classes, in an expanded way. More precisely explore the possibility to do something similar to what does Reasonator with « is a list of (P360) » with classes item of Wikidata. The idea is to find items from statements in the class item.
Explanation
editSimple example
editA concrete example with: COMMAND.COM command (Q50320434) (inspired from : this discussion). This items has the statement:
part of (P361) ⟨ COMMAND.COM (Q971787) ⟩
The template call {{All instances|Q50320434}}
will generate this WDQS query that will find all items that either have an instance of (P31) statement to COMMAND.COM command (Q50320434) or are commands and have a statement part of (P361) : COMMAND.COM command (Q50320434).
General principle
editThe general idea is to use such statement in the class item and in its parent classes as well to find additional instances of that class. The statements are currently statements of the form
property1 Search ⟨ value1 ⟩
property2 Search ⟨ value2 ⟩
… Search ⟨ … ⟩
Statements of this forms in the parent classes are also used.
The statements of the additional instances looks like :
Definitions:
- explicit instance item of a class
- an explicit instance item is an item of a class-item C an item who has a instance of (P31) statement with value C or to any of its (explicit) subclasses-item.
- implicit instance item of a class
- an implicit instance item which is not an explicit instance of C, but is an instance (either explicit or implicit) of some explicit parent class of C and has one statement for each qualifier/value pairs of the -like statements of C whose main snak has the same values as the qualifier/value pair.
The generated query computes the set of implicit and explicit instances of the class
Future work
editThey includes :
- generating a (partial ?) query to find all the instances, explicit or not (make the union of
?item instance of/subclass of* <class>
and the result of the presently computed query) - submit the idea to community, what is the status wrt. « is a list of » ? is has quality Search a good choice to do this, or maybe properties for this type (P1963) _? The advantage of the latter is that it has a property datatype. This allows to put the property as the main value of the statement and allows a richer description of the statements than just the main snak, like describing qualifiers or value restriction like in owl value restriction. It may become quite complex and overlap with the wikidata constaint system, however.
Usage
edit{{All instances|Q50320434|all instances of
{{Q|Q50320434}}
}}
all instances of COMMAND.COM command
See also
editThe above documentation is transcluded from Template:All instances/doc (edit | history). Editors can experiment in this template's sandbox (create | mirror) and testcases (create) page. Please add categories to the /doc subpage. Subpages of this template. |