File: 61.py

package info (click to toggle)
python-rdflib-jsonld 0.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,832 kB
  • sloc: python: 1,800; makefile: 132
file content (16 lines) | stat: -rw-r--r-- 528 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from rdflib import Graph
from rdflib.plugin import register, Parser, Serializer

register("json-ld", Parser, "rdflib_jsonld.parser", "JsonLDParser")
register("json-ld", Serializer, "rdflib_jsonld.serializer", "JsonLDSerializer")


def test_issue_61():
    context_jsonld = "61-context.jsonld"
    data_file = "61-data.jsonld"

    g = Graph().parse(data_file, format="json-ld")
    output = g.serialize(format="json-ld", context=context_jsonld, indent=4)

    assert "dct:spatial" in output
    assert '"spatial"' not in output