Lourens
> My first intuition would say that a sparql query containing
>
> { _:hidden_bnode skos:prefLabel ?v1_lab .
> FILTER (_:hidden_bnode = iri(?:_uri)) }
>
> could be inefficient. Will Virtuoso internally optimize this into a query
> equivalent to { $:some_uri skos:prefLabel ?v1_lab. } ?
Thanks, Ivan.
My first intuition would say that a sparql query containing
{ _:hidden_bnode skos:prefLabel ?v1_lab .
FILTER (_:hidden_bnode = iri(?:_uri)) }
could be inefficient. Will Virtuoso internally optimize this into a query
equivalent to { $:some_uri skos:prefLabel ?v1_lab. } ?
Lourens
Lourens,
I gues that this will work:
CREATE PROCEDURE VAS_PROPERTY_LABEL (in _uri varchar) {
for (sparql select ?v1_lab where { `iri(?:_uri)` skos:prefLabel
?v1_lab})
do {
RETURN "v1_lab";
}
RETURN _uri;
}
Colon in ?:_uri indicates an external variable, iri() con
Thanks for solving my previous problem. Next, I am looking at creating
procedures.
I somehow do not manage to use VPL variables in sparql queries:
CREATE PROCEDURE VAS_PROPERTY_LABEL (in _uri varchar) {
for (sparql select ?v1_lab where { _uri skos:prefLabel ?v1_lab})
do {
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
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
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 .."):
http: