Class GraphAttribute<T>
- Namespace
- Graph1x.Serialization
- Assembly
- Graph1x.dll
A named, typed attribute read off a vertex or edge during export — the
same declaration drives GraphML (typed <key> elements) and
node-link JSON (typed properties). A null string value
omits the attribute on that element. Names must be unique per element
kind and must not collide with structural names (id,
source, target, or the weight key when a weight
selector is set).
public sealed class GraphAttribute<T>
Type Parameters
TThe vertex or edge type the attribute reads from.
- Inheritance
-
GraphAttribute<T>
- Inherited Members
Properties
Name
Gets the attribute name, used as the GraphML key and the JSON property name.
public string Name { get; }
Property Value
Type
Gets the declared value type.
public GraphAttributeType Type { get; }
Property Value
Methods
Bool(string, Func<T, bool>)
Declares a boolean attribute.
public static GraphAttribute<T> Bool(string name, Func<T, bool> value)
Parameters
Returns
- GraphAttribute<T>
The attribute declaration.
Double(string, Func<T, double>)
Declares a double-precision floating-point attribute.
public static GraphAttribute<T> Double(string name, Func<T, double> value)
Parameters
Returns
- GraphAttribute<T>
The attribute declaration.
Float(string, Func<T, float>)
Declares a single-precision floating-point attribute.
public static GraphAttribute<T> Float(string name, Func<T, float> value)
Parameters
Returns
- GraphAttribute<T>
The attribute declaration.
Int(string, Func<T, int>)
Declares a 32-bit integer attribute.
public static GraphAttribute<T> Int(string name, Func<T, int> value)
Parameters
Returns
- GraphAttribute<T>
The attribute declaration.
Long(string, Func<T, long>)
Declares a 64-bit integer attribute.
public static GraphAttribute<T> Long(string name, Func<T, long> value)
Parameters
Returns
- GraphAttribute<T>
The attribute declaration.
String(string, Func<T, string?>)
Declares a string attribute; a null value omits it on that element.
public static GraphAttribute<T> String(string name, Func<T, string?> value)
Parameters
Returns
- GraphAttribute<T>
The attribute declaration.