Skip to content

Commit 631096b

Browse files
committed
changed SPARQL queries to the reccomended format
1 parent 99c32f3 commit 631096b

3 files changed

Lines changed: 19 additions & 15 deletions

File tree

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
# CQ1: Where is a specific facility located?
22
# Returns the immediate site(s) where a given facility is located
33

4-
PREFIX : <https://www.commoncoreontologies.org/CommonCoreOntologiesMerged/>
4+
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
55
PREFIX cco: <https://www.commoncoreontologies.org/>
66
PREFIX obo: <http://purl.obolibrary.org/obo/>
7-
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
7+
PREFIX facility: <https://www.commoncoreontologies.org/ont00000192>
8+
PREFIX located_in: <http://purl.obolibrary.org/obo/BFO_0000171>
89

910
SELECT ?facility ?facilityLabel ?site ?siteLabel
1011
WHERE {
11-
?facility a cco:ont00000192 ;
12+
?facility a facility: ;
1213
rdfs:label ?facilityLabel ;
13-
obo:BFO_0000171 ?site .
14+
located_in: ?site .
1415
?site rdfs:label ?siteLabel .
1516
}
17+

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
# that the facility is also located in that are within the bigger site?
33
# Uses property paths to find the full location hierarchy
44

5-
PREFIX : <https://www.commoncoreontologies.org/CommonCoreOntologiesMerged/>
5+
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
66
PREFIX cco: <https://www.commoncoreontologies.org/>
77
PREFIX obo: <http://purl.obolibrary.org/obo/>
8-
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
8+
PREFIX facility: <https://www.commoncoreontologies.org/ont00000192>
9+
PREFIX located_in: <http://purl.obolibrary.org/obo/BFO_0000171>
910

1011
SELECT ?facility ?facilityLabel ?immediateSite ?immediateSiteLabel ?largerSite ?largerSiteLabel
1112
WHERE {
12-
?facility a cco:ont00000192 ;
13+
?facility a facility: ;
1314
rdfs:label ?facilityLabel ;
14-
obo:BFO_0000171 ?immediateSite .
15+
located_in: ?immediateSite .
1516
?immediateSite rdfs:label ?immediateSiteLabel ;
16-
obo:BFO_0000171+ ?largerSite .
17+
located_in:+ ?largerSite .
1718
?largerSite rdfs:label ?largerSiteLabel .
1819
}
1920
ORDER BY ?facility ?largerSite
20-
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
# CQ3: What are all the facilities located within a particular site?
22
# Finds facilities directly or transitively located within a site
33

4-
PREFIX : <https://www.commoncoreontologies.org/CommonCoreOntologiesMerged/>
4+
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
55
PREFIX cco: <https://www.commoncoreontologies.org/>
66
PREFIX obo: <http://purl.obolibrary.org/obo/>
7-
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
7+
PREFIX site: <http://purl.obolibrary.org/obo/BFO_0000029>
8+
PREFIX facility: <https://www.commoncoreontologies.org/ont00000192>
9+
PREFIX located_in: <http://purl.obolibrary.org/obo/BFO_0000171>
810

911
SELECT ?site ?siteLabel ?facility ?facilityLabel
1012
WHERE {
11-
?site a obo:BFO_0000029 ;
13+
?site a site: ;
1214
rdfs:label ?siteLabel .
13-
?facility a cco:ont00000192 ;
15+
?facility a facility: ;
1416
rdfs:label ?facilityLabel ;
15-
obo:BFO_0000171+ ?site .
17+
located_in:+ ?site .
1618
}
1719
ORDER BY ?site ?facility

0 commit comments

Comments
 (0)