rdfBag top-level constant
CollectionMapping
const rdfBag
Maps Dart collections to RDF Bag structures (unordered collections).
RDF Structure: Creates an unordered collection with rdf:Bag type
Dart Type: Works with List<T> - will lead to compile errors in generated mappers if used with other types like Set<T> or Iterable<T>.
Order: NOT preserved - explicitly indicates order is not significant
Use Case: When order doesn't matter and you want to be explicit about it
Example Usage
@RdfProperty(SchemaBook.keywords, collection: rdfBag)
final Set<String> keywords;
Generated RDF
<book> schema:keywords _:bag1 .
_:bag1 rdf:type rdf:Bag ;
rdf:_1 "keyword1" ;
rdf:_2 "keyword2" ;
rdf:_3 "keyword3" .
Underlying Mapper: RdfBagMapper<T> from locorda_rdf_mapper package
Implementation
const rdfBag = CollectionMapping.withItemMappers(RdfBagMapper);