/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins: collections of unique values keyed under these /// IDs: <c>title</c> (filtered, including digits) and <c>date-value</c>, /// plus a list of participant IDs in <c>pid</c>. /// </returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder( DataPinHelper.DefaultFilter); builder.Set("tot", Dedications?.Count ?? 0, false); foreach (LitDedication dedication in Dedications) { builder.AddValue("title", dedication.Title, filter: true, filterOptions: true); if (dedication.Date != null) { builder.AddValue("date-value", dedication.Date.GetSortValue()); } if (dedication.Participants?.Count > 0) { builder.AddValues("pid", dedication.Participants.Select(p => p.Id)); } } return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins: <c>tot-count</c> and a collection of pins with /// these keys: <c>id</c>.</returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder(); builder.Set("tot", Hands?.Count ?? 0, false); if (Hands?.Count > 0) { foreach (MsHand hand in Hands) { if (!string.IsNullOrEmpty(hand.Id)) { builder.AddValue("id", hand.Id); } if (!string.IsNullOrEmpty(hand.PersonId)) { builder.AddValue("person-id", hand.PersonId); } if (hand.Types?.Count > 0) { foreach (string type in hand.Types) { builder.AddValue("type", type); } } } } return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins: <c>tot-count</c>, <c>palimpsest</c> (true if any), /// and a collection of pins with these keys: <c>material</c>, /// <c>sheet-count</c>, <c>guard-sheet-count</c>.</returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder(); builder.Set("tot", Units?.Count ?? 0, false); if (Units?.Count > 0) { bool pal = false; foreach (MsUnit unit in Units) { if (!pal && unit.Palimpsests?.Count > 0) { pal = true; } builder.AddValue("material", unit.Material); if (unit.SheetCount > 0) { builder.AddValue("sheet-count", unit.SheetCount); } if (unit.GuardSheetCount > 0) { builder.AddValue("guard-sheet-count", unit.GuardSheetCount); } } builder.AddValue("palimpsest", pal); } return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins: <c>tot-count</c>; a list of unique <c>author</c> /// <c>claimed-author</c>'s, and <c>work</c>'s (all filtered, with digits). /// </returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder(DataPinHelper.DefaultFilter); builder.Set("tot", Contents?.Count ?? 0, false); if (Contents?.Count > 0) { foreach (MsContent content in Contents) { builder.AddValue("author", content.Author, filter: true, filterOptions: true); if (!string.IsNullOrEmpty(content.ClaimedAuthor)) { builder.AddValue("claimed-author", content.ClaimedAuthor, filter: true, filterOptions: true); } builder.AddValue("work", content.Work, filter: true, filterOptions: true); } } return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins.</returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder( DataPinHelper.DefaultFilter); if (Subjects?.Count > 0) { builder.AddValues("subject", Subjects); } if (Date != null) { builder.AddValue("date-value", Date.GetSortValue()); } if (!string.IsNullOrEmpty(Color)) { builder.AddValue("color", Color, filter: true, filterOptions: true); } if (Links?.Count > 0) { builder.AddValues("target-id", Links.Select(l => l.Id)); } return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins: <c>tot-count</c>, <c>dubious-count</c>, /// <c>lost-count</c>, and a list with <c>title</c> (filtered, with /// digits), <c>genre</c>, <c>language</c>.</returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder( DataPinHelper.DefaultFilter); // tot-count builder.Set("tot", Works?.Count ?? 0, false); // dubious-count builder.Set("dubious", Works?.Count(w => w.IsDubious) ?? 0, false); // lost-count builder.Set("lost", Works?.Count(w => w.IsLost) ?? 0, false); if (Works?.Count > 0) { foreach (PersonWork work in Works) { // title builder.AddValues("title", work.Titles, filter: true, filterOptions: true); // genre builder.AddValue("genre", work.Genre); // language builder.AddValue("language", work.Language); } } return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins.</returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder( new StandardDataPinTextFilter()); builder.AddValue("id", GraffitiId); if (!string.IsNullOrEmpty(Language)) { builder.AddValue("language", Language); } if (!string.IsNullOrEmpty(Verse)) { builder.AddValue("verse", Verse); } if (!string.IsNullOrEmpty(Author)) { builder.AddValue("author", Author, filter: true, filterOptions: true); } if (Identifications?.Count > 0) { builder.AddValues("pid", Identifications.Select(i => i.Id)); } if (Date != null) { builder.AddValue("date-value", Date.GetSortValue()); } return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins: <c>fr.tag</c>=tag if any.</returns> public IEnumerable <DataPin> GetDataPins(IItem item = null) { DataPinBuilder builder = new DataPinBuilder( new StandardDataPinTextFilter()); // fr-tot-count builder.Set(PartBase.FR_PREFIX + "tot", Interpolations?.Count ?? 0, false); if (Interpolations?.Count > 0) { foreach (Interpolation entry in Interpolations) { // fr-language if (entry.Languages?.Length > 0) { builder.AddValues(PartBase.FR_PREFIX + "language", entry.Languages); } // fr-value builder.AddValue(PartBase.FR_PREFIX + "value", entry.Value, filter: true); // fr-tag builder.AddValue(PartBase.FR_PREFIX + "tag", entry.Tag); // fr-role builder.AddValue(PartBase.FR_PREFIX + "role", entry.Role); } } return(builder.Build(null)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins: <c>tot-count</c>, and lists of pins with keys: /// <c>tag-TAG-count</c>, <c>library</c> (filtered, with digits), /// <c>city</c> (filtered). /// </returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder( DataPinHelper.DefaultFilter); builder.Set("tot", Signatures?.Count ?? 0, false); if (Signatures?.Count > 0) { foreach (MsSignature signature in Signatures) { builder.Increase(signature.Tag, false, "tag-"); if (!string.IsNullOrEmpty(signature.Library)) { builder.AddValue("library", signature.Library, filter: true, filterOptions: true); } if (!string.IsNullOrEmpty(signature.City)) { builder.AddValue("city", signature.City, filter: true); } } } return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins: <c>tot-count</c> and a collection of pins with /// these keys: <c>role</c>, <c>language</c>, <c>type</c>, /// <c>hand-id</c>.</returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder(); builder.Set("tot", Scripts?.Count ?? 0, false); if (Scripts?.Count > 0) { foreach (MsScript script in Scripts) { builder.AddValue("role", script.Role); if (script.Languages?.Count > 0) { builder.AddValues("language", script.Languages); } builder.AddValue("type", script.Type); if (script.Hands?.Count > 0) { builder.AddValues("hand-id", script.Hands.Select(h => h.Id)); } } } return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins: <c>tot-count</c>, and a collection of pins with /// keys: <c>subject-X-count</c>, <c>place</c> (filtered, with digits), /// <c>date-value</c>.</returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder( DataPinHelper.DefaultFilter); builder.Set("tot", Watermarks?.Count ?? 0, false); if (Watermarks?.Count > 0) { foreach (MsWatermark watermark in Watermarks) { builder.Increase(watermark.Subject, false, "subject-"); if (!string.IsNullOrEmpty(watermark.Place)) { builder.AddValue("place", watermark.Place, filter: true, filterOptions: true); } if (watermark.Date != null) { builder.AddValue("date-value", watermark.Date.GetSortValue()); } } } return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins: a collection of pins with keys: /// <c>tot-count</c>=total count of exchanges in the part; /// <c>dubious-count</c>, <c>indirect-count</c>, <c>incoming-count</c>, /// <c>{TAG}-date-value</c>, <c>{TAG}-place</c> (filtered, including /// digits), <c>participant.ROLE</c> (filtered including digits), /// <c>att-TYPE-count</c>=count of attachment of type TYPE (one count /// for each distinct type found in the part), <c>att-tot-count</c>= /// total count of attachments.</returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder(DataPinHelper.DefaultFilter); builder.Set("tot", Exchanges?.Count ?? 0, false); foreach (CorrExchange exchange in Exchanges) { if (exchange.IsDubious) { builder.Increase("dubious", false); } if (exchange.IsIndirect) { builder.Increase("indirect", false); } if (exchange.IsFromParticipant) { builder.Increase("incoming", false); } if (exchange.Chronotopes?.Count > 0) { foreach (Chronotope c in exchange.Chronotopes) { string tag = c.Tag?.ToLowerInvariant() ?? ""; if (c.Date != null) { builder.AddValue("date-value." + tag, c.Date.GetSortValue()); } if (!string.IsNullOrEmpty(c.Place)) { builder.AddValue("place." + tag, c.Place, filter: true, filterOptions: true); } } } if (exchange.Participants?.Count > 0) { foreach (var p in exchange.Participants) { builder.AddValue($"participant.{p.Tag ?? ""}", p.Id, filter: true, filterOptions: true); } } if (exchange.Attachments?.Count > 0) { builder.Increase(from a in exchange.Attachments select a.Type, true, "att-"); } } return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins.</returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder( DataPinHelper.DefaultFilter); builder.AddValue("prison-id", PrisonId); builder.AddValue("cell", Cell); builder.AddValue("loc", Location); return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins: <c>fr.tag</c>=tag if any.</returns> public IEnumerable <DataPin> GetDataPins(IItem item = null) { DataPinBuilder builder = new DataPinBuilder( DataPinHelper.DefaultFilter); builder.AddValue(PartBase.FR_PREFIX + "value", Value, filter: true, filterOptions: true); builder.AddValue(PartBase.FR_PREFIX + "u-value", Value); builder.AddValue(PartBase.FR_PREFIX + "n-value", NormValue); return(builder.Build(null)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins.</returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder( DataPinHelper.DefaultFilter); builder.AddValue("id", PrisonId); if (!string.IsNullOrEmpty(Place)) { builder.AddValue("place", Place, filter: true, filterOptions: true); } return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins: <c>sheet-count</c>, <c>guard-sheet-count</c>, /// <c>section-count</c>, and a list with keys: <c>section-TAG-count</c>, /// <c>section-label</c> (filtered, with digits), /// <c>section-date-value</c>, <c>guard-material</c> (filtered, with /// digits), <c>guard-date-value</c>. /// </returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder(DataPinHelper.DefaultFilter); builder.Set("sheet", SheetCount, false); builder.Set("guard-sheet", GuardSheetCount, false); builder.Set("section", Sections?.Count ?? 0, false); if (GuardSheets?.Count > 0) { foreach (MsGuardSheet guard in GuardSheets) { if (!string.IsNullOrEmpty(guard.Material)) { builder.AddValue("guard-material", guard.Material, filter: true, filterOptions: true); } if (guard.Date != null) { builder.AddValue("guard-date-value", guard.Date.GetSortValue()); } } } if (Sections?.Count > 0) { foreach (MsSection section in Sections) { builder.Increase(section.Tag, false, "section-"); if (!string.IsNullOrEmpty(section.Label)) { builder.AddValue("section-label", section.Label, filter: true, filterOptions: true); } if (section.Date != null) { builder.AddValue("section-date-value", section.Date.GetSortValue()); } } } return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins: <c>tot-count</c> and a collection of pins with /// these keys: <c>type-X-count</c>, <c>subject-X-count</c>, /// <c>color-X-count</c>, (all the keys with X are filtered, with digits), /// <c>artist-id</c> (filtered, with digits). /// </returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder( DataPinHelper.DefaultFilter); builder.Set("tot", Decorations?.Count ?? 0, false); if (Decorations?.Count > 0) { foreach (MsDecoration decoration in Decorations) { builder.Increase( DataPinHelper.DefaultFilter.Apply(decoration.Type, true), false, "type-"); if (decoration.Date != null) { builder.AddValue("date-value", decoration.Date.GetSortValue()); } foreach (MsDecorationElement element in decoration?.Elements) { builder.Increase( DataPinHelper.DefaultFilter.Apply(element.Subject, true), false, "subject-"); foreach (string color in element.Colors) { builder.Increase( DataPinHelper.DefaultFilter.Apply(color, true), false, "color-"); } } if (!string.IsNullOrEmpty(decoration.Artist?.Id)) { builder.AddValue("artist-id", decoration.Artist.Id, filter: true, filterOptions: true); } } } return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins: <c>person-id</c>; <c>job</c> (filtered, with digits). /// </returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder( DataPinHelper.DefaultFilter); if (!string.IsNullOrEmpty(PersonId)) { builder.AddValue("person-id", PersonId); } if (!string.IsNullOrEmpty(Job)) { builder.AddValue("job", Job, filter: true, filterOptions: true); } return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins.</returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder( new StandardDataPinTextFilter()); // tot-count builder.Set("tot", Contents?.Count ?? 0, false); if (Contents?.Count > 0) { foreach (var content in Contents) { builder.AddValue("work", content.Work); builder.AddValue("title", content.Title, filter: true, filterOptions: true); } } return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins: <c>material</c> (filtered, with digits), /// <c>format</c> (filtered, with digits), <c>state</c> (filtered, with /// digits), <c>c-X-count</c> for counts, <c>palimpsest-count</c>. /// </returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder( DataPinHelper.DefaultFilter); builder.Set("palimpsest", Palimpsests?.Count ?? 0, false); builder.AddValue("material", builder.Filter.Apply(Material, true)); builder.AddValue("format", builder.Filter.Apply(Format, true)); builder.AddValue("state", builder.Filter.Apply(State, true)); if (Counts?.Count > 0) { foreach (var count in Counts) { builder.Set(count.Id, count.Value, false, "c-"); } } return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins: <c>tot-count</c> and a collection of pins with /// these keys: <c>lid</c>, <c>lemma</c>, <c>u-lemma</c>, <c>pos</c>, /// <c>variant</c>, <c>u-variant</c>.</returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder( DataPinHelper.DefaultFilter); builder.Set("tot", Forms?.Count ?? 0, false); if (Forms?.Count > 0) { foreach (WordForm form in Forms) { builder.AddValue("lid", form.Lid); builder.AddValue("lemma", form.Lemma, filter: true, filterOptions: true); builder.AddValue("u-lemma", form.Lemma); builder.AddValue("pos", form.Pos); if (form.Variants?.Count > 0) { foreach (var v in form.Variants) { builder.AddValue("variant", v.Value, filter: true, filterOptions: true); builder.AddValue("u-variant", v.Value); } } } } return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins: <c>tot-count</c> and a collection of pins with /// these keys: ....</returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder( new StandardDataPinTextFilter()); builder.Set("tot", Places?.Count ?? 0, false); if (Places?.Count > 0) { foreach (var place in Places) { if (!string.IsNullOrEmpty(place.Area)) { builder.AddValue("area", place.Area, filter: true, filterOptions: true); } if (!string.IsNullOrEmpty(place.City)) { builder.AddValue("city", place.City, filter: true, filterOptions: true); } if (!string.IsNullOrEmpty(place.Address)) { builder.AddValue("address", place.Address); int n = 0; foreach (string c in place.Address.Split(',')) { builder.AddValue($"address-{++n}", c.Trim(), filter: true, filterOptions: true); } } } } return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins: <c>tot-count</c>, and a collection of pins /// with keys: <c>era-X-count</c>, <c>sys-X-count</c>, /// <c>tech-X-count</c>, <c>century</c>, <c>position</c>. /// </returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder(); builder.Set("tot", Numberings?.Count ?? 0, false); if (Numberings?.Count > 0) { foreach (MsNumbering numbering in Numberings) { if (!string.IsNullOrEmpty(numbering.Era)) { builder.Increase(numbering.Era, false, "era-"); } if (!string.IsNullOrEmpty(numbering.System)) { builder.Increase(numbering.System, false, "sys-"); } if (!string.IsNullOrEmpty(numbering.Technique)) { builder.Increase(numbering.Technique, false, "tech-"); } if (numbering.Century != 0) { builder.AddValue("century", numbering.Century); } if (!string.IsNullOrEmpty(numbering.Position)) { builder.AddValue("position", numbering.Position); } } } return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins: list with these keys: <c>cols</c>=columns count; /// <c>ruling</c>=ruling technique; <c>derolez</c>=Derolez classification; /// <c>pricking</c>=pricking; <c>d.{TAG}</c>=dimensions.</returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder(); if (Layouts?.Count > 0) { foreach (MsLayout layout in Layouts) { builder.AddValue("cols", layout.ColumnCount); if (!string.IsNullOrEmpty(layout.RulingTechnique)) { builder.AddValue("ruling", layout.RulingTechnique); } if (!string.IsNullOrEmpty(layout.Derolez)) { builder.AddValue("derolez", layout.Derolez); } if (!string.IsNullOrEmpty(layout.Pricking)) { builder.AddValue("pricking", layout.Pricking); } if (layout.Dimensions?.Count > 0) { foreach (PhysicalDimension dim in layout.Dimensions) { builder.AddValue($"d.{dim.Tag ?? "-"}", dim.Value.ToString("00.0", CultureInfo.InvariantCulture)); } } } } return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins: <c>fr.tag</c>=tag if any.</returns> public IEnumerable <DataPin> GetDataPins(IItem item = null) { DataPinBuilder builder = new DataPinBuilder( new StandardDataPinTextFilter()); // fr-tot-count builder.Set(PartBase.FR_PREFIX + "tot", Quotations?.Count ?? 0, false); if (Quotations?.Count > 0) { foreach (VarQuotation entry in Quotations) { // fr-tag builder.AddValue(PartBase.FR_PREFIX + "tag", entry.Tag); // fr-authority builder.AddValue(PartBase.FR_PREFIX + "authority", entry.Authority); // fr-work builder.AddValue(PartBase.FR_PREFIX + "work", entry.Work); if (entry.Variants?.Count > 0) { foreach (QuotationVariant variant in entry.Variants) { // fr-var-lemma (filtered) builder.AddValue(PartBase.FR_PREFIX + "var-lemma", variant.Lemma, filter: true); // fr-var-value (filtered) builder.AddValue(PartBase.FR_PREFIX + "var-value", variant.Value, filter: true); } } } } return(builder.Build(null)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins: <c>tot-count</c> and a list of pins under these /// keys: <c>tag-place</c>=TAG:place (place filtered, with digits), /// <c>tag-date</c>=TAG:normalized date value, <c>date-value</c>, /// <c>tag-VALUE-count</c>. /// The normalized date value is a fixed-format number of type /// +0000.00 or -0000.00 allowing a text sort. /// </returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder( DataPinHelper.DefaultFilter); builder.Set("tot", Chronotopes?.Count ?? 0, false); if (Chronotopes?.Count > 0) { foreach (Chronotope coords in Chronotopes) { builder.Increase(coords.Tag, false, "tag-"); string tag = coords.Tag ?? ""; if (!string.IsNullOrEmpty(coords.Place)) { builder.AddValue( "tag-place", builder.ApplyFilter(options: true, tag + ":", true, coords.Place)); } if (coords.Date != null) { double d = coords.Date.GetSortValue(); builder.AddValue("date-value", d); builder.AddValue( "tag-date", $"{tag}:{+d:0000.00;-d:0000.00}"); } } } return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins: <c>tot-count</c> and a collection of pins with /// these keys: <c>hand-id</c>.</returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder(); builder.Set("tot", Features?.Count ?? 0, false); if (Features?.Count > 0) { foreach (MsFormalFeature feature in Features) { builder.AddValue("hand-id", feature.HandId); } } return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins: collections of unique values keyed under these /// IDs: <c>tot-count</c>=total events count, <c>type-TAG-count</c>, /// <c>date-value</c>, <c>place</c> (filtered, with digits), /// <c>participant</c> (filtered, with digits, prefixed by tag + /// <c>:</c>).</returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder( DataPinHelper.DefaultFilter); builder.Set("tot", Events?.Count ?? 0, false); if (Events?.Count > 0) { foreach (BioEvent e in Events) { if (!string.IsNullOrEmpty(e.Type)) { builder.Increase(e.Type, false, "type-"); } if (e.Date != null) { builder.AddValue("date-value", e.Date.GetSortValue()); } if (e.Places?.Count > 0) { builder.AddValues("place", e.Places, filter: true, filterOptions: true); } if (e.Participants?.Count > 0) { builder.AddValues("participant", from p in e.Participants select builder.ApplyFilter(options: true, p.Tag + ":", true, p.Id)); } } } return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins: <c>tot-count</c> and lists of pins under keys: /// <c>name</c>=full name (filtered), <c>id</c>=identification.</returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder( DataPinHelper.DefaultFilter); builder.Set("tot", Persons?.Count ?? 0, false); if (Persons?.Count > 0) { foreach (CitedPerson person in Persons) { builder.AddValue("name", person.Name?.GetFullName(), filter: true); if (person.Ids != null) { builder.AddValues("id", from ident in person.Ids select ident.Id); } } } return(builder.Build(this)); }
/// <summary> /// Get all the key=value pairs (pins) exposed by the implementor. /// </summary> /// <param name="item">The optional item. The item with its parts /// can optionally be passed to this method for those parts requiring /// to access further data.</param> /// <returns>The pins: <c>area</c> (filtered, with digits), /// <c>pers-count</c>, <c>ann-count</c>, <c>rest-count</c>, /// <c>pers-name</c> (full name; filtered, with digits), /// <c>pers-date-value</c>, <c>ann-X-count</c>, <c>rest-X-count</c>, /// <c>rest-date-value</c>.</returns> public override IEnumerable <DataPin> GetDataPins(IItem item) { DataPinBuilder builder = new DataPinBuilder(DataPinHelper.DefaultFilter); if (Provenances?.Count > 0) { builder.AddValues("area", Provenances.Select(p => p.Area), filter: true, filterOptions: true); } builder.Set("pers", Persons?.Count ?? 0, false); builder.Set("ann", Annotations?.Count ?? 0, false); builder.Set("rest", Restorations?.Count ?? 0, false); if (Persons?.Count > 0) { builder.AddValues("pers-name", from p in Persons where p.Name != null select p.Name.GetFullName(), filter: true, filterOptions: true); foreach (var person in Persons.Where(p => p.Date != null)) { builder.AddValue("pers-date-value", person.Date.GetSortValue()); } } if (Annotations?.Count > 0) { foreach (var annotation in Annotations) { string id = SanitizeForPinId(annotation.Type); if (id != null) { builder.Increase(id, false, "ann-"); } } } if (Restorations?.Count > 0) { foreach (var restoration in Restorations) { string id = SanitizeForPinId(restoration.Type); if (id != null) { builder.Increase(id, false, "rest-"); } if (restoration.Date != null) { builder.AddValue("rest-date-value", restoration.Date.GetSortValue()); } } } return(builder.Build(this)); }