Hello Lourens,
> FOR (sparql select ?labl (lang(?labl)) where {$:subject
> skos:prefLabel ?labl}) DO {
> ^^^^^^^^^^ HOW DO I GET THE
> lang(?labl) VALUE?
The syntax is
FOR (sparql select ?labl (lang(?labl)) as ?lang_of_labl where ... ) DO
and use "labl" and "lang_of_labl", better enclosed in double quotes,
inside the loop body. The reason for "lang_of_labl", not just
lang_of_labl is that SPARQL's variable names are always case-sensitive,
according to the spec, whereas case sensitivity of SQL variables depends
on CaseMode setting of [Parameters] section of virtuoso.ini
configuration file. To avoid troubles like "it compiles only at one of
two databases", double quotes are quite useful there.
Best Regards,
Ivan Mikhailov
OpenLink Software
http://virtuoso.openlinksw.com