Reputation: 526
I want to add new uri (as string) to variable that allready have some uris using sparql Virtuoso 7.1. This is my sparql.
SELECT ?newURIs WHERE {
?newURIs rdf:type res:myClass .
BIND(URI("http://www.mypage.com/property#myProperty") AS ?newURIs) .
}
As I get it, it should add to the list that uri in "...", but it doesn't. Response is "Virtuoso 37000 Error SP031: SPARQL compiler: Internal error: Built-in function is not implemented"
i tried:
BIND(IRI("...") AS ?newURIs)
and then i get results from first row (items from myClass) but my new uri is not there... Same situation with:
BIND("..." AS ?newURIs)
and with:
BIND(<...> AS ?newURIs)
What am i doing wrong? How can i add new URI from string to list of uris in variable?
thnx
Upvotes: 0
Views: 1661
Reputation: 28646
Well for a start your query is actually illegal in SPARQL, you can't use BIND
to assign to an already in-scope variable so your query should be rejected as illegal SPARQL. This may be what Virtuoso is doing though the error message you got was clearly unhelpful
What you are actually trying to do is a little unclear, from your description it sounds like you have a selection of possible values that you want to use for ?newURIs
in which case the VALUES
clause would be the appropriate way to do this e.g.
SELECT *
WHERE
{
VALUES ?newURIs
{
<http://www.mypage.com/property#myProperty>
# Other values go here
}
?newURIs rdf:type res:myClass .
}
Note however that this will only find matches of your triple pattern where the value of ?newURIs
has one of the values given in your VALUES
clause which may not actually be what you want.
Upvotes: 3