ModelingEvolution.PropertyKinds 1.0.0

dotnet add package ModelingEvolution.PropertyKinds --version 1.0.0
                    
NuGet\Install-Package ModelingEvolution.PropertyKinds -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ModelingEvolution.PropertyKinds" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ModelingEvolution.PropertyKinds" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="ModelingEvolution.PropertyKinds" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ModelingEvolution.PropertyKinds --version 1.0.0
                    
#r "nuget: ModelingEvolution.PropertyKinds, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ModelingEvolution.PropertyKinds@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ModelingEvolution.PropertyKinds&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=ModelingEvolution.PropertyKinds&version=1.0.0
                    
Install as a Cake Tool

ModelingEvolution.PropertyKinds

A closed, code-defined catalogue of typed property value kinds — and the search operators each one supports.

A typed property value is the pair (PropertyValueKind kind, string canonical). The set of kinds is code; the registry of properties that use them is data, and lives wherever the consuming application keeps it. Nothing in this package knows what a product, a price or an offer is.

var catalog = PropertyKindCatalog.Default;

var mass = catalog.For(PropertyValueKind.Mass);
mass.Canonicalize("500 g", null);          // "500 g"      — the vendor's unit is preserved
mass.Format("≈40 kg", null, null);         // "≈40 kg"     — and so is the vendor's hedge

Mass.Parse("500 g").Kilograms;             // 0.5m         — but the magnitude is normalised
Mass.Parse("500 g") < Mass.Parse("1 kg");  // true

Why it exists

Because a typed value that crosses a boundary as text has to be recovered from prose on the far side, and decimal.TryParse("380 A") is false. A regular expression over 30 – 380 A is not a query; it is a bug waiting for a value with a space in it.

var tested  = catalog.Facet(PropertyValueKind.Range, "30 – 380 A", null, null);
var welded  = catalog.Facet(PropertyValueKind.Range, "30 – 500 A", null, null);

tested.Supports(SearchOperator.Within);                 // true — an interval knows what it admits
tested.TryMatch(SearchOperator.Within, welded, out var inside);  // true, inside == true

The kinds

Kind Backing type Canonical Facet
Text LongText Url string as written Opaque
Integer Decimal string invariant, no grouping Scalar
Boolean string true / false Choice
Enum EnumSet string choice keys, comma-separated, in declared order Choice
Money string 3299.00 PLN Scalar (per currency)
Mass Mass 10 kg, ≈40 kg Scalar
Length Length 1300 mm, ±0.03 mm Scalar
Percent Percent 60 % Scalar
Current Voltage Frequency Current Voltage Frequency 500 A, 85 V, 25 Hz Scalar
Power Duration Power Duration 24 kVA, 450 ms Scalar
Angle Speed Angle Speed ±360°, 1.5 m/s Scalar
Size3D Size3D 620 × 300 × 480 mm Composite
Range ValueRange 30 – 500 A, 80 – 350 A+ Interval
ByteSize Size2D reserved, not implemented

The ordinals are the wire format and are frozen forever. Adding a kind is additive on both sides; reordering one silently re-types every value already stored. The package's major version bumps only if an ordinal moves, which it never does.

The operator model

Five shapes, because five is all the data has.

Shape Operators
Scalar = ≠ < ≤ > ≥, between
Interval overlaps, contains, within
Composite between (per axis), fits within
Choice in, not in, any of, all of
Opaque contains (substring)

TryMatch is total: it returns false when the question cannot be answered — an unsupported operator, the wrong operand shape, two values in incompatible units, or a tolerance compared against a magnitude — and never guesses. ±0.03 mm of repeatability is not 0.03 mm of reach, and 100 EUR does not order against 100 PLN in a package that has no exchange rate.

This is not a search engine, an index or a query language. It is the statement of which comparisons a kind admits, so that a later feature can build one.

Reading a value a newer producer wrote

A producer and a consumer deploy independently, so there is a window where the producer emits a kind the consumer does not know. Deserialising straight into the CLR enum turns that window into a parse failure, and a parse failure on a read path takes the page down.

var kind = PropertyKindRef.Read(yaml.Kind);   // never throws
kind.IsKnown;                                 // false for "Torque"
kind.Token;                                   // "Torque" — nameable in a log
kind.Display;                                 // "Torque"; "Unknown" when the token was blank
kind.ToString();                              // the serialised form, verbatim — round-trips exactly

catalog.Facet(kind, canonical, unit, choices) // PropertyFacet.None — refuses, never guesses

The row still renders: the producer emitted its own display string for the value, and that is what a reader sees. What an unknown kind cannot do is participate in a facet or a comparison.

Localised kind labels

PropertyKindDisplay.For(PropertyValueKind.Range, "pl");   // "Zakres"
PropertyKindDisplay.For(PropertyValueKind.Size3D, "pl");  // "Wymiary"

These label the kind, for a search UI's operator picker. They are not specification-table headings. A heading names a property — "Enclosure length" — and a property is a data row somebody can rename without recompiling anything. An attribute cannot label a type that did not exist when the assembly was built, which is why this package ships no language-keyed attribute for property names or enum choice labels at all: absent, so it cannot be reached for.

License

MIT.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 138 8/7/2026