Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fully qualified placenames #371

Merged
merged 3 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/app/facets/facets.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,10 @@ export class FacetsComponent implements OnInit {
let responseRows: Array<string> = response.split(/[\n]+/)
let formatted: Array<string> = []
responseRows.forEach((row) => {
formatted.push(row.split(',')[1])
this.adminRegionRecords.set(row.split(',')[1], row.split(',')[0])
let splitName = row.split(',')
let fullyQualifiedName = `${splitName[1]}, ${splitName[2]}`
formatted.push(fullyQualifiedName)
this.adminRegionRecords.set(fullyQualifiedName, splitName[0])
})
// Remove the last empty line
formatted.pop()
Expand Down
6 changes: 3 additions & 3 deletions src/app/services/query.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ export class QueryService {
placesFacets['fipsCode'] +
`> }
?type rdfs:label ?typeLabel.
values ?type {kwg-ont:AdministrativeRegion_2 kwg-ont:AdministrativeRegion_3 kwg-ont:USClimateDivision}
values ?type {kwg-ont:AdministrativeRegion_2 kwg-ont:AdministrativeRegion_3 kwg-ont:ClimateDivision}
}`
)
}
Expand All @@ -550,7 +550,7 @@ export class QueryService {
values ?entity { <` +
placesFacets['climateDivision'] +
`> }
values ?type {kwg-ont:USClimateDivision}
values ?type {kwg-ont:ClimateDivision}
?type rdfs:label ?typeLabel
}`
)
Expand Down Expand Up @@ -579,7 +579,7 @@ export class QueryService {
{
?entity kwg-ont:quantifiedName ?quantifiedName.
}
values ?type {kwg-ont:AdministrativeRegion_2 kwg-ont:AdministrativeRegion_3 kwg-ont:ZipCodeArea kwg-ont:USClimateDivision kwg-ont:NWZone}
values ?type {kwg-ont:AdministrativeRegion_2 kwg-ont:AdministrativeRegion_3 kwg-ont:ZipCodeArea kwg-ont:ClimateDivision kwg-ont:NWZone}
?type rdfs:label ?typeLabel
}`
}
Expand Down
7 changes: 4 additions & 3 deletions src/assets/scripts/fetch-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ let zipCodeQuery = `PREFIX kwg-ont: <${baseAddress}/lod/ontology/>
SELECT DISTINCT ?subject ?value WHERE {
?subject a kwg-ont:ZipCodeArea.
?subject rdfs:label ?label .
BIND(REPLACE(STR(?label),"zip code ","") AS ?value)
BIND(REPLACE(STR(?label),"Zip code tabulation area with zipcode ","") AS ?value)
} ORDER BY ASC(?value)`
console.log('Getting ZIP Code')
fetchCache(zipCodeQuery, 'src/assets/data/zipcode_cache.csv')
Expand All @@ -175,7 +175,8 @@ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?subject ?value {
?subject rdf:type kwg-ont:ClimateDivision;
rdfs:label ?label.
BIND(REPLACE(STR(?label),"Climate Division from NOAA with ID ","") AS ?value) .
BIND(REPLACE(STR(?label),"Climate Division from NOAA with ID ", "") AS ?label_repl) .
BIND(REPLACE(STR(?label_repl),"US ", "") AS ?value) .
}`
console.log('Getting Climate Divisions')
fetchCache(climateDivisionQuery, 'src/assets/data/climate_division_cache.csv')
Expand All @@ -193,7 +194,7 @@ SELECT ?county ?county_label ?state ?state_label ?usa ?usa_label WHERE {
?county rdfs:label ?county_label .
?state rdfs:label ?state_label .
?usa rdfs:label ?usa_label .
} LIMIT 50 `
} LIMIT 100 `
console.log('Getting Administrative Regions')
fetchAdministrativeCache(
adminRegionQuery,
Expand Down
Loading