This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathQueries.py
82 lines (73 loc) · 2.91 KB
/
Queries.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
from enum import Enum
PREFIX = "PREFIX st:<https://car-station.mcheicki.com/ontology/ontology.owl#>"
class Queries(Enum):
ALL_CARS = PREFIX + """SELECT DISTINCT
?name ?add ?zipcode ?lat ?lon ?isElectrical ?services ?city ?fuel ?isPayant ?numberPlugs
WHERE {
?a st:station ?id .
?id <https://car-station.mcheicki.com/ontology/ontology.owl#@nest> ?stationID .
?stationID st:address ?add .
?stationID st:zipcode ?zipcode .
?stationID st:coordonnees ?lat .
?stationID st:coordonnees ?lon .
?stationID st:isElectrical ?isElectrical .
OPTIONAL{
?stationID st:name ?name .
}
OPTIONAL{
?stationID st:services ?services .
}
OPTIONAL{
?stationID st:city ?city .
}
OPTIONAL{
?stationID st:fuel ?fuel .
}
OPTIONAL{
?stationID st:isPayant ?isPayant .
}
OPTIONAL{
?stationID st:numberPlugs ?numberPlugs .
}
FILTER(?lat > ?lon)
} LIMIT 500"""
THERMIC_CARS_ONLY = PREFIX + """SELECT DISTINCT ?name ?add ?zipcode ?lat ?lon ?isElectrical ?services ?city ?fuel ?isPayant ?numberPlugs
WHERE {
?a st:station ?id .
?id <https://car-station.mcheicki.com/ontology/ontology.owl#@nest> ?stationID .
?stationID st:address ?add .
?stationID st:zipcode ?zipcode .
?stationID st:city ?city .
?stationID st:coordonnees ?lat .
?stationID st:coordonnees ?lon .
VALUES ?isElectrical {'R' 'A' 'N'}
?stationID st:isElectrical ?isElectrical .
OPTIONAL{
?stationID st:fuel ?fuel .
}
OPTIONAL{
?stationID st:services ?services .
}
FILTER(?lat > ?lon)
} LIMIT 100
"""
ELECTRIC_CARS_ONLY = PREFIX + """SELECT DISTINCT ?name ?add ?zipcode ?lat ?lon ?isElectrical ?services ?city ?fuel ?isPayant ?numberPlugs
WHERE {
?a st:station ?id .
?id <https://car-station.mcheicki.com/ontology/ontology.owl#@nest> ?stationID .
?stationID st:address ?add .
?stationID st:zipcode ?zipcode .
?stationID st:coordonnees ?lat .
?stationID st:coordonnees ?lon .
?stationID st:isElectrical ?isElectrical .
?stationID st:isPayant ?isPayant .
?stationID st:numberPlugs ?numberPlugs .
?stationID st:name ?name .
FILTER(?lat > ?lon)
} LIMIT 500
"""
ALL_ZIPCODES = PREFIX + """SELECT DISTINCT ?zipcode WHERE {
?a st:station ?id .
?id <https://car-station.mcheicki.com/ontology/ontology.owl#@nest> ?stationID .
?stationID st:zipcode ?zipcode .
}"""