Skip to content

Commit

Permalink
query function updates
Browse files Browse the repository at this point in the history
  • Loading branch information
charitha93 committed Apr 11, 2024
1 parent 84765ec commit e3de356
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 4 additions & 1 deletion docs/triplydb-js/account/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ The `metadata` argument specifies the required Dataset or Service and access lev
<dd>The human-readable name of the query. This name may include spaces and other characters that are not allowed in the URL-friendly <code>name</code>.</dd>

<dt><code>output: string</code></dt>
<dd>The visualization plugin that is used to display the result set of the query. If none is set it defaults to <code>'table'</code>.
<dd>The visualization plugin that is used to display the result set of the query. If none is set it will either set <code>ldFrame</code> if provided or default to <code>table</code>.
<dl>
<dt><code>'boolean'</code></dt>
<dd>The <a href='../../yasgui/index.md#table'>boolean</a> view is a special view for ask queries. The value is either 'true' or 'false', and is visualized as <code>`X`</code>(False) or <code>`V`</code>(True).</dd>
Expand Down Expand Up @@ -177,6 +177,9 @@ The `metadata` argument specifies the required Dataset or Service and access lev
</dl>
</dd>

<dt><code>ldFrame: object</code></dt>
<dd>JSON LD frame object used to transform plain JSON LD into a framed JSON. Will be used only if an output is not provided.</dd>

<dt><code>variables: Variable[]</code></dt>
<dd>
A list of objects with the following keys:
Expand Down
9 changes: 5 additions & 4 deletions docs/triplydb-js/query/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ const query = await user.getQuery('my-query')
const query_1 = await query.useVersion(1)
```

## Query.copy(queryName?: string, accountName?: string, metadataToReplace?: object)
## Query.copy(queryName?: string, account?:object, metadataToReplace?: object)

Copies a query using either the same name or a new name (if <code>queryName</code> is provided) to the current account or a new account (if <code>accountName</code> is provided) with the same metadata or overwritten metadata (if <code>metadataToReplace</code> is provided)

Expand All @@ -228,9 +228,9 @@ Copies a query using either the same name or a new name (if <code>queryName</cod
<p>An optional parameter. The new URL-friendly name given to the duplicated query that is used in URL paths. This name can only include ASCII letters and hyphens. Defaults to the original query name.</p>
</dd>

<dt><code>accountName</code></dt>
<dt><code>account</code></dt>
<dd>
<p>An optional parameter. The new account to which the query will be copied to. Defaults to the current account</p>
<p>An optional parameter.Expected to be either an User or an Organization object if provided. The new account to which the query will be copied to. Defaults to the current account</p>
</dd>

<dt><code>metadataToReplace</code><dt>
Expand Down Expand Up @@ -280,11 +280,12 @@ Copies a query using either the same name or a new name (if <code>queryName</cod
const user = await triply.getAccount('my-account')
const query = await user.getQuery('my-query')
const query_1 = await query.useVersion(1)
const orgAccount = await triply.getAccount('org-account');

// Within the same account under a new name
const duplicatedQuery_1 = await query.copy('newDuplicateQuery')
// To a new account with some metadata overwritten using the same query name
const duplicatedQuery_2 = await query.copy(undefined, 'newAccountName' , {
const duplicatedQuery_2 = await query.copy(undefined, orgAccount , {
description: 'newDescription',
displayName: 'newDisplayName'
})
Expand Down

0 comments on commit e3de356

Please sign in to comment.