@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
84 lines (82 loc) • 2.92 kB
TypeScript
import type GraphNamedObject from "./GraphNamedObject.js";
import type { GraphNamedObjectProperties } from "./GraphNamedObject.js";
export interface EntityProperties extends GraphNamedObjectProperties {}
/**
* An entity is a specific instance of an [EntityType](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraph/EntityType/) that can exist in the [knowledge graph](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraph/KnowledgeGraph/).
* Entities typically represent real-world objects or locations such as a person, an organization, a building, or a vehicle.
* Each entity has a set of properties that is defined by the entity type it belongs to.
*
* @since 4.25
* @see [Relationship](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraph/Relationship/)
* @see [EntityType](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraph/EntityType/)
* @example
* //create a new entity
* const [knowledgeGraphModule, Entity] = await $arcgis.import([
* "@arcgis/core/rest/knowledgeGraphService.js",
* "@arcgis/core/rest/knowledgeGraph/Entity.js",
* ]);
* const newEntity = new Entity({
* typeName: "Supplier",
* properties: {
* Name: "Supplier 5",
* EmployeeCount: 681
* }
* });
* @example
* //searches for 'solar' in the properties of all entities in a knowledge graph
* const KnowledgeGraphModule = await $arcgis.import(
* "@arcgis/core/rest/knowledgeGraphService.js"
* );
* KnowledgeGraphModule
* .executeSearch(kg, {
* searchQuery: "solar",
* typeCategoryFilter: "entity",
* })
* .then((queryResult) => {
* // do something with the search results
* console.log("Graph Search Result", queryResult);
* });
* @example
* //example of a return from the above search, printed to the console.
* {
* resultRows: [{
* "declaredClass": "esri.rest.knowledgeGraph.Entity",
* "properties": {
* "shape": {
* "declaredClass": "esri.geometry.Point",
* "cache": {},
* "hasM": false,
* "hasZ": false,
* "latitude": 53.589000000000009,
* "longitude": -0.9633,
* "type": "point",
* "extent": null,
* "spatialReference": {
* "wkid": 4326
* },
* "x": -0.9633,
* "y": 53.589000000000009
* },
* "Name": "Suncommon",
* "Employee_Count": 400,
* "energyType": "solar"
* },
* "typeName": "Company",
* "id": ""{9D2D6AFD-41F1-49A4-8412-CACCC9906E88}","
* }]
* }
*/
export default class Entity extends GraphNamedObject {
/**
* @example
* // create a new entity object
* const newEntity = new Entity({
* typeName: "Supplier",
* properties: {
* Name: "Supplier 5",
* EmployeeCount: 681
* }
* s});
*/
constructor(properties?: EntityProperties);
}