Skip to content

Commit 1e05b44

Browse files
authored
Set publicID when passing plain data to RDF parser. (#91)
* Set publicID when passing plain data to RDF parser.
1 parent 15c0ab8 commit 1e05b44

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ typing==3.5.2.2 ; python_version>="2.7"
22
avro-python3 ; python_version>="3"
33
avro==1.8.1 ; python_version<"3"
44
ruamel.yaml==0.13.7
5-
rdflib==4.2.1
5+
rdflib==4.2.2
66
rdflib-jsonld==0.4.0
7-
html5lib==0.9999999
87
mistune==0.7.3
98
CacheControl==0.11.7
109
lockfile==0.12.2

schema_salad/jsonld_context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,10 @@ def makerdf(workflow, # type: Union[str, unicode]
236236
if isinstance(wf, list):
237237
for w in wf:
238238
w["@context"] = ctx
239-
g.parse(data=json.dumps(w), format='json-ld', location=workflow)
239+
g.parse(data=json.dumps(w), format='json-ld', publicID=str(workflow))
240240
else:
241241
wf["@context"] = ctx
242-
g.parse(data=json.dumps(wf), format='json-ld', location=workflow)
242+
g.parse(data=json.dumps(wf), format='json-ld', publicID=str(workflow))
243243

244244
# Bug in json-ld loader causes @id fields to be added to the graph
245245
for sub, pred, obj in g.triples((None, URIRef("@id"), None)):

schema_salad/ref_resolver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def add_schemas(self, ns, base_url):
311311
self.cache[fetchurl] = rdflib.graph.Graph()
312312
for fmt in ['xml', 'turtle', 'rdfa']:
313313
try:
314-
self.cache[fetchurl].parse(data=content, format=fmt)
314+
self.cache[fetchurl].parse(data=content, format=fmt, publicID=str(fetchurl))
315315
self.graph += self.cache[fetchurl]
316316
break
317317
except xml.sax.SAXParseException:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
'setuptools',
3232
'requests >= 1.0',
3333
'ruamel.yaml >= 0.12.4',
34-
'rdflib >= 4.2.0, < 4.3.0',
34+
'rdflib >= 4.2.2, < 4.3.0',
3535
'rdflib-jsonld >= 0.3.0, < 0.5.0',
3636
'mistune >= 0.7.3, < 0.8',
3737
'typing >= 3.5.2, < 3.6',

tox.ini

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,20 @@ skipsdist = True
1010
[testenv]
1111
deps = -rrequirements.txt
1212

13+
[testenv:py35-py2_mypy]
14+
commands = make mypy
15+
whitelist_externals = make
16+
deps =
17+
mypy==0.470
18+
typed-ast==0.6.3
19+
-rrequirements.txt
20+
1321
[testenv:py35-mypy]
1422
commands = make mypy
1523
whitelist_externals = make
1624
deps =
17-
mypy>=0.470
25+
mypy==0.470
26+
typed-ast==0.6.3
1827
-rrequirements.txt
1928

2029
[testenv:py35-lint]

0 commit comments

Comments
 (0)