|
Hi,
Thanks for the nice library. I'm quite new to SparQL and I'm running into an error with BIND when running the following query in owlready.
"""
SELECT DISTINCT ?id ?name ?hrId ?standardId
WHERE {
?id rdf:type lo1:LearningObjective_1_0 .
{
?id olc:isRequirementFor cs1:standard_01hnya576ceqq8h85m8ezg5h8g .
BIND (cs1:standard_01hnya576ceqq8h85m8ezg5h8g AS ?standardId)
}
UNION
{
?subS aoc:directPartOf cs1:standard_01hnya576ceqq8h85m8ezg5h8g .
?id olc:isRequirementFor ?subS .
BIND (?subS AS ?standardId)
}
?id rdfs:label ?name .
?id loc:humanReadableId ?hrId .
}
"""
The same query works if I remove the variable binding.
Also, the query with BIND works when using SnapSparQL in Protege 5 when I add an additional str() around the bind variable. I tried adding the same str() around it in owlready but it didn't change anything.
The last error line is:
"""
.venv/lib/python3.11/site-packages/owlready2/sparql/parser.py", line 1319, in _get_ordered_vars
_var_found(self.var.values, vars, ordered_vars)
^^^^^^^^^^^^^^^
AttributeError: 'Token' object has no attribute 'values'. Did you mean: 'value'?
"""
Am I doing something wrong here? Help would be greatly appreciated.
Best,
Pascal
|