File: test_issue446.py

package info (click to toggle)
rdflib 6.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 38,248 kB
  • sloc: python: 39,216; sh: 153; makefile: 110
file content (21 lines) | stat: -rw-r--r-- 554 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# coding=utf-8
# test for https://github.com/RDFLib/rdflib/issues/446

from rdflib import Graph, URIRef, Literal


def test_sparql_unicode():
    g = Graph()
    trip = (
        URIRef("http://example.org/foo"),
        URIRef("http://example.org/bar"),
        URIRef("http://example.org/jörn"),
    )
    g.add(trip)
    q = 'select ?s ?p ?o where { ?s ?p ?o . FILTER(lang(?o) = "") }'
    r = list(g.query(q))
    assert r == [], "sparql query %r should return nothing but returns %r" % (q, r)


if __name__ == "__main__":
    test_sparql_unicode()