« Modèle:Bucket » : différence entre les versions
De Semantic MediaWiki - Sandbox
m (subobject use) Balise : Éditeur de wikicode 2017 |
|||
(25 versions intermédiaires par 2 utilisateurs non affichées) | |||
Ligne 5 : | Ligne 5 : | ||
* [[Property:Has fishName]] | * [[Property:Has fishName]] | ||
* [[Property:Has fishHeight]] | * [[Property:Has fishHeight]] | ||
and subobjects see | |||
* [[Property:Has subobject]] | |||
see | see | ||
* https://www.semantic-mediawiki.org/wiki/Help:Adding_subobjects | * https://www.semantic-mediawiki.org/wiki/Help:Adding_subobjects | ||
* https://www.semantic-mediawiki.org/wiki/Help:Subobjects_and_queries | |||
* https://www.semantic-mediawiki.org/wiki/Examples/Queries/Subobject_to_display_table_rows | |||
= Example Queries = | |||
== Has fishes == | |||
<pre> | |||
{{#ask: | |||
[[Has fishes::+]] | |||
|?Has fishes= | |||
|format=plainlist | |||
|mainlabel=- | |||
|link=none | |||
}} | |||
</pre> | |||
{{#ask: | |||
[[Has fishes::+]] | |||
|?Has fishes= | |||
|format=plainlist | |||
|mainlabel=- | |||
|link=none | |||
}} | |||
== FishBucket == | |||
<pre> | |||
{{#ask: | |||
[[Has subobject::FishBucket]] | |||
|?Has fishName | |||
|format=table | |||
}} | |||
</pre> | |||
{{#ask: | |||
[[Has subobject::FishBucket]] | |||
|?Has fishName | |||
|format=table | |||
}} | |||
= Source = | |||
<pre> | |||
{{#subobject: | |||
|Has fishes={{{fishes|none}}}|+sep=, | |||
}} | |||
{{#ask: | |||
[[-Has subobject::{{FULLPAGENAME}}]] | |||
|format=template | |||
|template=fishrow | |||
}} | |||
</pre> | |||
[[Category:Fish]] | [[Category:Fish]] | ||
</noinclude> | </noinclude> | ||
<includeonly> | <includeonly> | ||
{{#subobject: | {{#subobject:- | ||
| Has fishes={{{fishes|none}}}|+sep=, | | Has fishes={{{fishes|none}}}|+sep=, | ||
}} | }} | ||
{{#ask: | {{#ask: | ||
[[-Has subobject::{{FULLPAGENAME}}]] | [[-Has subobject::{{FULLPAGENAME}}]] | ||
| | |format=template | ||
|template=fishrow | |||
| | |||
}} | }} | ||
</includeonly> | </includeonly> |
Dernière version du 3 janvier 2019 à 21:55
This is the bucket template as outlined in https://stackoverflow.com/questions/53949963/can-i-use-a-propertys-value-as-a-query-in-semantic-mediawiki It uses the properties
and subobjects see
see
- https://www.semantic-mediawiki.org/wiki/Help:Adding_subobjects
- https://www.semantic-mediawiki.org/wiki/Help:Subobjects_and_queries
- https://www.semantic-mediawiki.org/wiki/Examples/Queries/Subobject_to_display_table_rows
Example Queries
Has fishes
{{#ask: [[Has fishes::+]] |?Has fishes= |format=plainlist |mainlabel=- |link=none }}
Fish Page, Another Fish Page, Trout Page
FishBucket
{{#ask: [[Has subobject::FishBucket]] |?Has fishName |format=table }}
Source
{{#subobject: |Has fishes={{{fishes|none}}}|+sep=, }} {{#ask: [[-Has subobject::{{FULLPAGENAME}}]] |format=template |template=fishrow }}