@@ -1954,15 +1954,20 @@ geoflow_entity <- R6Class("geoflow_entity",
1954
1954
# '@param config geoflow config object
1955
1955
enrichWithVocabularies = function (config ){
1956
1956
1957
+ vocabs = list_vocabularies(raw = T )
1958
+
1957
1959
self $ subjects = lapply(self $ subjects , function (subject ){
1958
1960
1959
1961
if (is.null(subject $ uri )) return (subject )
1960
1962
1961
1963
# find vocabulary
1962
- vocabs = list_vocabularies(raw = T )
1963
1964
target_vocab = vocabs [sapply(vocabs , function (vocab ){vocab $ id == subject $ uri })]
1964
1965
if (length(target_vocab )> 0 ){
1965
1966
target_vocab = target_vocab [[1 ]]
1967
+ if (! is.null(target_vocab $ rdf )){
1968
+ # in case of rdf file-based vocabs, we 1st query the full dataset
1969
+ target_vocab $ query_full_dataset()
1970
+ }
1966
1971
subject $ uri = target_vocab $ uri # default uri
1967
1972
subject $ keywords = lapply(subject $ keywords , function (keyword ){
1968
1973
rs = NULL
@@ -1980,10 +1985,10 @@ geoflow_entity <- R6Class("geoflow_entity",
1980
1985
attr(keyword $ name , paste0(" locale#" ,toupper(lang ))) = rs [rs $ lang == lang ,]$ prefLabel [1 ]
1981
1986
}
1982
1987
# overwrite subject uri/name if we find a collection (assuming keywords are from the same collection)
1983
- if (! is.na(rs [1L ,]$ collection )){
1984
- subject $ uri <<- rs [1L ,]$ collection
1985
- subject $ name <<- rs [1L ,]$ collectionLabel
1986
- }
1988
+ # if(!is.na(rs[1L,]$collection)){
1989
+ # subject$uri <<- rs[1L,]$collection
1990
+ # subject$name <<- rs[1L,]$collectionLabel
1991
+ # }
1987
1992
}
1988
1993
return (keyword )
1989
1994
})
0 commit comments