Search code examples
mediawikiwikipediawiki

Semantic Mediawiki: writing a query that returns all the suboject defined in a page


I've implemented a page with a long list of subojects. The properties are correctly visibile. Now I'm trying to query that list but my first query attempt doesn't work.

{{#ask:
 [[Categoria:Marco Crepaldi]]
 |?Titolo
}}

{{#ask:[[Has subobject::text property]]
 |?Titolo
}}

Solution

  • I've found the solution with the help of @IRA1777

    {{#ask:
     [[-Has subobject::{{FULLPAGENAME}}]] 
     |?Tags
     |?Titolo
     | mainlabel=-
    }}
    

    MainLabel removes the first column (which was filled with the name of the page containing the subobjects)

    For who understands SQL the query reads more or less as:

    SELECT Tags, Titolo
    FROM subobject s
    WHERE s.ParentPage = {{FULLPAGENAME}}