Help:Type Record/Searching a record

Semantic search
Using record properties for searching pages can be done in a similar fashion as for all other properties; see Help:Semantic search. As with any property, you can use the + wildcard to select all pages with some value for a record property, for example. To find pages that match a particular value for some of the fields of the record, just list the values to match, separated by semicolons. If you do not care about the value of one of the datatypes, use ? to match any value for it including omitted.

The values given for fields in a record query are written according to the datatype of the field. For most datatypes, this means that comparators such as ! for not, < for less than or equal to can be used with each field.

For example, selects values for the property Employment with any value for the employer string, where the title string is not "professorship", the start date is before July 1950, and with any value for end date.

Regarding the printouts, there are 2 alternative methods to display the distinct field values of record properties:

 Either using the printout parameter :



Or using the Help:Property_chains_and_paths syntax:CiteRef::gh:smw:1824

 

The above hypothetical case assumes that country pages are annotated with multiple  record properties. The results would be like that:
 * 1st column: the complete record,
 * 2nd column: shows only the first field (name),
 * 3rd & 4th column: show that second and third fields, respectively, start and end of office.

Note that the only result of this query is the page "U.S.A" so the table has a single row that shows all of this page's values for, not many rows for each president. The latter cannot be achieved with records.

Note also that this might result in some unintuitive query results. While SMW query constraints are applied to select matching Wiki pages: the final result set will contain all employments of these matching Wiki pages - even those which do not satisfy the query constraints - due to the way SMW deals with records in queries (i.e., query constraints are used to match pages, and in a second steps, all values of the property under consideration are returned - irrespective of if they satisfy query constraints).