Template:LabelStartsWith

Documentation icon Template documentation[view · edit · history · purge ]

This template generates is a partial query that filters items whose label in a language begins by some string. Can be used in conjunction with other partial queries and/or in any sparql query.

Variable naming edit

Variable naming is the same as {{Labelled}}, so something like ?itemLabelIt in the example below.

Usage edit

    ?item rdfs:label ?itemLabelIt filter (lang(?itemLabelIt) = "it"&& strstarts(?item, "Paris"))

In context :

select ?item where { {{tl|LabelStartsWith|item|Paris|it}} }

will give

select ?item where { 
     ?item rdfs:label ?itemLabelIt filter (lang(?itemLabelIt) = "it"&& strstarts(?item, "Paris")) }
Try it!

See also edit

Partial query to filter items with a label that starts with a certain string in a language.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
item1 item

item variable name or item id

Suggested values
?item
Example
?item
Stringrequired
22 string

beginnig string of the label to search

Example
Julius
Stringrequired
lang3

language code of the label

Example
ja
Auto value
{{int:lang}}
Stringrequired
    ?{{{1}}} rdfs:label ?{{{1}}}Label{{{3}}} filter (lang(?{{{1}}}Label{{{3}}}) = "{{{3}}}"&& strstarts(?{{{1}}}, "{{{2}}}"))