load_from_rdf(folder_name, file_name, rdf_format='nt', data_home=None)¶
Load an RDF file
Loads an RDF knowledge graph using rdflib APIs. Multiple RDF serialization formats are supported (nt, ttl, rdf/xml, etc). The entire graph will be loaded in memory, and converted into an rdflib Graph object.
Large RDF graphs should be serialized to ntriples beforehand and loaded with
It is recommended to use
ampligraph.evaluation.train_test_split_no_unseen()to split custom knowledge graphs into train, validation, and test sets. Using this function will lead to validation, test sets that do not include triples with entities that do not occur in the training set.
- folder_name (str) – Base folder where the file is stored.
- file_name (str) – File name.
- rdf_format (str) – The RDF serialization format (nt, ttl, rdf/xml - see rdflib documentation).
- data_home (str) – The path to the folder that contains the datasets.
triples – the actual triples of the file.
ndarray , shape [n, 3]