|
Revision 103, 349 bytes
(checked in by phil, 9 months ago)
|
|
Added Joseki unit test
Changed Literal to return strings for untyped Literals and string Literals
|
| Line | |
|---|
| 1 | from rdfalchemy.sparql import SPARQLGraph |
|---|
| 2 | |
|---|
| 3 | url = 'http://localhost:2020/books' |
|---|
| 4 | g = SPARQLGraph(url) |
|---|
| 5 | |
|---|
| 6 | q1 = "select ?s ?p ?o where {?s ?p ?o}" |
|---|
| 7 | |
|---|
| 8 | responses = {} |
|---|
| 9 | x = set(list(g.query(q1,resultMethod='xml'))) |
|---|
| 10 | j = set(list(g.query(q1,resultMethod='json'))) |
|---|
| 11 | |
|---|
| 12 | print len(x) |
|---|
| 13 | |
|---|
| 14 | def sizes_test(): |
|---|
| 15 | assert len(x) == len(j) |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | def eq_jx_test(): |
|---|
| 19 | assert j == x |
|---|