Skip to content

Commit 99c32f3

Browse files
committed
changed design pattern 1 over to facility location
1 parent c6c3a4f commit 99c32f3

14 files changed

Lines changed: 337 additions & 106 deletions

File tree

documentation/user-guides/design-patterns/Design Pattern 1/CQ1.sparql

Lines changed: 0 additions & 12 deletions
This file was deleted.

documentation/user-guides/design-patterns/Design Pattern 1/CQ2.sparql

Lines changed: 0 additions & 11 deletions
This file was deleted.

documentation/user-guides/design-patterns/Design Pattern 1/CQ3.sparql

Lines changed: 0 additions & 13 deletions
This file was deleted.

documentation/user-guides/design-patterns/Design Pattern 1/Document_Field_Documentation.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

documentation/user-guides/design-patterns/Design Pattern 1/Document_Field_Mermaid

Lines changed: 0 additions & 50 deletions
This file was deleted.
Binary file not shown.
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Pattern Name
2+
Facility Location
3+
4+
# Intent
5+
6+
To represent location relationships where material entities (e.g., facilities, equipment, infrastructure) are situated within progressively larger geographic regions or sites (e.g., building → campus → city → state → country), enabling multi-level location queries and reasoning. The specific entity types and site hierarchies shown are examples. This pattern generalizes to any material entity that can be located at sites, and any hierarchical organization of sites.
7+
8+
# Competency Questions
9+
10+
1. Where is a specific facility located?
11+
2. What bigger site is this facility located in, and are there smaller sites that the facility is located in that are also located in the bigger site?
12+
3. What are all the facilities located within a particular site?
13+
14+
# Structure
15+
16+
Represents the location of a site and their appropriate relations with a broader area.
17+
18+
Helps with creating transitive relations between sites.
19+
20+
Visual model through mermaid and png.
21+
22+
*Note: Entity types and location hierarchies shown are illustrative examples. This pattern applies to any material entities and site taxonomies relevant to your domain.*
23+
```mermaid
24+
flowchart BT
25+
A@{ label: "<font color=\"#000000\">Facility 1</font>" } -- LocatedIn<br>BFO:0000171 --> B@{ label: "<font color=\"#000000\">City 1</font>" }
26+
B -- LocatedIn<br>BFO:0000171 --> C@{ label: "<font color=\"#000000\">State 1</font>" }
27+
A -- rdf:type --> D@{ label: "<span style=\"color:black\"><b>Facility<br>ont00000192</b></span><br>" }
28+
B -- rdf:type --> E@{ label: "<span style=\"color:black\"><b>Site<br>BFO_0000029</b></span><br>" }
29+
C -- rdf:type --> E
30+
A -. rdfs:label .-> F["Building 1"]
31+
B -. rdfs:label .-> G["NY City"]
32+
C -. rdfs:label .-> H["NY State"]
33+
34+
subgraph Legend[" "]
35+
direction LR
36+
AA{Individual}
37+
BB[Class]
38+
CC[data]
39+
AA --> |relation| CC
40+
end
41+
42+
A ~~~ Legend
43+
44+
A@{ shape: diam}
45+
B@{ shape: diam}
46+
C@{ shape: diam}
47+
D@{ shape: rect}
48+
E@{ shape: rect}
49+
F@{ shape: rect}
50+
G@{ shape: rect}
51+
H@{ shape: rect}
52+
A:::purple
53+
B:::purple
54+
C:::purple
55+
D:::yellow
56+
E:::yellow
57+
F:::white
58+
G:::white
59+
H:::white
60+
classDef yellow fill:#ffe680
61+
classDef purple fill:#dbc9ef
62+
classDef white fill:#FFFFFF
63+
class BB yellow
64+
class AA purple
65+
class CC white
66+
```
67+
68+
# File Structure
69+
```
70+
facility-location/
71+
├── README.md
72+
├── mermaid/
73+
│ ├── FacilityLocation.md # Mermaid source file
74+
│ └── FacilityLocation.png # Exported PNG diagram
75+
└── sparql/
76+
├── CQ1.sparql # Where is a specific facility located?
77+
├── CQ2.sparql # What larger/smaller sites contain this facility?
78+
├── CQ3.sparql # What facilities are within a particular site?
79+
└── example.ttl # Test data for SPARQL queries
80+
```
81+
82+
## File Descriptions
83+
84+
### mermaid/
85+
| File | Description |
86+
|------|-------------|
87+
| `FacilityLocation.md` | Mermaid diagram source showing the pattern structure |
88+
| `FacilityLocation.png` | PNG export of the diagram for documentation |
89+
90+
### sparql/
91+
| File | Competency Question |
92+
|------|---------------------|
93+
| `CQ1.sparql` | Where is a specific facility located? |
94+
| `CQ2.sparql` | What bigger site is this facility located in, and are there smaller sites that the facility is located in that are also located in the bigger site? |
95+
| `CQ3.sparql` | What are all the facilities located within a particular site? |
96+
| `example.ttl` | Turtle file with test instances (states, cities, campuses, buildings, facilities) |
97+
98+
# Additional Notes
99+
100+
- Related pattern: Geospatial Coordinate Pattern
101+
- Key classes: `obo:BFO_0000029` (Site), `cco:ont00000192` (Facility)
102+
- Key property: `obo:BFO_0000171` (located in)
103+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
flowchart BT
2+
A@{ label: "<font color=\"#000000\">Facility 1</font>" } -- LocatedIn<br>BFO:0000171 --> B@{ label: "<font color=\"#000000\">City 1</font>" }
3+
B -- LocatedIn<br>BFO:0000171 --> C@{ label: "<font color=\"#000000\">State 1</font>" }
4+
A -- rdf:type --> D@{ label: "<span style=\"color:black\"><b>Facility<br>ont00000192</b></span><br>" }
5+
B -- rdf:type --> E@{ label: "<span style=\"color:black\"><b>Site<br>BFO_0000029</b></span><br>" }
6+
C -- rdf:type --> E
7+
A -. rdfs:label .-> F["Building 1"]
8+
B -. rdfs:label .-> G["NY City"]
9+
C -. rdfs:label .-> H["NY State"]
10+
11+
subgraph Legend[" "]
12+
direction LR
13+
AA{Individual}
14+
BB[Class]
15+
CC[data]
16+
AA --> |relation| CC
17+
end
18+
19+
A ~~~ Legend
20+
21+
A@{ shape: diam}
22+
B@{ shape: diam}
23+
C@{ shape: diam}
24+
D@{ shape: rect}
25+
E@{ shape: rect}
26+
F@{ shape: rect}
27+
G@{ shape: rect}
28+
H@{ shape: rect}
29+
A:::purple
30+
B:::purple
31+
C:::purple
32+
D:::yellow
33+
E:::yellow
34+
F:::white
35+
G:::white
36+
H:::white
37+
classDef yellow fill:#ffe680
38+
classDef purple fill:#dbc9ef
39+
classDef white fill:#FFFFFF
40+
class BB yellow
41+
class AA purple
42+
class CC white
43+
328 KB
Loading
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# CQ1: Where is a specific facility located?
2+
# Returns the immediate site(s) where a given facility is located
3+
4+
PREFIX : <https://www.commoncoreontologies.org/CommonCoreOntologiesMerged/>
5+
PREFIX cco: <https://www.commoncoreontologies.org/>
6+
PREFIX obo: <http://purl.obolibrary.org/obo/>
7+
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
8+
9+
SELECT ?facility ?facilityLabel ?site ?siteLabel
10+
WHERE {
11+
?facility a cco:ont00000192 ;
12+
rdfs:label ?facilityLabel ;
13+
obo:BFO_0000171 ?site .
14+
?site rdfs:label ?siteLabel .
15+
}

0 commit comments

Comments
 (0)