RDF Mapper Generator

Zero-Boilerplate RDF Mapping for Dart

pub package build status coverage

Transform your Dart classes into RDF mappers with simple annotations. Type-safe, compile-time code generation with lossless mapping capabilities for seamless RDF integration.

Why Choose RDF Mapper Generator?

Modern, type-safe RDF mapping with zero runtime overhead

πŸ”₯

Zero Boilerplate

Write business logic, not serialization code. Simple annotations generate complete mapping solutions.

πŸ›‘οΈ

Type Safety

Compile-time guarantees for your RDF mappings. Catch errors before they reach production.

⚑

Optimized Generation

Generated code with no runtime overhead. Smart regex patterns and efficient serialization.

🎯

Schema.org Support

First-class support for Schema.org vocabularies through rdf_vocabularies integration.

πŸ”§

Flexible Mapping

Custom mappers, IRI templates, context variables, and complex relationship handling.

πŸ”„

Lossless Mapping

Perfect round-trip serialization with @RdfUnmappedTriples. Preserve all RDF data, not just mapped properties.

πŸ—οΈ

Build Integration

Seamless integration with build_runner. Generate mappers as part of your build process.

From Annotation to Mapper

Transform your Dart classes into powerful RDF mappers with just a few annotations. The generator handles all the complexity behind the scenes, including lossless mapping to preserve all RDF data during serialization and deserialization.

  1. 1 Annotate your classes
  2. 2 Run build_runner
  3. 3 Use generated mappers
View Documentation
book.dart
@RdfGlobalResource(
  SchemaBook.classIri,
  IriStrategy('https://example.org/books/{isbn}'),
)
class Book {
  @RdfIriPart()
  final String isbn;

  @RdfProperty(SchemaBook.name)
  final String title;

  @RdfProperty(SchemaBook.author)
  final String author;

  @RdfProperty(SchemaBook.datePublished)
  final DateTime published;

  // Lossless mapping - preserve all RDF data
  @RdfUnmappedTriples()
  final RdfGraph unmappedTriples;

  Book({
    required this.isbn,
    required this.title,
    required this.author,
    required this.published,
    required this.unmappedTriples,
  });
}

v0.2.1

Latest Version

100%

Type Safe

Zero

Runtime Overhead

17+

Mapping Features

Complete RDF Ecosystem

Part of a comprehensive suite of RDF tools for Dart

rdf_core

Core graph classes and serialization support for Turtle, JSON-LD, and N-Triples formats.

^0.9.3

rdf_mapper

Runtime mapping system between Dart objects and RDF with powerful serialization capabilities.

^0.8.6

rdf_mapper_annotations

Annotation definitions for configuring RDF mappings with flexible options.

^0.2.1

rdf_vocabularies

Constants for common RDF vocabularies including Schema.org, FOAF, and Dublin Core.

^0.3.0

rdf_xml

RDF/XML format support for reading and writing XML-based RDF serializations.

Latest

rdf_vocabulary_to_dart

Generate Dart constants for custom RDF vocabularies and ontologies.

Latest