-
Notifications
You must be signed in to change notification settings - Fork 2
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
Adjust geo-based queries #494
Comments
On the home page there are two ways of diving into the data:
The question is: Which types of places should be covered / not covered by those queries? For a start, I checked which Wikidata types occur and how often in the NWBib data (using lobid-resources-staging to include At this point, seeing 106 different types, I scrapped this whole approach (leaving it here for documentation, though) and just looked at the spatial classification to see which regions are to big and should be excluded from queries based on geo coordinates. I think it is a good rule of thumb to exclude all regions from the second level of the concept scheme which can be easily filtered out by this SPARQL query: import rdflib
g=rdflib.Graph()
g.parse("nwbib-spatial.ttl", format='turtle')
count = 0
results = g.query("""
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?secondLevelConcept
WHERE {
?secondLevelConcept a skos:Concept ;
skos:broader ?topLevelConcept .
FILTER NOT EXISTS { ?topLevelConcept skos:broader ?anything }
}
""")
for row in results:
print("%s" % row) The result:
To exclude this from search, we have to add those to the respective queries like so:
|
The problem with the filtering approach (based on types or the actual coordinates) is that, with a normal query, it would exclude all hits with e.g. We could in theory set that up as a nested query in lobid-resources, but that would be quite complex and would restrict location queries in general. Or we'd have to add an option, further increasing complexity. I think the most straightforward approach would be to exclude the |
With hbz/lobid-resources#1031, all bigger regions (NRW itself, Rheinland, Westfalen etc.) will also have geo coordinates. We have to at least adjust the geo-based queries on the home page.
The text was updated successfully, but these errors were encountered: