Skip to content

Commit abe37f6

Browse files
Merge pull request #52 from terminusdb/docs
review the docs
2 parents 2511e55 + aca8fa0 commit abe37f6

File tree

6 files changed

+24
-381
lines changed

6 files changed

+24
-381
lines changed

docs/_sidebar.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,6 @@
4747
- [generateCommitDescriptor](api/woqlClient.js?id=generateCommitDescriptor)
4848
- [prepareRevisionControlArgs](api/woqlClient.js?id=prepareRevisionControlArgs)
4949
- [updateDatabase](api/woqlClient.js?id=updateDatabase)
50-
- [createUser](api/woqlClient.js?id=createUser)
51-
- [getUser](api/woqlClient.js?id=getUser)
52-
- [updateUser](api/woqlClient.js?id=updateUser)
53-
- [deleteUser](api/woqlClient.js?id=deleteUser)
54-
- [createOrganization](api/woqlClient.js?id=createOrganization)
55-
- [setOrganizationRoles](api/woqlClient.js?id=setOrganizationRoles)
56-
- [getOrganization](api/woqlClient.js?id=getOrganization)
57-
- [updateOrganization](api/woqlClient.js?id=updateOrganization)
58-
- [deleteOrganization](api/woqlClient.js?id=deleteOrganization)
59-
- [getRoles](api/woqlClient.js?id=getRoles)
60-
- [updateRoles](api/woqlClient.js?id=updateRoles)
6150
- [addDocument](api/woqlClient.js?id=addDocument)
6251
- [queryDocument](api/woqlClient.js?id=queryDocument)
6352
- [getDocument](api/woqlClient.js?id=getDocument)
@@ -75,7 +64,8 @@
7564
- [comment](api/woql.js?id=comment)
7665
- [select](api/woql.js?id=select)
7766
- [distinct](api/woql.js?id=distinct)
78-
- [and](api/woql.js?id=an)
67+
- [and](api/woql.js?id=and)
68+
- [read_object](api/woql.js?id=read_object)
7969
- [or](api/woql.js?id=or)
8070
- [from](api/woql.js?id=from)
8171
- [into](api/woql.js?id=into)

docs/api/typedef.js.md

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,4 @@
11
## Typedefs
2-
3-
<dl>
4-
<dt><a href="#DocParamsGet">DocParamsGet</a> : <code>Object</code></dt>
5-
<dd><p>the GET document interface query parameters</p>
6-
</dd>
7-
<dt><a href="#DocParamsPost">DocParamsPost</a> : <code>Object</code></dt>
8-
<dd><p>the POST document interface query parameters</p>
9-
</dd>
10-
<dt><a href="#DocParamsPut">DocParamsPut</a> : <code>Object</code></dt>
11-
<dd><p>the PUT document interface query parameters</p>
12-
</dd>
13-
<dt><a href="#DocParamsDelete">DocParamsDelete</a> : <code>Object</code></dt>
14-
<dd><p>the DELETE document interface query parameters</p>
15-
</dd>
16-
<dt><a href="#GraphRef">GraphRef</a> : <code>&quot;schema/main&quot;</code> | <code>&quot;instance/main&quot;</code> | <code>string</code></dt>
17-
<dd></dd>
18-
<dt><a href="#DataFormatObj">DataFormatObj</a> : <code>Object</code></dt>
19-
<dd><p>(export/import)</p>
20-
</dd>
21-
<dt><a href="#FuntionType">FuntionType</a> : <code>&quot;add_quad&quot;</code> | <code>&quot;delete_quad&quot;</code> | <code>&quot;add_triple&quot;</code> | <code>&quot;delete_triple&quot;</code> | <code>&quot;quad&quot;</code> | <code>&quot;triple&quot;</code></dt>
22-
<dd></dd>
23-
<dt><a href="#ResourceType">ResourceType</a> : <code>&quot;commits&quot;</code> | <code>&quot;meta&quot;</code> | <code>&quot;branch&quot;</code> | <code>&quot;ref&quot;</code> | <code>&quot;repo&quot;</code> | <code>&quot;db&quot;</code></dt>
24-
<dd></dd>
25-
<dt><a href="#GraphType">GraphType</a> : <code>&quot;instance&quot;</code> | <code>&quot;schema&quot;</code></dt>
26-
<dd></dd>
27-
<dt><a href="#CredentialObj">CredentialObj</a> : <code>Object</code></dt>
28-
<dd></dd>
29-
<dt><a href="#ActionType">ActionType</a> : <code>&#x27;graph&#x27;</code> | <code>&#x27;db&#x27;</code> | <code>&#x27;clone&#x27;</code> | <code>&#x27;triples&#x27;</code> | <code>&#x27;woql&#x27;</code> | <code>&#x27;fetch&#x27;</code> | <code>&#x27;pull&#x27;</code> | <code>&#x27;rebase&#x27;</code> | <code>&#x27;branch&#x27;</code> | <code>&#x27;reset&#x27;</code> | <code>&#x27;push&#x27;</code> | <code>&#x27;squash&#x27;</code></dt>
30-
<dd></dd>
31-
<dt><a href="#ParamsObj">ParamsObj</a> : <code>Object</code></dt>
32-
<dd></dd>
33-
<dt><a href="#RolesObj">RolesObj</a> : <code>Object</code></dt>
34-
<dd></dd>
35-
<dt><a href="#RepoType">RepoType</a> : <code>&quot;local&quot;</code> | <code>&quot;remote&quot;</code></dt>
36-
<dd></dd>
37-
<dt><a href="#DbDetails">DbDetails</a> : <code>Object</code></dt>
38-
<dd></dd>
39-
<dt><a href="#RemoteRepoDetails">RemoteRepoDetails</a> : <code>Object</code></dt>
40-
<dd><p>{remote: &quot;origin&quot;, &quot;remote_branch&quot;: &quot;main&quot;, &quot;author&quot;: &quot;admin&quot;, &quot;message&quot;: &quot;message&quot;}</p>
41-
</dd>
42-
<dt><a href="#CloneSourceDetails">CloneSourceDetails</a> : <code>Object</code></dt>
43-
<dd></dd>
44-
</dl>
45-
46-
472
## DocParamsGet
483
#### DocParamsGet : <code>Object</code>
494
the GET document interface query parameters

docs/api/woql.js.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,19 @@ WOQL.and(
9292
WOQL.triple("v:Start", "label", "v:Start_Label"))
9393
```
9494

95+
### read_object
96+
#### WOQL.read\_object(IRI, output, formatObj) ⇒ <code>object</code>
97+
Read a node identified by an IRI as a JSON-LD document
98+
99+
**Returns**: <code>object</code> - WOQLQuery
100+
101+
| Param | Type | Description |
102+
| --- | --- | --- |
103+
| IRI | <code>string</code> | The document id or a variable |
104+
| output | <code>string</code> | variable name |
105+
| formatObj | <code>object</code> | |
106+
107+
95108
### or
96109
#### WOQL.or(...subqueries) ⇒ <code>WOQLQuery</code>
97110
Creates a logical OR of the arguments
@@ -964,7 +977,7 @@ Casts the value of Input to a new value of type Type and stores the result in Ca
964977

965978
**Example**
966979
```js
967-
typecast("22/3/98", "xsd:dateTime", "v:time")
980+
cast("22/3/98", "xsd:dateTime", "v:time")
968981
```
969982

970983
### order_by

docs/api/woqlClient.js.md

Lines changed: 0 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -648,141 +648,6 @@ update the database details
648648
| dbDoc | <code>object</code> | an object that describe the database details |
649649
650650
651-
### createUser
652-
#### woqlClient.createUser(userId, userDoc) ⇒ <code>Promise</code>
653-
For creating an user
654-
655-
**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected.
656-
657-
| Param | Type | Description |
658-
| --- | --- | --- |
659-
| userId | <code>string</code> | the userId |
660-
| userDoc | <code>object</code> | the user's object description |
661-
662-
663-
### getUser
664-
#### woqlClient.getUser(userId) ⇒ <code>Promise</code>
665-
Get the logged user details.
666-
667-
**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected.
668-
669-
| Param | Type |
670-
| --- | --- |
671-
| userId | <code>string</code> |
672-
673-
674-
### updateUser
675-
#### woqlClient.updateUser(userId, userDoc) ⇒ <code>Promise</code>
676-
Update an user from the database.
677-
678-
**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected.
679-
680-
| Param | Type | Description |
681-
| --- | --- | --- |
682-
| userId | <code>string</code> | |
683-
| userDoc | <code>object</code> | User Object details |
684-
685-
686-
### deleteUser
687-
#### woqlClient.deleteUser(userId) ⇒ <code>Promise</code>
688-
Delete an user from the database Only a user with DBA authority can delete a user.
689-
690-
**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected.
691-
692-
| Param | Type |
693-
| --- | --- |
694-
| userId | <code>string</code> |
695-
696-
697-
### createOrganization
698-
#### woqlClient.createOrganization(orgId, orgDoc) ⇒ <code>Promise</code>
699-
Create a new organization for the registered user
700-
701-
**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected.
702-
703-
| Param | Type | Description |
704-
| --- | --- | --- |
705-
| orgId | <code>string</code> | the organization id |
706-
| orgDoc | <code>object</code> | An object that describe the organization's details |
707-
708-
709-
### setOrganizationRoles
710-
#### woqlClient.setOrganizationRoles(orgId, orgDoc) ⇒ <code>Promise</code>
711-
Create a new organization for the registered user
712-
713-
**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected.
714-
715-
| Param | Type | Description |
716-
| --- | --- | --- |
717-
| orgId | <code>string</code> | the organization id |
718-
| orgDoc | <code>object</code> | An object that describe the organization's details |
719-
720-
721-
### getOrganization
722-
#### woqlClient.getOrganization(orgId, [action]) ⇒ <code>Promise</code>
723-
Gets all the information about the given organization
724-
725-
**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected.
726-
727-
| Param | Type | Description |
728-
| --- | --- | --- |
729-
| orgId | <code>string</code> | the organization id |
730-
| [action] | <code>string</code> | set an action like recommendations | invitations | collaborators |
731-
732-
733-
### updateOrganization
734-
#### woqlClient.updateOrganization(orgId, orgDoc) ⇒ <code>Promise</code>
735-
only if you have the permission you can delete an organization
736-
Before you can delete the organization, you must first remove all accounts and databases
737-
from the organization
738-
739-
**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected.
740-
741-
| Param | Type | Description |
742-
| --- | --- | --- |
743-
| orgId | <code>string</code> | the organization id |
744-
| orgDoc | <code>object</code> | the organization details description |
745-
746-
747-
### deleteOrganization
748-
#### woqlClient.deleteOrganization(orgId) ⇒ <code>Promise</code>
749-
only if you have the permission you can delete an organization
750-
Before you can delete the organization, you must first remove all accounts and databases
751-
from the organization
752-
753-
**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected.
754-
755-
| Param | Type | Description |
756-
| --- | --- | --- |
757-
| orgId | <code>string</code> | the organization id |
758-
759-
760-
### getRoles
761-
#### woqlClient.getRoles([userId], [orgId], [dbId]) ⇒ <code>Promise</code>
762-
get all the user roles (for the current logged user)
763-
or the user roles for a specific database and user
764-
(the logged used need to have the permission to see the roles info for another user)
765-
766-
**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected.
767-
768-
| Param | Type | Description |
769-
| --- | --- | --- |
770-
| [userId] | <code>string</code> | the user id |
771-
| [orgId] | <code>string</code> | the organization id |
772-
| [dbId] | <code>string</code> | the dbId |
773-
774-
775-
### updateRoles
776-
#### woqlClient.updateRoles(newRolesObj) ⇒ <code>Promise</code>
777-
Change the user role for existing users in your organization, including your own
778-
779-
**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected.
780-
781-
| Param | Type |
782-
| --- | --- |
783-
| newRolesObj | <code>typedef.RolesObj</code> |
784-
785-
786651
### addDocument
787652
#### woqlClient.addDocument(json, [params], [dbId], [string]) ⇒ <code>Promise</code>
788653
to add a new document or a list of new documents into the instance or the schema graph.

lib/woql.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ WOQL.and = function(...subqueries) {
9191
}
9292

9393

94+
/**
95+
* Read a node identified by an IRI as a JSON-LD document
96+
* @param {string} IRI - The document id or a variable
97+
* @param {string} output - variable name
98+
* @param {object} formatObj
99+
* @return {object} WOQLQuery
100+
*/
101+
94102
WOQL.read_object = function(IRI, output, formatObj) {
95103
return new WOQLQuery().read_object(IRI, output, formatObj)
96104
}

0 commit comments

Comments
 (0)