File: test_issue604.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 (15 lines) | stat: -rw-r--r-- 383 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from rdflib import *
from rdflib.collection import Collection


def test_issue604():

    EX = Namespace("http://ex.co/")
    g = Graph()
    bn = BNode()
    g.add((EX.s, EX.p, bn))
    c = Collection(g, bn, map(Literal, [1, 2, 4]))
    c[2] = Literal(3)
    got = list(g.objects(bn, RDF.rest / RDF.rest / RDF.first))
    expected = [Literal(3)]
    assert got == [Literal(3)], got