@hydra-cg/heracles.ts > MappingsCollection
Provides a collection of IIriTemplateMapping that can be filtered with relevant criteria.
class:
↳ ResourceFilterableCollection<IIriTemplateMapping>
↳ MappingsCollection
⊕ new MappingsCollection(mappings?: Iterable
<IIriTemplateMapping>): MappingsCollection
Overrides ResourceFilterableCollection.constructor
Defined in DataModel/Collections/MappingsCollection.ts:8
Initializes a new instance of the MappingsCollection class with initial collections of mappings to filter.
Parameters:
Name | Type |
---|---|
Optional mappings |
Iterable <IIriTemplateMapping> |
Returns: MappingsCollection
get length(): number
Inherited from FilterableCollection.length
Defined in DataModel/Collections/FilterableCollection.ts:38
Gets the number of items in this collection.
readonly:
Returns: number
▸ __@iterator(): Iterator
<IIriTemplateMapping>
Inherited from FilterableCollection.[@iterator](/Heracles.ts/classes/filterablecollection.html#_iterator)
Defined in DataModel/Collections/FilterableCollection.ts:111
inheritdoc:
Returns: Iterator
<IIriTemplateMapping>
▸ any(): boolean
Inherited from FilterableCollection.any
Defined in DataModel/Collections/FilterableCollection.ts:52
Checks whether this collection has any items fitlered.
Returns: boolean
<Protected>
createInstance▸ createInstance(items: Iterable
<IIriTemplateMapping>): MappingsCollection
Overrides ResourceFilterableCollection.createInstance
Defined in DataModel/Collections/MappingsCollection.ts:49
Parameters:
Name | Type |
---|---|
items | Iterable <IIriTemplateMapping> |
Returns: MappingsCollection
▸ first(): IIriTemplateMapping
Inherited from FilterableCollection.first
Defined in DataModel/Collections/FilterableCollection.ts:60
Gets the first item of the collection or null if there are no items matching the criteria.
Returns: IIriTemplateMapping
▸ last(): IIriTemplateMapping
Inherited from FilterableCollection.last
Defined in DataModel/Collections/FilterableCollection.ts:69
Gets the last item of the collection or null if there are no items matching the criteria.
Returns: IIriTemplateMapping
<Protected>
narrowFiltersWith▸ narrowFiltersWith<TValue
>(predicate: string
, matchEvaluator: function
): FilterableCollection<IIriTemplateMapping>
▸ narrowFiltersWith(predicate: string
, value: string
| RegExp
): FilterableCollection<IIriTemplateMapping>
Inherited from FilterableCollection.narrowFiltersWith
Defined in DataModel/Collections/FilterableCollection.ts:129
Creates a new instance of the FilterableCollection with filter made narrower with given predicate.
Type parameters:
Parameters:
Name | Type | Description |
---|---|---|
predicate | string |
Predicate of the filter. |
matchEvaluator | function |
Match evaluator of the predicate to filter. |
Returns: FilterableCollection<IIriTemplateMapping>
Inherited from FilterableCollection.narrowFiltersWith
Defined in DataModel/Collections/FilterableCollection.ts:140
Creates a new instance of the FilterableCollection with filter made narrower with given predicate.
Parameters:
Name | Type | Description |
---|---|---|
predicate | string |
Predicate of the filter. |
value | string | RegExp |
Either value or regular expression to match the value of the predicate to filter. |
Returns: FilterableCollection<IIriTemplateMapping>
▸ nonBlank(): ResourceFilterableCollection<IIriTemplateMapping>
Inherited from ResourceFilterableCollection.nonBlank
Defined in DataModel/Collections/ResourceFilterableCollection.ts:50
Obtains a collection of resources being non blank nodes;
Returns: ResourceFilterableCollection<IIriTemplateMapping>
▸ ofIri(iri: string
): ResourceFilterableCollection<IIriTemplateMapping>
Inherited from ResourceFilterableCollection.ofIri
Defined in DataModel/Collections/ResourceFilterableCollection.ts:37
Obtains a collection of resources of a given Iri;
Parameters:
Name | Type | Description |
---|---|---|
iri | string |
Iri of the resources. |
Returns: ResourceFilterableCollection<IIriTemplateMapping>
▸ ofProperty(property: string
): MappingsCollection
Defined in DataModel/Collections/MappingsCollection.ts:37
Obtains a collection of mappings for a given predicate.
Parameters:
Name | Type | Description |
---|---|---|
property | string |
Predicate IRI. |
Returns: MappingsCollection
▸ ofType(iri: string
): ResourceFilterableCollection<IIriTemplateMapping>
Inherited from ResourceFilterableCollection.ofType
Defined in DataModel/Collections/ResourceFilterableCollection.ts:23
Obtains a collection of resources of a given type;
Parameters:
Name | Type | Description |
---|---|---|
iri | string |
Type of the resources. |
Returns: ResourceFilterableCollection<IIriTemplateMapping>
▸ ofVariableName(variableName: string
): MappingsCollection
Defined in DataModel/Collections/MappingsCollection.ts:23
Obtains a collection of mappings for a given variable name.
Parameters:
Name | Type | Description |
---|---|---|
variableName | string |
Variable name. |
Returns: MappingsCollection
▸ toArray(): IIriTemplateMapping[]
Inherited from FilterableCollection.toArray
Defined in DataModel/Collections/FilterableCollection.ts:101
Flattens this collection to a standard array.
Returns: IIriTemplateMapping[]
▸ where(matchEvaluator: function
): FilterableCollection<IIriTemplateMapping>
Inherited from FilterableCollection.where
Defined in DataModel/Collections/FilterableCollection.ts:83
Filters the collection with a generic match evaluator.
Parameters:
Name | Type | Description |
---|---|---|
matchEvaluator | function |
Match evaluation delegate. |
Returns: FilterableCollection<IIriTemplateMapping>