-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathlgd-nominatim.sml
73 lines (62 loc) · 1.56 KB
/
lgd-nominatim.sml
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
Prefix geo:<http://www.opengis.net/ont/geosparql#>
Prefix dcterms:<http://purl.org/dc/terms/>
Prefix xsd:<http://www.w3.org/2001/XMLSchema#>
Prefix rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
Prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#>
Prefix owl:<http://www.w3.org/2002/07/owl#>
Set defaultGraph = "http://linkedgeodata.org/osm/"
Prefix lgd:<http://linkedgeodata.org/resource/>
Prefix lgdg:<http://linkedgeodata.org/geometry/>
Prefix lgdo:<http://linkedgeodata.org/ontology/>
Prefix lgdm:<http://linkedgeodata.org/meta/>
Create View placex_nodes As
Construct {
?n
a lgdm:Node ;
geo:hasGeometry ?g ;
.
?g
a geo:Geometry ;
geo:asWKT ?o ;
.
}
With
?n = uri(lgd:node, ?osm_id)
?g = uri(lgdg:node, ?osm_id)
?o = typedLiteral(?geometry, geo:wktLiteral)
From
[[SELECT * FROM placex WHERE osm_type = 'N']]
Create View placex_ways As
Construct {
?n
a lgdm:Way ;
geo:hasGeometry ?g ;
.
?g
a geo:Geometry ;
geo:asWKT ?o ;
.
}
With
?n = uri(lgd:way, ?osm_id)
?g = uri(lgdg:way, ?osm_id)
?o = typedLiteral(?geometry, geo:wktLiteral)
From
[[SELECT * FROM placex WHERE osm_type = 'W']]
Create View placex_relations As
Construct {
?n
a lgdm:Relation ;
geo:hasGeometry ?g ;
.
?g
a geo:Geometry ;
geo:asWKT ?o ;
.
}
With
?n = uri(lgd:relation, ?osm_id)
?g = uri(lgdg:relation, ?osm_id)
?o = typedLiteral(?geometry, geo:wktLiteral)
From
[[SELECT * FROM placex WHERE osm_type = 'R']]