/v1/bulk/properties

Get all properties associated with a specific node, for multiple nodes.

More specifically, this endpoint returns the labels of the edges connected to a specific node in the Data Commons Knowledge Graph. Edges in the graph are directed, so properties can either be labels for edges towards or away from the node. Outgoing edges correspond to properties of the node. Incoming edges denote that the node is the value of this property for some other node.

Request

https://api.datacommons.org/v1/bulk/properties/{EDGE_DIRECTION}?nodes={node_dcid_1}&nodes={node_dcid_2}&key={your_api_key}
URL: https://api.datacommons.org/v1/bulk/properties/{EDGE_DIRECTION} Header: X-API-Key: {your_api_key} JSON Data: { "nodes": [ "{value_1}", "{value_2}", ... ] }

Path Parameters

Name Description
EDGE_DIRECTION
Required
One of in or out. Denotes direction of edges to get triples for.

If in, returns properties represented by edges pointing toward the node provided. If out, returns properties represented by edges pointing away from the node provided.

Query Parameters

Name Type Description
key
Required
string Your API key. See the page on authentication for a demo key, as well as instructions on how to get your own key.
nodes
Required
string DCIDs of the nodes to query.

Response

The response looks like:

{
  "data":
  [
    {
      "node": "node_1_dcid",
      "properties":
      [
        "property_1",
        "property_2",
        ...
      ]
    },
    {
      "node": "node_2_dcid",
      "properties":
      [
        "property_1",
        "property_2",
        ...
      ]

    }, ...
  ]
}

Response fields

Name Type Description
node string DCID of the node queried.
properties list List of properties connected to the node queried, for the direction specified in the request.

Examples

Example 1: Get properties for mulitple nodes.

Get properties describing the US states of Virgina (DCID: geoId/51), Maryland (DCID: geoId/24), and Delaware (DCID: geoId/10).

  • Request:

    $ curl --request GET --url \
    'https://api.datacommons.org/v1/bulk/properties/out?nodes=geoId/51&nodes=geoId/24&nodes=geoId/10&key=AIzaSyCTI4Xz-UW_G2Q2RfknhcfdAnTHq5X5XuI'
    
  • Request:

    $ curl --request POST \
    --url https://api.datacommons.org/v1/bulk/properties/out \
    --header 'X-API-Key: AIzaSyCTI4Xz-UW_G2Q2RfknhcfdAnTHq5X5XuI' \
    --data '{"nodes":["geoId/51", "geoId/24", "geoId/10"]}'
    

Response:

{
  "data":
  [
    {
      "node": "geoId/51",
      "properties":
      [
        "administrativeCapital",
        "alternateName",
        "archinformLocationId",
        < ... output truncated for brevity ... >
        "whosOnFirstId",
        "wikidataId",
        "worldcatIdentitiesId"
      ]
    },
    {
      "node": "geoId/24",
      "properties":
      [
        "administrativeCapital",
        "alternateName",
        "archinformLocationId",
        < ... output truncated for brevity ... >
        "whosOnFirstId",
        "wikidataId",
        "worldcatIdentitiesId"
      ]
    },
    {
      "node": "geoId/10",
      "properties":
      [
        "administrativeCapital",
        "alternateName",
        "archinformLocationId",
        < ... output truncated for brevity ... >
        "whosOnFirstId",
        "wikidataId",
        "worldcatIdentitiesId"
      ]
    }
  ]
}

Page last updated: December 17, 2024 • Send feedback about this page