Table of Contents

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

T

The 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

string

Type

Gets the declared value type.

public GraphAttributeType Type { get; }

Property Value

GraphAttributeType

Methods

Bool(string, Func<T, bool>)

Declares a boolean attribute.

public static GraphAttribute<T> Bool(string name, Func<T, bool> value)

Parameters

name string

The attribute name.

value Func<T, bool>

Reads the value off an element.

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

name string

The attribute name.

value Func<T, double>

Reads the value off an element.

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

name string

The attribute name.

value Func<T, float>

Reads the value off an element.

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

name string

The attribute name.

value Func<T, int>

Reads the value off an element.

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

name string

The attribute name.

value Func<T, long>

Reads the value off an element.

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

name string

The attribute name.

value Func<T, string>

Reads the value off an element.

Returns

GraphAttribute<T>

The attribute declaration.