Skip to content

Commit

Permalink
Fix invalid baseIRI warning due to missing file prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcelo Machado committed Oct 12, 2022
1 parent d6c3e0a commit b613cdd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 6 additions & 0 deletions packages/core/lib/datasources/MemoryDatasource.js
Expand Up @@ -9,6 +9,12 @@ class MemoryDatasource extends Datasource {
constructor(options) {
let supportedFeatureList = ['quadPattern', 'triplePattern', 'limit', 'offset', 'totalCount'];
super(options, supportedFeatureList);
if (options.file) {
if (!options.file.startsWith('file://') && !options.file.startsWith('http://') && !options.file.startsWith('https://'))
options.file = `file://${options.file}`;
}

this._url = options && (options.url || options.file);
}

// Prepares the datasource for querying
Expand Down
Expand Up @@ -10,12 +10,6 @@ let ACCEPT = 'application/ld+json;q=1.0,application/json;q=0.7';
class JsonLdDatasource extends MemoryDatasource {
constructor(options) {
super(options);
if (options.file) {
if (!options.file.startsWith('file://'))
options.file = `file://${options.file}`;
}

this._url = options && (options.url || options.file);
}

// Retrieves all quads from the document
Expand Down

0 comments on commit b613cdd

Please sign in to comment.