You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError Traceback (most recent call last)
<ipython-input-59-83c306286d37> in <module>()
12 }
13 """,
---> 14 initNs = {"rdfs":RDFS, "owl":OWL, "dc":DC, "skos":SKOS})
/home/UserName/.pyenv/versions/anaconda3-2.4.0/lib/python3.5/site-packages/rdflib/plugins/sparql/processor.py in prepareQuery(queryString, initNs, base)
23 Parse and translate a SPARQL Query
24 """
---> 25 return translateQuery(parseQuery(queryString), base, initNs)
26
27
/home/UserName/.pyenv/versions/anaconda3-2.4.0/lib/python3.5/site-packages/rdflib/plugins/sparql/algebra.py in translateQuery(q, base, initNs)
742 q[1], visitPost=functools.partial(translatePName, prologue=prologue))
743
--> 744 P, PV = translate(q[1])
745 datasetClause = q[1].datasetClause
746 if q[1].name == 'ConstructQuery':
/home/UserName/.pyenv/versions/anaconda3-2.4.0/lib/python3.5/site-packages/rdflib/plugins/sparql/algebra.py in translate(q)
531
532 # all query types have a where part
--> 533 M = translateGroupGraphPattern(q.where)
534
535 aggregate = False
/home/UserName/.pyenv/versions/anaconda3-2.4.0/lib/python3.5/site-packages/rdflib/plugins/sparql/algebra.py in translateGroupGraphPattern(graphPattern)
276 if not (g and g[-1].name == 'BGP'):
277 g.append(BGP())
--> 278 g[-1]["triples"] += triples(p.triples)
279 else:
280 g.append(p)
/home/UserName/.pyenv/versions/anaconda3-2.4.0/lib/python3.5/site-packages/rdflib/plugins/sparql/algebra.py in triples(l)
129 raise Exception('these aint triples')
130 return reorderTriples((l[x], l[x + 1], l[x + 2])
--> 131 for x in range(0, len(l), 3))
132
133
/home/UserName/.pyenv/versions/anaconda3-2.4.0/lib/python3.5/site-packages/rdflib/plugins/sparql/algebra.py in reorderTriples(l)
111 while i < len(l):
112 l[i:] = sorted((_knownTerms(x[
--> 113 1], varsknown, varscount), x[1]) for x in l[i:])
114 t = l[i][0][0] # top block has this many terms bound
115 j = 0
TypeError: unorderable types: AlternativePath() < URIRef()
However, this preparedQuery has no problem in Python 2.7.10 , and This error is solved if query is modified by grouping triple pattern.
Modified query is below .
* master: (49 commits)
Update reference to "Emulating container types"
Avoid class reference to imported function
Prevent RDFa parser from failing on time elements with child nodes
Second proposed fix for the broken top_level.txt
make Prologue and Query new style classes
DOC: minor typo in paramater
DOC: unamed -> unnamed
AuditableStore.commit does not call self.store.commit anymore
ignore operations with no effect
fixed trivial copy-paste bug
added test cases for AuditableStore
expanded path comparison ops in order to keep py2.6 support and not use total_ordering
let paths be comparable against all nodes. Fixes#545
re-introduces special handling for DCTERMS.title and test for it
Fix initBindings handling. Fixes#294
added .n3 methods for path objects
Made ClosedNamespace (and _RDFNamespace) inherit from Namespace
cleaned up trailing whitespace
Small but nice SPARQL Optimisation fix
test for #546 from_n3 trailing backslash
...
When I write this query, I got error in Python3.5
Query program is below.
Error log is below.
However, this preparedQuery has no problem in Python 2.7.10 , and This error is solved if query is modified by grouping triple pattern.
Modified query is below .
It looks like a bug.
regard.
The text was updated successfully, but these errors were encountered: