Better filtering of some LOD-properties

This commit is contained in:
Pieter Vander Vennet 2024-04-09 15:12:18 +02:00
parent 087c099e2e
commit 6b381e05c6
2 changed files with 80 additions and 53 deletions

View file

@ -24,7 +24,8 @@ export default class LinkedDataLoader {
image: { "@id": "http://schema.org/image", "@type": "@id" },
opening_hours: { "@id": "http://schema.org/openingHoursSpecification" },
openingHours: { "@id": "http://schema.org/openingHours", "@container": "@set" },
geo: { "@id": "http://schema.org/geo" }
geo: { "@id": "http://schema.org/geo" },
"alt_name": {"@id":"http://schema.org/alternateName"}
}
private static COMPACTING_CONTEXT_OH = {
dayOfWeek: { "@id": "http://schema.org/dayOfWeek", "@container": "@set" },
@ -188,6 +189,11 @@ export default class LinkedDataLoader {
compacted["geo"] = <any>await LinkedDataLoader.geoToGeometry(compacted["geo"])
}
if(compacted["alt_name"]){
if(compacted["alt_name"] === compacted["name"]){
delete compacted["alt_name"]
}
}
for (const k in compacted) {
if (compacted[k] === "") {