/// <summary>Loads data from file with optional automated graph generation.</summary> /// <param name="store">Target store to be loaded with data.</param> /// <param name="file">Source file with data.</param> /// <param name="metaGraphUri">When provided, store will have automatically created graphs for all resources that are mentioned in the meta graph provided.</param> public static void LoadFromFile(this ITripleStore store, string file, Uri metaGraphUri) { ITripleStore targetStore = (metaGraphUri != null ? new TripleStore() : store); targetStore.LoadFromFile(file); if (metaGraphUri != null) { store.ExpandGraphs((TripleStore)targetStore, metaGraphUri); } }
/// <summary>Loads data from file with optional automated graph generation.</summary> /// <param name="store">Target store to be loaded with data.</param> /// <param name="resourceName">Source file with data.</param> /// <param name="metaGraphUri">When provided, store will have automatically created graphs for all resources that are mentioned in the meta graph provided.</param> public static void LoadFromEmbeddedResource(this ITripleStore store, string resourceName, Uri metaGraphUri) { ITripleStore targetStore = (metaGraphUri != null ? new TripleStore() : store); targetStore.LoadFromEmbeddedResource(resourceName); if (metaGraphUri != null) { store.ExpandGraphs((TripleStore)targetStore, metaGraphUri); } }
/// <summary>Loads data from string with optional automated graph generation.</summary> /// <param name="store">Target store to be loaded with data.</param> /// <param name="data">String with data.</param> /// <param name="parser">Store reader.</param> /// <param name="metaGraphUri">When provided, store will have automatically created graphs for all resources that are mentioned in the meta graph provided.</param> public static void LoadFromString(this ITripleStore store, string data, IStoreReader parser, Uri metaGraphUri) { ITripleStore targetStore = (metaGraphUri != null ? new TripleStore() : store); targetStore.LoadFromString(data, parser); if (metaGraphUri != null) { store.ExpandGraphs((TripleStore)targetStore, metaGraphUri); } }