Class Reference
IRIS for UNIX 2019.2
InterSystems: The power behind what matters   
Documentation  Search
  [%SYS] >  [%iKnow] >  [Queries] >  [PathAPI]
Private  Storage   

class %iKnow.Queries.PathAPI extends %iKnow.Queries.AbstractAPI

This is the main Query class to retrieve Paths as identified by the engine. Paths are sequences of concepts and relations that form a meaningful sub-section of a sentence.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
6 18


Summary

Methods
%AddToSaveSet %ClassIsLatestVersion %ClassName %ConstructClone
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Extends
%GetParameter %IsA %IsModified %New
%NormalizeObject %ObjectModified %OriginalNamespace %PackageName
%RemoveFromSaveSet %SerializeObject %SetModified %ValidateObject
GetAttributes GetByEntities GetByEntityIds GetBySource
GetCountByDomain GetCountByEntities GetCountByEntityIds GetCountBySource
GetEntities GetId GetSentenceId GetSourceId
GetValue


Parameters

• parameter GetAttributesRT = "attTypeId:%Integer,attType:%String,start:%Integer,span:%Integer,properties:%String";
• parameter GetByEntitiesRT = "pathId:%Integer,entIds:%List";
• parameter GetByEntityIdsRT = "pathId:%Integer,entIds:%List";
• parameter GetBySourceRT = "pathId:%Integer,entIds:%List";
• parameter GetEntitiesRT = "position:%Integer,entOccId:%Integer,entUniId:%Integer,entityValue:%String,literal:%String,role:%Integer,stemUniId:%Integer,stemValue:%String";

Methods

• classmethod GetAttributes(ByRef pResult, pDomainId As %Integer, pPathId As %Integer, vSrcId As %Integer = 0) as %Status

Returns all attributes for a given path. Any named attribute properties are also included through sub-nodes (not available through SQL or SOAP):

pResult(rowNumber, propertyName) = propertyValue

Please note this query only returns path-level attributes and not those attributes applying to individual entities or words within entities. To retrieve these, use GetOccurrenceAttributes in %iKnow.Queries.EntityAPI.

• classmethod GetByEntities(ByRef result, domainid As %Integer, entitylist As %List, page As %Integer = 1, pagesize As %Integer = 10, filter As %iKnow.Filters.Filter = "", setop As %Integer = $$$UNION, pActualFormOnly As %Boolean = 0) as %Status

This method will return all Paths containing any (if setop = $$$UNION) or all (if setop = $$$INTERSECT) of the entities in the supplied entitylist.

The scope of this query can be limited through supplying a %iKnow.Filters.Filter object for the filter parameter to restrict the result to those Paths occurring in any source satisfying the filter criteria.

Results are sorted by decreasing path ID.

If stemming is enabled for this domain through $$$IKPSTEMMING, paths containing any actual form of the entities in entitylist will be returned. Use pActualFormOnly=1 to retrieve only those paths containing the actual forms in entitylist. This argument is ignored if stemming is not enabled.

• classmethod GetByEntityIds(ByRef result, domainid As %Integer, entityidlist As %List, page As %Integer = 1, pagesize As %Integer = 10, filter As %iKnow.Filters.Filter = "", setop As %Integer = $$$UNION, pActualFormOnly As %Boolean = 0) as %Status

Retrieves paths based on entity IDs.

See also GetByEntities for a description of the parameters.

• classmethod GetBySource(ByRef result, domainid As %Integer, sourceidlist As %List, page As %Integer = 1, pagesize As %Integer = 10) as %Status

Retrieves the paths appearing in any of the sources supplied through sourceidlist.

To get the paths of a virtual source, only a single virtual source can be supplied using its negative ID value (otherwise, -1 is returned).

• classmethod GetCountByDomain(domainid As %Integer, filter As %iKnow.Filters.Filter = "", Output sc As %Status = $$$OK) as %Integer

Returns the number of paths in a domain, optionally restricted to those appearing in a source satisfying the %iKnow.Filters.Filter object supplied through filter.

• classmethod GetCountByEntities(domainid As %Integer, entitylist As %List, filter As %iKnow.Filters.Filter = "", setop As %Integer = $$$UNION, Output sc As %Status = $$$OK, pActualFormOnly As %Boolean = 0) as %Integer

Retrieves the number of paths containing the specified entities.

See also GetByEntities for a description of the parameters.

• classmethod GetCountByEntityIds(domainid As %Integer, entityidlist As %List, filter As %iKnow.Filters.Filter = "", setop As %Integer = $$$UNION, Output sc As %Status = $$$OK, pActualFormOnly As %Boolean = 0) as %Integer

Retrieves the number of paths containing the specified entity IDs.

See also GetByEntities for a description of the parameters.

• classmethod GetCountBySource(domainid As %Integer, sourceidlist As %List, Output sc As %Status = $$$OK) as %Integer

Returns the total number of paths in the sources specified through sourceidlist. Use negative source IDs to refer to virtual sources.

• classmethod GetEntities(ByRef result, domainId As %Integer, pathId As %Integer, vSrcId As %Integer = 0) as %Status

Returns a detailed overview of the entities pathId consists of, including their unique and occurrence IDs, positions, roles and literal value.

The last two columns will only contain data if stemming is enabled for this domain through the $$$IKPSTEMMING domain parameter.

• classmethod GetId(domainid As %Integer, entityList As %List, vSrcId As %Integer = 0, Output sc As %Status = $$$OK) as %Integer

This method will try to find a path corresponding to the supplied list of entities in the specified order. If no path is found, "" is returned.

When specifying a Virtual Source ID, it will treat the path as a virtual one, in the context of that vSrcId.

• classmethod GetSentenceId(domainId As %Integer, pathId As %Integer, Output sc As %Status = $$$OK, vSrcId As %Integer = 0) as %Integer
Returns the sentence ID in which the supplied path ID occurs
• classmethod GetSourceId(domainId As %Integer, pathId As %Integer, Output sc As %Status = $$$OK) as %Integer
Returns the source ID in which the supplied path ID occurs
• classmethod GetValue(domainid As %Integer, pathid As %Integer, vSrcId As %Integer = 0, Output pSC As %Status, pUseStems As %Boolean = 0) as %List

Returns the sequence of entity values corresponding to the specified path as a %List.

When specifying a Virtual Source ID, it will treat the pathId as a virtual one, in the context of that vSrcId.

If stemming is enabled for this domain through the $$$IKPSTEMMING domain parameter, you can use pUseStems=1 to get the stems rather than the entities for this path.



Copyright (c) 2019 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.