Add ability to import namespaces via string or file (new Stardog endpoints)#201
Add ability to import namespaces via string or file (new Stardog endpoints)#201
Conversation
|
@brianru The Stardog changes for this haven't been released yet, so the PR is a bit premature (this is part of the reason the tests are failing on CircleCI). Feel free to run against |
|
@jmrog no worries, i run stardog |
Okay. There are still other failures where the tests haven't been updated for Stardog 7+, but the important thing is that the namespaces tests don't fail. (The other tests are updated in the |
brianru
left a comment
There was a problem hiding this comment.
looks good, mostly docs requests
|
|
||
| // For Stardog <= 7.0.2 compatibility. Remove later. | ||
| const backwardsCompatGetNamespaces = (conn, database, params) => | ||
| getOptions(conn, database, params).then(res => { |
There was a problem hiding this comment.
should this only request database.namespaces? where you pass in an input json object with only that key.
There was a problem hiding this comment.
It can't do that right now, at least unless I rewrite (or don't use) options.get, because options.get always sends the full DB_OPTIONS. Since this was the default behavior anyway, and this is only here for backwards compatibility, and changing options.get seems orthogonal to this PR's goal, I'd like to leave it as-is for now.
|
|
||
| /** | ||
| * Extracts namespaces from an RDF file or RDF string and adds any | ||
| * new namespaces to those that already exist in the database. |
There was a problem hiding this comment.
should you clarify that existing prefixes are updated if the namespace changed?
There was a problem hiding this comment.
and I forget - is there a doc file that gets generated with this?
There was a problem hiding this comment.
* Feature/154 upgrade fetch ponyfill (#155) * Upgrade fetch ponyfill * Get tests passing again after upgrading fetch-ponyfill * Add support, tests, and typings for additionalHandlers on query execute (#157) * Update package-lock.json * Fix docs script, update package-lock * Update CHANGELOG.md for v1.2.1, add tag * Add release documentation, as well as annoying prepublish alert * Upgrade typedocs to resolve marked security vulnerability (fix #158) * 1.2.2 * Update package-lock * Make additionalHandlers optional * Add method for retrieving server status info (close #165) (#166) * Fix package-lock.json for v2 * Add ICV report functionality and fix existing types (#188) * Update to version 6 and fix CircleCI (#185) * add full string values for test expectations * fix tests and update version note in README for stardog 6 * attempt to fix circleci by updating to new jfrog url * explicitly test graphql explain support (#184) * Add icv.report and icv.reportInTransaction functionality (close #187) * Add types for new ICV methods and fix types for existing (close #186) * Add tests for new ICV methods * add json query explain support (#191) * Try to fix dependencies * Fix tests * add stored query update (PUT) method * handle stored query updates when version < 6.2.0 * cleanup poc of server version helper * instead of getting the version recover from the method not supported error * cleanup * cleanup * code review feedback * add support for `reasoning` and `description` attributes to stored queries (#196) * add two endpoints for getting all db properties default values and getting all actual values and upgrade stardog to latest (#198) * Add ability to import namespaces via string or file (new Stardog endpoints) (#201) * Add ability to import namespaces via string or file (new Stardog endpoints) * Use Object.assign instead of spread syntax * Small tweak * Docs/type updates and name change * Docs change * Update generated docs * Allow `onResponseStart` to abort further stardog.js processing (#203) * Allow onResponseStart to abort any further stardog.js processing * Add test case, plus lint fixes * Better docs, too * use params in graphql query (#202) * Add ability to send properties file on db.create (#205) * Make old-style namespaces request really request only namespaces (fix #207) (#208) * Add support for streaming export data to file (and compression) (#212) * Add support for streaming data export, and for compression * Add tests for additionalHandlers with exportData * Add format flag for exportData * Add ability to import file to VG (for CSV/JSON import) (#213) * Add support for importing from file to VG (close #209) * Tests and fixtures * Fix up tests * Update README and test name * Fix types for onResponseStart * Make input_file come last * Support updating GraphQL schemas without remove/add (with backwards compat) (#215) * Add reasoning flag to example * add db model endpoint (#224) * Fix db.model type and docs * add virtual graph list info (#223) * Add support for database constraint for virtual graphs (#225) * Handle commented-out prefix lines in queries (fix #228) (#229) * Add additionalHandlers to graphql.execute (#231) * Change content-type to use utf-8 (#233) * [STUD-414] Make all tests work with Stardog 7+ (#234) * Remove db.copy command and test * Fix graphql tests * Fix graphStore tests * Skip versioning tests for now * Fix ICV tests * Fix exportDB tests * Fix createDB and optimizeDB tests * Fix query tests * Update version support info in README * Update test for Stardog 7.4.1 * Quick test updates * [STUD-490] add cluster api support (#236) * [STUD-490] Add cluster api support * [STUD-490] Removing done callback in spec files * [STUD-490] Removing unused param and add docs * [STUD-490] Adding docker-compose cluster test suite * [STUD-490] feature: add cluster support - address comments * Test adjustment for Stardog 7.4.2+ * Make tests more flexible * Remove DB copy and versioning * Adjust a few tests * update versions matrix * Update docs * [STUD-528] Add Data Sources (#239) * [STUD-528] add data sources * rename options to opts * return res * [STUD-517] data hub - allow stardog.js to accept query params (#241) * [STUD-517] feature: data hub - allow stardog.js to accept query params for data sources remove api * [STUD-517] feature: data hub - pr suggestion, add param to docs, run docs script, append query parameters * [STUD-517] feature: data hub - update docs, change name string to template * Add VG online + data source metadata (#240) * add vg online * fix docs * add data source to vg meta * always send data_source * no snakes * [STUD-XXX] Add dataSource.share (#249) * doc * share * [STUD-XXX] Add force option to dataSource.update (#248) * Add force param to dataSource.update * Params to request options, don't always include force in body * Fix doc for vg.mappings * Update doc for dataSource.update * [STUD-559] user tests - fix expected res in user tests (#247) * Add custom changelog generation * README update * Update Stardog version info; temporarily disable reasoning tests * Make some tests rely less on exact serialization from Stardog Co-authored-by: Brian J. Rubinton <brianrubinton@gmail.com> Co-authored-by: Annee Barrett <ahuang852@gmail.com> Co-authored-by: Josh Kim <joshhk72@gmail.com> Co-authored-by: Robert Myers <robert.myers@stardog.com> Co-authored-by: Carl Chaffatt <carl.chaffatt@stardog.com> Co-authored-by: Josh Kim <josh.kim@stardog.com>
I'm not sold on calling the method for importing namespaces "set", since it doesn't completely replace existing namespaces, but it was nicer in terms of corresponding to "get". What "set" actually does, as the test's filename indicates, is add or overwrite existing namespaces by importing from an RDF file; it doesn't set the namespaces to exactly those specified (e.g., if there is an existing namespace "foo=whatever" in the DB on the server, and the contents sent over HTTP consist in namespaces "bar=baz" and "blah=blah", the namespaces in the DB on the server when all is said and done will be "foo=whatever", "bar=baz", and "blah=blah" -- "foo=whatever" is not removed).
Seems okay to call it "set", though.