Fix skos parser to not replace Product type URI by dfc-pt

The given productType.rdf file doesn't give us any context for `dfc-pt`,
so there was no reason to do that.
We still need to do some substitution in the importer, as some times
we are given `dfc-pt` as input data.
This commit is contained in:
Gaetan Craig-Riou
2024-01-04 15:47:46 +11:00
parent 2aa0ab15b9
commit 35da321e15
2 changed files with 3 additions and 8 deletions

View File

@@ -130,8 +130,8 @@ module DataFoodConsortium
"https://github.com/datafoodconsortium/taxonomies/releases/latest/download/measures.rdf#",
"dfc-m:"
).sub(
"https://github.com/datafoodconsortium/taxonomies/releases/latest/download/productTypes.rdf#",
"dfc-pt:"
"dfc-pt:",
"https://github.com/datafoodconsortium/taxonomies/releases/latest/download/productTypes.rdf#"
)
SKOSParser.concepts[id]

View File

@@ -90,13 +90,8 @@ module DataFoodConsortium
prefLabels: element.label
)
skosConcept.semanticType = element.type
# Gaetan's fix for productTypes
id = element.id.sub(
"https://github.com/datafoodconsortium/taxonomies/releases/latest/download/productTypes.rdf#",
"dfc-pt:"
)
# Maikel's patch
self.class.concepts[id] = skosConcept
self.class.concepts[element.id] = skosConcept
skosConcept
end