Query for Pages with subobjects

From semantic-mediawiki.org

OK, so the first part is a template (Vorlage:EDV-Projekte) that adds property values directly to the page. Maybe there's something wrong with your template. Could you check with 'Attribute anzeigen' to see if the values are correctly stored at all?

09:28, 18 March 2015

No! The properties are not show on the page Special:Properties. Only the properties from the subobject part. my form looks like this:

{{{for template|EDV-Projekte}}}
{| class="formtable"
! Projektname:
| colspan="2"|{{{field|Name|mandatory}}}
|-
! Ziel:
| colspan="2"|{{{field|Ziel|mandatory|input type=textarea}}}
|-
! Kategorie:
| colspan="2"|{{{field|Kat|mandatory|input type=combobox|autocomplete|values=B2B,Controlling,DMS-Windream,Informationsplattform,IT-Infrastruktur,Organisation,Reporting,SANGROSS,Schulung,Sonstiges, Support}}}
|-
! Aufwand:
| colspan="2"|{{{field|Aufwand}}}
|-
! Team:
| colspan="2"|{{{field|Team|input type=combobox|autocomplete|size=20|values=BUC-ZIM,BUC-SCM,SCM-ZIM,HOK-SCM}}}
|-
! Priorität:
| colspan="2"|{{{field|Prio|input type=combobox|autocomplete|size=6|values=1,2,3,4,X}}}
|-
! Zieltermin - Plan:
| width="100px"|{{{field|PlanM|input type=combobox|autocomplete|size=10|values=Jan,Feb,Mär,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez}}}
|{{{field|PlanY|input type=combobox|autocomplete|size=12|values=2012,2013,2014,2015,2016,2017,2018,2019,2020}}}
|-
! Zieltermin - aktuell:
| width="100px"|{{{field|IstM|input type=combobox|autocomplete|size=10|values=Jan,Feb,Mär,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez}}}
|{{{field|IstY|input type=combobox|autocomplete|size=12|values=2012,2013,2014,2015,2016,2017,2018,2019,2020}}}
|-
! Kommentar:
| colspan="2"|{{{field|Kom|input type=textarea}}}
|-
! Status:
| colspan="2"|{{{field|Status|mandatory|input type=combobox|autocomplete|values=unbearbeitet,im Plan,im Verzug,neuer Termin,zurückgestellt,abgeschlossen}}}
|-
! Anmerkungen:
| colspan="2"|{{{field|Anm|input type=textarea}}}
|}
{{{end template}}}

{{{for template|#subobject:|label=Teilprojekte / Aufgaben|multiple}}}
{|
!'''Bezeichnung:'''
|{{{field|subobject|hidden|default=}}}{{{field|Bezeichnung|mandatory}}}
|-
!'''Bearbeiter:'''
|{{{field|Bearbeiter|input type=combobox|autocomplete|size=6|values=CB,KH,MS,MZ}}}
|-
!'''Datum:'''
|{{{field|Datum|input type=datepicker|date format=dd.mm.yy}}}
|-
! '''Status:'''
| {{{field|Status|input type=combobox|autocomplete|values=unbearbeitet,im Plan,im Verzug,neuer Termin,zurückgestellt,abgeschlossen}}}
|-
! '''Fällig bis:'''
| {{{field|FaelligBis|input type=datepicker|date format=dd.mm.yy}}}
|-
|'''Anmerkungen:'''
|{{{field|Anmerkungen|input type=textarea}}}{{{field|TeilProjekt|hidden|default={{PAGENAME}} }}}
|}
{{{end template}}}

{{{standard input|save}}} {{{standard input|preview}}} {{{standard input|changes}}} {{{standard input|cancel}}}

and the template like this:

{|
 |width="50px"|'''Projektname:'''||<span style="font-size:x-large; text-shadow:grey 3px 2px 4px; color:darkblue;">'''{{{Name|}}}'''</span>
 |-
 |'''Ziel:'''||'''{{{Ziel|}}}
 |-
 |-
 |Kategorie:||{{{Kat|}}}
 |-
 |Aufwand:||{{{Aufwand|}}}
 |-
 |Team:||{{{Team|}}}
 |-
 |Priorität:||{{{Prio|}}}
 |-
 |Zieltermin - Plan:||{{{PlanM|}}} {{{PlanY|}}}
 |-
 |Zieltermin - aktuell:||{{{IstM|}}} {{{IstY|}}}
 |-
 |Kommentar:||{{{Kom|}}}
 |-
 |'''Status:'''||'''{{{Status|}}}
 |-
 |Anmerkungen:||{{{Anm|}}}
 |}

[[Image:Part01.png|25 px|link=]] <big>'''Teilprojekte / Aufgaben:'''</big>

{{#ask: [[-Has subobject::{{PAGENAME}}]] 
| mainlabel=-
| ?Bezeichnung
| ?Bearbeiter
| ?Datum
| ?Status
| ?FaelligBis = Fällig bis
| ?Anmerkungen
| index=0
| link=subject
| headers=show
| format=datatable
| class=sortable wikitable smwtable
| default=keine Teilprojekte / Aufgaben gefunden
}}

09:39, 18 March 2015

To judge by your template, you haven't provided any semantic properties for those values so it is only to be expected that there are no semantic annotations. In your template, you could add a 'silent' form of annotation to your template, such as

{{#set:
|Ziel={{{Ziel|}}}
|Aufwand={{{Aufwand|}}}
.....
}}

(etcetera .. you could fill in the rest)

For our user manual on creating semantic content, see Editing.

Unusually enough, it looks like you also have a template named after the subobject parser, or perhaps there is no template at all and the form adds subobjects directly. I'm surprised that it works, but this isn't exactly the recommended way to go about.

All of this suggests as though you are confusing MW's templates and SMW's syntax functions. Are you aware of the differences?

10:48, 18 March 2015

I added the 'silent' form of annotation and IT WORKS - thank you very much.

Hmm I thought that I know the differences but it looks like I need some more studies to know how it works and how to use it.

13:23, 18 March 2015

It is recommended that you have a look at the examples cited in Help:Subobjects and queries.

If you think the examples are insufficient in order to understand how queries work, you might want to help out/point out where documentation needs improvement so others can participate.

17:26, 18 March 2015