« Test Subobject 0001 » : différence entre les versions

De Semantic MediaWiki - Sandbox

(Page créée avec « {{Test Subobject 0001 |SO-ID=1 |SO-Name=ABC |SO-Status=Test }} {{Test Subobject 0001 |SO-ID=2 |SO-Name=DEF |SO-Status=Test }} {{#ask: [[-Has subobject::{{FULLPAGE}}]]... »)
 
Aucun résumé des modifications
Balise : Éditeur de wikicode 2017
 
(14 versions intermédiaires par 2 utilisateurs non affichées)
Ligne 1 : Ligne 1 :
'''This page contains to subobjects as defined by the template [[Modèle:Test_Subobject_0001]].'''
{{Test Subobject 0001
{{Test Subobject 0001
|SO-ID=1
|SO-ID=1
Ligne 11 : Ligne 13 :
}}
}}


{{#ask: [[-Has subobject::{{FULLPAGE}}]]
'''Then there is an inline query with '''
            |?Has number
<syntaxhighlight>[[Has subobject::{{{FULLPAGENAME}}}]]</syntaxhighlight>
            |?Has name
 
            |?Has Status
{{#ask: [[Has subobject::{{{FULLPAGENAME}}}]]
            |default=No Subobject found
      |?Has number = SO-ID
      |?Has name   = SO-Name
      |?Has Status = SO-Status
      |default     = No Subobject found
}}
}}
'''Followed by an inline query with '''
<syntaxhighlight>[[Has subobject::+]] [[Has name::+]]  [[Has Status::+]]</syntaxhighlight>
{{#ask: [[Has subobject::+]] [[Has name::+]] [[Has Status::+]]
      |?Has number = SO-ID
      |?Has name  = SO-Name
      |?Has Status = SO-Status
      |default    = No Subobject found
}}
== Notes ==
There are several issues in how you use/apply subobjects (and the #ask) query.
First of all, the template [[Modèle:Test_Subobject_0001]] uses `::` as notation which is not supported, please see the documentation (e.g. Has number=...).
<pre><nowiki>
{{#subobject:Test Subobject 0001 with {{{SO-ID|}}}
            |Has number::{{{SO-ID|}}}
            |Has name::{{{SO-Name|}}}
            |Has status::{{{SO-Status|}}}
}}
</nowiki></pre>
Secondly, <nowiki>{{#ask: [[Has subobject::{{{FULLPAGENAME}}}]] </nowiki> is not going to work because the subobject is not identified as `Test_Subobject_0001`. If you insist on using  <nowiki>{{{FULLPAGENAME}}}</nowiki> you have to use the inverted form as in <nowiki>[[-Has subobject::{{{FULLPAGENAME}}}]]</nowiki>.
== Thanks for the advice ==
Your are right and I wonder why I did not see this when comparing my working definition and query with the not working ones. I belive that one gets sometimes somehow blind for the code one has written.

Dernière version du 12 juillet 2018 à 14:18

This page contains to subobjects as defined by the template Modèle:Test_Subobject_0001.

Then there is an inline query with

[[Has subobject::{{{FULLPAGENAME}}}]]

No Subobject found

Followed by an inline query with

[[Has subobject::+]] [[Has name::+]]  [[Has Status::+]]

No Subobject found

Notes

There are several issues in how you use/apply subobjects (and the #ask) query.

First of all, the template Modèle:Test_Subobject_0001 uses `::` as notation which is not supported, please see the documentation (e.g. Has number=...).

{{#subobject:Test Subobject 0001 with {{{SO-ID|}}}
            |Has number::{{{SO-ID|}}}
            |Has name::{{{SO-Name|}}}
            |Has status::{{{SO-Status|}}}
}}

Secondly, {{#ask: [[Has subobject::{{{FULLPAGENAME}}}]] is not going to work because the subobject is not identified as `Test_Subobject_0001`. If you insist on using {{{FULLPAGENAME}}} you have to use the inverted form as in [[-Has subobject::{{{FULLPAGENAME}}}]].

Thanks for the advice

Your are right and I wonder why I did not see this when comparing my working definition and query with the not working ones. I belive that one gets sometimes somehow blind for the code one has written.

Les cookies nous aident à fournir nos services. En utilisant nos services, vous acceptez notre utilisation de cookies.