Skip to content

Commit

Permalink
Urleconding on commons URL
Browse files Browse the repository at this point in the history
  • Loading branch information
andrawaag committed Oct 2, 2021
1 parent 3b04abf commit 32a742d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages

VERSION = "0.9.12"
VERSION = "0.9.13"

setup(
name='wikidataintegrator',
Expand Down
3 changes: 2 additions & 1 deletion wikidataintegrator/wdi_rdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import uuid
import requests
import json
import urllib.parse

"""
Authors:
Expand Down Expand Up @@ -97,7 +98,7 @@ def triplify(self):
def parseSnak(self, statement):
value = statement["datavalue"]["value"]
if statement["datatype"] == "commonsMedia":
return URIRef("http://commons.wikimedia.org/wiki/Special:FilePath/" + value.replace(" ", "_"))
return URIRef("http://commons.wikimedia.org/wiki/Special:FilePath/" + urllib.parse.quote_plus(value.replace(" ", "_")))
elif statement["datatype"] == "string":
return Literal(value)
elif statement["datatype"] == "external-id":
Expand Down

0 comments on commit 32a742d

Please sign in to comment.