File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -27,13 +27,19 @@ class WikidataSource {
2727
2828 if ( ! this . options . url ) {
2929 throw new Error (
30- `Missing url endpoint. Please provide a valid url endpoint.`
30+ `Missing ' url' endpoint. Please provide a valid url endpoint.`
3131 ) ;
3232 }
3333
3434 if ( ! this . options . sparql ) {
3535 throw new Error (
36- `Missing sparql query. Please provide a valid sparql query.`
36+ `Missing 'sparql' query. Please provide a valid sparql query.`
37+ ) ;
38+ }
39+
40+ if ( ! this . options . typeName ) {
41+ throw new Error (
42+ `Missing 'typeName' label. Please provide a type name label.`
3743 ) ;
3844 }
3945
@@ -72,7 +78,9 @@ class WikidataSource {
7278 async fetchWikidata ( actions ) {
7379 this . info ( "Fetching Wikidata ..." ) ;
7480 const queryDispatcher = new SPARQLQueryDispatcher ( this . options . url ) ;
75- const collection = actions . addCollection ( { typeName : "Record" } ) ;
81+ const collection = actions . addCollection ( {
82+ typeName : this . options . typeName
83+ } ) ;
7684 const downloads = [ ] ;
7785 const dir = process . cwd ( ) + this . options . baseDir ;
7886 // query Wikidata and process items
Original file line number Diff line number Diff line change 11{
2- "version" : " 0.0.6 " ,
2+ "version" : " 0.0.7 " ,
33 "name" : " gridsome-source-wikidata" ,
44 "description" : " Wikidata source for Gridsome" ,
55 "homepage" : " https://github.com/hunsalz/gridsome-source-wikidata" ,
You can’t perform that action at this time.
0 commit comments