Skip to content

Commit

Permalink
update population-report.sparql
Browse files Browse the repository at this point in the history
Concatenate family because this is used as a single group.
Get the population region by the geographic location of the population.
Note: this link is not available in the ontology, I did the change
to generate the report.
  • Loading branch information
anitacaron committed Jul 1, 2024
1 parent 0a881ab commit f24f79a
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/sparql/population-report.sparql
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,33 @@ PREFIX population_size: <http://purl.obolibrary.org/obo/AfPO_0000459>
PREFIX family: <http://purl.obolibrary.org/obo/AfPO_0000565>
PREFIX population_concept: <http://purl.obolibrary.org/obo/OBI_0000181>
PREFIX language_glottolog: <http://purl.obolibrary.org/obo/AfPO_0000089>
PREFIX has_country_origin: <http://purl.obolibrary.org/obo/HANCESTRO_0308>
PREFIX located_in: <http://purl.obolibrary.org/obo/RO_0001025>

SELECT ?population_term (STR(?population_n) AS ?population_name) ?region_name ?population_size ?language_location ?family (STR(?country_origin) AS ?country_origin_name)
SELECT ?population_term (STR(?population_n) AS ?population_name) ?region_name ?population_size ?language_location (STR(?country_origin) AS ?contry_origin_name) (GROUP_CONCAT(?family;SEPARATOR="|") AS ?family_list)
WHERE {
?population_term rdfs:subClassOf* population_concept: .
?population_term rdfs:label ?population_n .
?population_term rdfs:subClassOf ?region .
?region rdfs:label ?region_name .
OPTIONAL { ?population_region rdfs:subClassOf population_concept: .
?population_region rdfs:subClassOf [
a owl:Restriction ;
owl:onProperty located_in: ;
owl:someValuesFrom ?region_term
] .
?population_term rdfs:subClassOf* ?population_region .
?region_term rdfs:label ?region_name .
}
OPTIONAL { ?population_term population_size: ?population_size . }
OPTIONAL { ?population_term family: ?family . }
OPTIONAL { ?population_term language_glottolog: ?language_location . }
OPTIONAL { ?population_term rdfs:subClassOf [
a owl:Restriction ;
owl:onProperty <http://purl.obolibrary.org/obo/HANCESTRO_0308> ;
owl:onProperty has_country_origin: ;
owl:someValuesFrom ?country_origin_term
] .
?country_origin_term rdfs:label ?country_origin .
}
OPTIONAL { ?population_term family: ?family . }
FILTER (isIRI(?region) && ?region != population_concept:)
}
GROUP BY ?population_term ?population_n ?region_name ?population_size ?language_location ?country_origin

0 comments on commit f24f79a

Please sign in to comment.