Skip to content

Commit 51d78ea

Browse files
committed
fix specify encoding to remove non-ascii char failure
1 parent cda290d commit 51d78ea

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

examples/01-web/10-dbpedia.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from __future__ import print_function
21
# -*- coding: utf-8 *-*
2+
from __future__ import print_function
33
import os
44
import sys
55
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
@@ -30,7 +30,7 @@
3030
# http://dbpedia.org/ontology/
3131
q = """
3232
prefix dbo: <http://dbpedia.org/ontology/>
33-
select ?actor where {
33+
select ?actor where {
3434
?actor a dbo:Actor.
3535
}
3636
"""
@@ -47,7 +47,7 @@
4747

4848
q = """
4949
prefix dbo: <http://dbpedia.org/ontology/>
50-
select ?actor ?place where {
50+
select ?actor ?place where {
5151
?actor a dbo:Actor.
5252
?actor dbo:birthPlace ?place.
5353
}
@@ -70,9 +70,9 @@
7070
# so we use a regular expression instead with filter():
7171
q = """
7272
prefix dbo: <http://dbpedia.org/ontology/>
73-
select ?actor ?date where {
73+
select ?actor ?date where {
7474
?actor a dbo:Actor.
75-
?actor dbo:birthDate ?date.
75+
?actor dbo:birthDate ?date.
7676
filter(regex(str(?date), "1970-..-.."))
7777
}
7878
order by ?date
@@ -90,7 +90,7 @@
9090
q = """
9191
prefix dbo: <http://dbpedia.org/ontology/>
9292
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
93-
select ?actor ?place where {
93+
select ?actor ?place where {
9494
?_actor a dbo:Actor.
9595
?_actor dbo:birthPlace ?_place.
9696
?_actor rdfs:label ?actor.
@@ -141,7 +141,7 @@
141141
q = u"""
142142
prefix dbo: <http://dbpedia.org/ontology/>
143143
prefix foaf: <http://xmlns.com/foaf/0.1/>
144-
select ?person ?name where {
144+
select ?person ?name where {
145145
?person a dbo:Person.
146146
?person foaf:givenName ?name.
147147
filter(regex(?name, "Édouard"))

examples/02-db/01-database.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from __future__ import print_function
21
# -*- coding: utf-8 -*-
2+
from __future__ import print_function
33
import os
44
import sys
55
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))

examples/03-en/05-tagset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
# -*- coding: utf-8 -*-
12
from __future__ import print_function
2-
# coding: utf-8
33
import os
44
import sys
55
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))

0 commit comments

Comments
 (0)