@@ -106,6 +106,8 @@ geoflow_skos_vocabulary <- R6Class("geoflow_skos_vocabulary",
106
106
107
107
# '@description list_collections
108
108
# '@param mimetype mimetype
109
+ # '@param count_sub_collections count_sub_collections. Default is TRUE
110
+ # '@param count_concepts count_concepts. Default is TRUE
109
111
# '@return the response of the SPARQL query
110
112
list_collections = function (mimetype = " text/csv" ,
111
113
count_sub_collections = TRUE ,
@@ -137,6 +139,30 @@ geoflow_skos_vocabulary <- R6Class("geoflow_skos_vocabulary",
137
139
return (out )
138
140
},
139
141
142
+ # '@description list_concepts
143
+ # '@param lang lang
144
+ # '@return the response of the SPARQL query
145
+ list_concepts = function (lang = " en" ){
146
+ str = paste0("
147
+ PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
148
+
149
+ SELECT ?collection ?collectionLabel ?concept ?prefLabel WHERE {
150
+ ?collection a skos:Collection .
151
+ OPTIONAL { ?collection skos:prefLabel ?collectionLabel }
152
+
153
+ ?collection skos:member ?concept .
154
+ ?concept a skos:Concept .
155
+ ?concept skos:prefLabel ?prefLabel .
156
+
157
+ FILTER (LANG(?prefLabel) = \" " , lang , " \" )
158
+ }
159
+ ORDER BY ?collection ?concept
160
+ " )
161
+ out = self $ query(str = str , graphUri = graphUri , mimetype = mimetype )
162
+ out = out [with(out , order(collection , prefLabel )),]
163
+ return (out )
164
+ },
165
+
140
166
# '@description query_from_uri
141
167
# '@param uri uri
142
168
# '@param graphUri graphUri
0 commit comments