Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyLODE fail, GitHub action. New version rdfLib at fault? #145

Closed
smrgeoinfo opened this issue Jul 20, 2021 · 1 comment · Fixed by #147
Closed

pyLODE fail, GitHub action. New version rdfLib at fault? #145

smrgeoinfo opened this issue Jul 20, 2021 · 1 comment · Fixed by #147

Comments

@smrgeoinfo
Copy link

smrgeoinfo commented Jul 20, 2021

I have a github action set up to run pyLODE on the ttl in my github repo. Last week it worked; when I did a push today I got an error on the action. looking at the logs, the difference seems to be this:

works (last week):

...

Collecting rdflib>=5.0.0
Downloading rdflib-5.0.0-py3-none-any.whl (231 kB)

...

Successfully installed isodate-0.6.0 markdown-3.3.4 pylode-2.10.3 rdflib-5.0.0 rdflib-jsonld-0.5.0

... starts generating html files

Doesn't work (today)

...

Collecting rdflib>=5.0.0
Downloading rdflib-6.0.0-py3-none-any.whl (376 kB)

...

Successfully installed isodate-0.6.0 markdown-3.3.4 pylode-2.10.3 rdflib-6.0.0 rdflib-jsonld-0.5.0

then:

/usr/local/lib/python3.8/dist-packages/pylode/profiles/ontdoc.py:763: UserWarning: Code: domainIncludes is not defined in namespace SDO
for o in self.G.objects(subject=s, predicate=SDO.domainIncludes):
/usr/local/lib/python3.8/dist-packages/pylode/profiles/ontdoc.py:819: UserWarning: Code: rangeIncludes is not defined in namespace SDO
for o in self.G.objects(subject=s, predicate=SDO.rangeIncludes):

.... stack trace omitted...

File "/usr/local/lib/python3.8/dist-packages/pylode/profiles/base.py", line 467, in _make_schemaorg_metadata
return g.serialize(format="json-ld").decode("utf-8")
AttributeError: 'str' object has no attribute 'decode'
Error: Process completed with exit code 1.

any ideas?

@GordianDziwis
Copy link
Contributor

You are right, problem is that rdflib is not pinned to 5.0.0.

Workaround:

pip uninstall rdflib
pip install rdflib==5.0.0

drahnreb added a commit to drahnreb/pyLODE that referenced this issue Aug 4, 2021
Fix AttributeError of serialize(). With backwards compatibility for
rdflib==5.0.0, as its the last python 2 release and as long as pyLODE
might still support rdflib 5.0.0
nicholascar added a commit that referenced this issue Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants