You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Updating Data Sources pages
* first drafts of entity import
* more work on entities
* continued work
* continued work
* allow sample API key
* more work
* more work on entities
* more work
* more changes
* more changes
* split out custom entities into a separate file
* start work on Python v2 docs
* start of new Python docs
* create all pages for directory and more work on landing page
* more work
* add skeleton files
* rename old Python docs
* fix mistaken files
* fix files again
* fix more files
* remove template from PR
* changed examples to directly print responses
* move pagination out of main page and into node page
* wording change suggested by Jorge
* fixed response formatting object wording, per Jorge
* new node page
* start work on resolve
* more work
* More changes
* Finish the resolve page and reword REST resolve page
* Remove template from push
* Incorporate feedback from Christie
* fix missing s on method name
| data | object | Data of the property label and value information, keyed by the queried nodes. |
66
+
| data | object | Data of the property label and value information, keyed by the queried nodes. |
64
67
| nextToken | string | A token used to query the [next page of data](#pagination), if `all_pages` is set to `False` in the query. |
65
68
{: .doc-table}
66
69
67
70
### Response property methods
68
71
69
-
In addition to the [formatting methods](index.md#response-formatting) available for all reponses classes, you can call the following methods on the `NodeResponse` object:
72
+
You can call the following methods on the `NodeResponse` object:
70
73
71
74
| Method | Description |
72
75
|--------|-------------|
73
-
| nextToken | Extract the `nextToken` value from the response. See [Pagination](#pagination) below for more details |
74
-
{: .doc-table}
76
+
| to_dict | Converts the dataclass to a Python dictionary. See [Response formatting](index.md#response-formatting) for details. |
77
+
| to_json | Serializes the dataclass to a JSON string (using `json.dumps()`). See [Response formatting](index.md#response-formatting) for details. |
78
+
| nextToken | Extracts the `nextToken` value from the response. See [Pagination](#pagination) below for more details |
#### Example 1: Get all incoming property labels for a given node
100
106
@@ -128,6 +134,7 @@ Response:
128
134
```
129
135
{: .example-box-content .scroll}
130
136
137
+
{: .no_toc}
131
138
{: #fetch_ex2 }
132
139
#### Example 2: Get one (outgoing) property value for a given node
133
140
@@ -164,6 +171,7 @@ Response:
164
171
```
165
172
{: .example-box-content .scroll}
166
173
174
+
{: .no_toc}
167
175
#### Example 3: Get a list of all statistical variables
168
176
169
177
This example gets the list of all statistical variables in the knowledge graph, by fetching all nodes that are types of the class `StatisticalVariable` and using the `<-typeOf` symbol to express the incoming relationships. Also, because of the size of the response, it enables [pagination](#pagination) to split up the response data into multiple calls.
#### Example 1: Get all incoming property labels for a given node
258
267
259
268
Get all incoming arc property labels, i.e. the property labels that are used in attached nodes, of the node with DCID `geoId/06` (California) by setting the `out` parameter to `False`. This is identical to [example 1](#fetch_ex1) of the `fetch` method.
#### Example 1: Get one (outgoing) property value for a given node
315
325
316
326
This example gets the `name` property for a given node with DCID `dc/03lw9rhpendw5`. This is identical to [example 2](#fetch_ex2) of the `fetch` method.
@@ -346,6 +356,7 @@ Response:
346
356
```
347
357
{: .example-box-content .scroll}
348
358
359
+
{: .no_toc}
349
360
#### Example 2: Get multiple (outgoing) property values for multiple nodes
350
361
351
362
This example gets the `name`, `latitude`, and `longitude` values for nodes `geoId/06085` and `geoId/06087`.
@@ -443,6 +454,7 @@ Response:
443
454
```
444
455
{: .example-box-content .scroll}
445
456
457
+
{: .no_toc}
446
458
#### Example 3: Get DCIDs of nodes of a specific type, with an incoming relation to a node
447
459
448
460
In this example, we use a [filter expression](/api/rest/v2/#filters) to specify "all contained places in
@@ -509,8 +521,6 @@ Response:
509
521
```
510
522
{: .example-box-content .scroll}
511
523
512
-
513
-
514
524
## fetch_all_classes
515
525
516
526
Fetches all nodes that are entity types, that is, have `Class` as their type.
0 commit comments