PropertyTransformer
relationalai.semantics.reasoners.predictive.property_transformer
PropertyTransformer( *, text: Optional[list[Chain | Concept]] = None, category: Optional[list[Chain | Concept]] = None, datetime: Optional[list[Chain | Concept]] = None, continuous: Optional[list[Chain | Concept]] = None, integer: Optional[list[Chain | Concept]] = None, drop: Optional[list[Chain | Concept]] = None, time_col: Optional[Chain | List[Chain]] = None)Annotate concept fields with semantic types for GNN data preparation.
A PropertyTransformer tells the GNN pipeline how to encode each
column before training. Pass lists of concept fields (Concept.field
chains) or entire Concept objects to the
constructor, grouped by semantic type.
Fields that are not mentioned are auto-inferred (SemanticType.INFER).
Passing a Concept instead of a field sets
the default type for all unmentioned fields of that concept.
Parameters
Section titled “Parameters”
(textlist of Chain or Concept, default:None) - Fields containing free-form text, embedded via a language model (e.g. product names, descriptions).
(categorylist of Chain or Concept, default:None) - Fields with discrete categorical values — enum codes, boolean flags, status strings, or numeric IDs that represent categories.
(datetimelist of Chain or Concept, default:None) - Date or timestamp fields.
(continuouslist of Chain or Concept, default:None) - Numeric fields representing continuous measurements (e.g. price, age, rating).
(integerlist of Chain or Concept, default:None) - Integer fields that should be kept as integers rather than treated as categorical.
(droplist of Chain or Concept, default:None) - Fields (or entire concepts) to exclude from the model. Commonly used for primary keys, foreign keys, and target columns.
(time_colChain or list of Chain, default:None) - The column(s) used for temporal ordering in temporal models. Each concept may have at most onetime_col. Atime_colfield cannot also be dropped.
Examples
Section titled “Examples”pt = PropertyTransformer( category=[User.gender, Event.city, Event.country], continuous=[User.age, Event.lat, Event.lng], datetime=[Event.start_time], drop=[User.user_id], time_col=[Event.start_time],)Drop all fields of a concept by passing the concept itself:
pt = PropertyTransformer( category=[Article.product_code], drop=[Customer],)For columns with spaces or special characters (e.g. "weight(kg)",
"fasting blood sugar"), use getattr to reference them:
pt = PropertyTransformer( continuous=[ getattr(People, "weight(kg)"), getattr(People, "fasting blood sugar"), ])Used By
Section titled “Used By”semantics > reasoners > predictive > estimator └── GNN