Hi Lourens,
In general, when you run any sort of function ( aggregate, built-in,
etc ) in the projection part of the query you should also define an
alias for the variable using AS {varName}
select count(?s) as ?count_s ...
select ?s lang(?label) as ?lang ?p ?o
for example:
select
?s
?label
(lang(?label)) as ?lang
where
{
?s rdfs:label ?label .
}
limit 1
On Sat, Nov 28, 2009 at 8:53 AM, Lourens van der Meij <[email protected]> wrote:
> I am trying to get the hang of VSP and am currently a bit stuck on
> getting info from sparql queries in FOR constructs.
> Named variables are ok, but how do I get
> select (lang(?label)) count(..) ...
> values?
>
> A part of my VSP code(I got '$:subject' from a surrounding "FOR (sparql
> select .."):
> <td>
> <?vsp
> FOR (sparql select ?s_type where {$:subject a ?s_type}) DO {
> if (s_type = 'http://www.w3.org/2004/02/skos/core#Concept') {
> http('preflabels:');
> declare nr int;
> nr := 0;
> FOR (sparql select ?labl (lang(?labl)) where {$:subject
> skos:prefLabel ?labl}) DO {
> ^^^^^^^^^^ HOW DO I GET THE
> lang(?labl) VALUE?
> if (nr > 0 ) { http_value(',');}
> http_value(labl);
> nr := nr + 1;
> }
> } else if (s_type =
> 'http://data.catchplus.nl/rdf/config/ConceptSchemeGroup') {
> ...
>
> I would like access to sparql select values that are not named, here:
> "(lang(?labl))" from outside the sparql query.
>
> Also, are there more VSP example programs outside of the virtdocs.pdf
> and online parts of
> that document?
>
> Thanks,
>
> Lourens
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Virtuoso-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
>
--
Aldo Bucchi
skype:aldo.bucchi
http://www.univrz.com/
http://aldobucchi.com/
PRIVILEGED AND CONFIDENTIAL INFORMATION
This message is only for the use of the individual or entity to which it is
addressed and may contain information that is privileged and confidential. If
you are not the intended recipient, please do not distribute or copy this
communication, by e-mail or otherwise. Instead, please notify us immediately by
return e-mail.