sparkkgml.semantification
Classes
The Semantification class is designed to semantify data by creating an RDF graph and serializing it to a destination file. |
Module Contents
- class sparkkgml.semantification.Semantification[source]
The Semantification class is designed to semantify data by creating an RDF graph and serializing it to a destination file.
Attributes: - _graph (rdflib.Graph): The RDF graph used to store the semantified data.
Methods: - __init__(): Initializes the Semantification class by creating an empty RDF graph. - get_graph(): Retrieves the RDF graph. - set_graph(graph): Sets the RDF graph to the specified graph. - semantify(df, namespace, exp_uri=’uri’, exp_label=’label’, exp_prediction=’prediction’, dest=’experiment.ttl’):
Semantifies the given DataFrame by adding the data to the RDF graph and serializing it.
- _graph
- semantify(df, namespace, exp_uri='uri', exp_label='label', exp_prediction='prediction', dest='experiment.ttl')[source]
Semantifies the given DataFrame by creating an RDF graph and serializing it to a destination file.
Parameters: - df (pyspark.sql.DataFrame): The DataFrame containing the data to semantify. - namespace (str): The namespace string used to define RDF namespaces for the experiment. - exp_uri_column (str): The column name in the DataFrame representing the URI of each instance. - exp_label_column (str): The column name in the DataFrame representing the label of each instance. - exp_prediction_column (str): The column name in the DataFrame representing the prediction of each instance. - dest (str): The destination file path where the RDF graph will be serialized. Default is ‘experiment.ttl’.
Returns: None