I try to fill a repeater control's datasource through the following VB code :
Dim queryString As SparqlParameterizedString = New SparqlParameterizedString()
For Each nsPrefix In UrlManager.namespaces.Keys
queryString.Namespaces.AddNamespace(nsPrefix, New Uri(UrlManager.namespaces(nsPrefix)))
Next
queryString.CommandText = commandText
Dim parser As New SparqlQueryParser()
Dim query = parser.ParseFromString(queryString)
Dim r As SparqlResultSet = g.ExecuteQuery(query)
If r.Count > 0 Then
datasource = r
Else
datasource = Nothing
End If
where variable g
is my working graph
I work with the same query
SELECT DISTINCT ?context ?label {
?s a my:Client .
?s rdfs:label ?label .
BIND ( IF(EXISTS {?s rdf:type my:Subscriber}, 1, 0) AS ?priority )
} ORDER BY DESC(?priority) ASC(?label)
Whenever I try this vb code in a simple aspx page, it works correctly but if fails on the repeater OnLoad
event with a VDS.RDF.Query.RdfQueryException: Cannot add a Set to the Null Multiset
It seems the error is caused by the BIND ( IF(EXISTS {?s rdf:type my:Subscriber}, 1, 0) AS ?priority )
clause: if I remove it, my repeater behaves as expected!
Any idea why the exception occurs and how to correct it ?