RdfValue class

Marks a property within a class as the primary value source for RDF literal conversion.

This annotation is used within classes annotated with @RdfLiteral to designate which property provides the value for RDF literal serialization. The generator automatically detects the appropriate datatype from the property's type.

When the generator creates a LiteralTermMapper for a class marked with @RdfLiteral(), it uses the property marked with @RdfValue() as the source of the literal value. This means that only this property's value will be included in the RDF serialization, while other properties in the class are used only within the Dart application.

Example:

@RdfLiteral()
class Rating {
  @RdfValue() // The int value becomes the literal value
  final int stars;

  final String description; // Not included in the RDF serialization

  Rating(this.stars, this.description) {
    if (stars < 0 || stars > 5) {
      throw ArgumentError('Rating must be between 0 and 5 stars');
    }
  }
}
Implemented types

Constructors

RdfValue()
Marks a property as the value source for RDF serialization.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited