File: test_parser_structure.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 (12 lines) | stat: -rw-r--r-- 336 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
import rdflib.plugins.sparql.parser
import pprint


def test_parser_structure() -> None:
    def t(q):
        print(q)
        pprint.pprint(rdflib.plugins.sparql.parser.parseQuery(q))

    t("SELECT * WHERE { ?s ?p ?o, ?o2 ; ?p2 ?o3 . ?s2 ?p ?o .} ")

    t("SELECT * WHERE { ?s ?p ?o, ?o2 ; ?p2 ?o3 ; ?p3 [ ?p ?o ] . ?s2 ?p ?o .} ")