Skip to content

Commit 6653228

Browse files
authored
Update project location to use geosparql Feature and Geometry (#40)
* Change project location to use geosparql Geometry class * Update ProjectPost to use shared Geometry class * Refactor to use GeoSparql Feature and Geometry * Prefix geosparql properties with has * Remove inlined: false This only works when referencing another class that has an identifier property
1 parent e8783f2 commit 6653228

File tree

3 files changed

+59
-50
lines changed

3 files changed

+59
-50
lines changed

schema/src/Geometry.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
id: Geometry
2+
name: Geometry
3+
4+
prefixes:
5+
linkml: https://w3id.org/linkml/
6+
dcterms: http://purl.org/dc/terms/
7+
geo: http://www.opengis.net/ont/geosparql#
8+
rfs: https://framework.regen.network/schema/
9+
10+
default_prefix: rfs
11+
12+
imports:
13+
- core
14+
15+
classes:
16+
Feature:
17+
description: A spatial feature, such as a project or area, with a defined geometry and optional bounding box.
18+
class_uri: geo:Feature
19+
slots:
20+
- name
21+
- hasGeometry
22+
- hasBoundingBox
23+
- hasCentroid
24+
slot_usage:
25+
name:
26+
required: true
27+
hasGeometry:
28+
required: true
29+
Geometry:
30+
description: A geometry defined using Well-Known Text (WKT), compliant with GeoSPARQL 1.1.
31+
class_uri: geo:Geometry
32+
slots:
33+
- asWKT
34+
slot_usage:
35+
asWKT:
36+
required: true
37+
38+
slots:
39+
asWKT:
40+
slot_uri: geo:asWKT
41+
range: string
42+
description: A WKT literal with an optional CRS prefix (e.g., '<http://www.opengis.net/def/crs/EPSG/0/4326> POINT(...)').
43+
hasGeometry:
44+
slot_uri: geo:hasGeometry
45+
range: Geometry
46+
hasBoundingBox:
47+
slot_uri: geo:hasBoundingBox
48+
range: Geometry
49+
description: A derived geometry representing the bounding box of the geometry or feature.
50+
hasCentroid:
51+
slot_uri: geo:hasCentroid
52+
range: Geometry
53+
description: A derived geometry representing the centroid of the feature.

schema/src/ProjectInfo.yaml

Lines changed: 4 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ prefixes:
1111
imports:
1212
- linkml:types
1313
- core
14+
- Geometry
1415
- Methodology
1516
- taxonomy
1617

@@ -43,12 +44,10 @@ classes:
4344
multivalued: true
4445
inlined: true
4546
inlined_as_list: true
46-
location:
47+
hasFeature:
48+
range: Feature
4749
required: true
48-
range: Location
4950
description: The location of the project.
50-
slot_uri: schema:location
51-
inlined: true
5251
projectSize:
5352
range: QuantityValue
5453
inlined: false
@@ -147,45 +146,6 @@ classes:
147146
referenceType:
148147
range: string
149148
description: An optional label that describes the identifier.
150-
Location:
151-
attributes:
152-
type:
153-
range: string
154-
required: true
155-
geometry:
156-
range: Geometry
157-
required: true
158-
placeName:
159-
range: string
160-
alias: place_name
161-
required: true
162-
# unused by frontend, but linkml doesn't support arbitrary additional attributes
163-
id:
164-
range: string
165-
bbox:
166-
range: float
167-
multivalued: true
168-
text:
169-
range: string
170-
center:
171-
range: float
172-
multivalued: true
173-
context:
174-
range: Any
175-
relevance:
176-
range: float
177-
placeType:
178-
range: string
179-
alias: place_type
180-
properties:
181-
range: Any
182-
Geometry:
183-
attributes:
184-
type:
185-
range: string
186-
coordinates:
187-
range: float
188-
multivalued: true
189149
Any:
190150
class_uri: linkml:Any
191151

@@ -205,4 +165,4 @@ enums:
205165
description: a compliance market
206166
VOLUNTARY_MARKET:
207167
meaning: rfs:VoluntaryMarket
208-
description: a voluntary market
168+
description: a voluntary market

schema/src/ProjectPost.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ prefixes:
77
rfs: https://framework.regen.network/schema/
88
imports:
99
- linkml:types
10+
- Geometry
1011
default_range: string
1112
default_prefix: rfs
1213

@@ -34,12 +35,7 @@ classes:
3435
description:
3536
slot_uri: dcterms:description
3637
location:
37-
range: FileLocation
38+
range: Geometry
3839
slot_uri: geo:hasGeometry
3940
credit:
4041
slot_uri: dcterms:creator
41-
FileLocation:
42-
class_uri: geo:Geometry
43-
attributes:
44-
wkt:
45-
slot_uri: geo:asWKT

0 commit comments

Comments
 (0)