Skip to content

Commit

Permalink
Adds SPARQL to fix the addressCountry issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-aravind committed Sep 5, 2024
1 parent 2044c98 commit 455416a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
17 changes: 17 additions & 0 deletions sparql/fix_address_country_name.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
PREFIX schema: <http://schema.org/>

DELETE {
?address schema:addressCountry ?country .
?country ?p ?o .
}
INSERT {
?address schema:addressCountry ?countryName .
}
WHERE {
?address a schema:PostalAddress ;
schema:addressCountry ?country .

?country a schema:Country ;
schema:name ?countryName ;
?p ?o .
}
3 changes: 2 additions & 1 deletion src/lib/rdf_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def self.process_rdf(entity_urls, base_url)
sparql_paths = [
"./sparql/replace_blank_nodes.sparql",
"./sparql/fix_entity_type_capital.sparql",
"./sparql/fix_date_timezone.sparql"
"./sparql/fix_date_timezone.sparql",
"./sparql/fix_address_country_name.sparql"
]

SparqlProcessor.perform_sparql_transformations(graph, sparql_paths, base_url)
Expand Down

0 comments on commit 455416a

Please sign in to comment.