Skip to main content

%iKnow.Objects.Source

Class %iKnow.Objects.Source Extends %Persistent [ Deprecated, StorageStrategy = iKnowStorage, System = 4 ]

Note: the use of this class is no longer recommended for accessing elements of a specific domain. For those scenarios, %iKnow.Tables.Utils offers a more flexible and customizable way of projecting iKnow domain data to SQL

This is a read-only object representation wrapping the internal iKnow data structures for Sources.

This class can be used from ObjectScript or SQL to access a single or small number of entries, but the storage mappings are not meant to support elaborate or complex queries targeting this SQL table.

Please use the predefined queries in %iKnow.Queries.SourceAPI and other query classes to consult source data as the internal global structures are designed to optimize performance for these queries rather than general-purpose access.

NOTE: This object assumes all underlying data structures are present. Use domain-specific copies of these objects for domains where not all indices are built. See also the GenerateAllObjectsForDomain() method in %iKnow.Objects.Utils.

Parameters

READONLY

Parameter READONLY = 1;

Properties

DomainId

Property DomainId As %Integer;

SourceId

Property SourceId As %Integer;

ListerId

Property ListerId As %Integer;

GroupId

Property GroupId As %Integer;

LocalReference

Property LocalReference As %String(MAXLEN = 1000);

FirstSentenceId

Property FirstSentenceId As %Integer [ Calculated, SqlComputeCode = { set {FirstSentenceId} = $lg(^IRIS.IK.SrcDetails({DomainId},{SourceId}),1)+1 }, SqlComputed ];

SentenceCount

Property SentenceCount As %Integer [ Calculated, SqlComputeCode = { set {SentenceCount} = $lg(^IRIS.IK.SrcDetails({DomainId},{SourceId}),2) }, SqlComputed ];

FirstPartId

Property FirstPartId As %Integer [ Calculated, SqlComputeCode = { set {*} = $lg(^IRIS.IK.SrcDetails({DomainId},{SourceId}),3)+1 }, SqlComputed ];

FirstEntityOccurrenceId

Property FirstEntityOccurrenceId As %Integer [ Calculated, Internal, SqlComputeCode = { set {FirstEntityOccurrenceId}= {FirstPartId}}, SqlComputed ];

This property is deprecated. Use FirstPartId

PartCount

Property PartCount As %Integer [ Calculated, SqlComputeCode = { set {*} = $lg(^IRIS.IK.SrcDetails({DomainId},{SourceId}),4) }, SqlComputed ];

EntityOccurrenceCount

Property EntityOccurrenceCount As %Integer [ Calculated, SqlComputeCode = { set {*} = ##class(%iKnow.Queries.EntityAPI).GetOccurrenceCountBySource({DomainId},$lb({SourceId}),,$$$ENTTYPEANY) }, SqlComputed ];

FirstCrcOccurrenceId

Property FirstCrcOccurrenceId As %Integer [ Calculated, SqlComputeCode = { set {FirstCrcOccurrenceId} = $lg(^IRIS.IK.SrcDetails({DomainId},{SourceId}),5)+1 }, SqlComputed ];

CrcOccurrenceCount

Property CrcOccurrenceCount As %Integer [ Calculated, SqlComputeCode = { set {CrcOccurrenceCount} = $lg(^IRIS.IK.SrcDetails({DomainId},{SourceId}),6) }, SqlComputed ];

FirstPathId

Property FirstPathId As %Integer [ Calculated, SqlComputeCode = { set {FirstPathId} = $lg(^IRIS.IK.SrcDetails({DomainId},{SourceId}),7)+1 }, SqlComputed ];

PathCount

Property PathCount As %Integer [ Calculated, SqlComputeCode = { set {PathCount} = $lg(^IRIS.IK.SrcDetails({DomainId},{SourceId}),8) }, SqlComputed ];

ExternalId

Property ExternalId As %String(MAXLEN = 2000) [ Calculated, SqlComputeCode = { set {ExternalId} = ##class(%iKnow.Queries.SourceAPI).GetExternalId({DomainId},{SourceId}) }, SqlComputed ];

FullText

Property FullText As %String(MAXLEN = "") [ Calculated, SqlComputeCode = { new txt,from,to,i,o,more  s txt = "", from=$lg(^IRIS.IK.SrcDetails({DomainId},{SourceId}),1)+1, to=from-1+$lg(^({SourceId}),2) for i = from:1:to { k o  set more = ##class(%iKnow.Queries.SentenceAPI).GetValue({DomainId},i,.o)  set o="" for { set o = $order(o(o),1,more) q:o=""  set txt = txt _ more _ " " } }  set {FullText} = $e(txt,1,*-1) }, SqlComputed ];