public override object Query(string sparqlQuery) { if (this._processor == null) { AlexandriaFileDataset dataset = new AlexandriaFileDataset(this); this._processor = new LeviathanQueryProcessor(dataset); } if (this._parser == null) { this._parser = new SparqlQueryParser(); } return(this._processor.ProcessQuery(this._parser.ParseFromString(sparqlQuery))); }
public override void Query(IRdfHandler rdfHandler, ISparqlResultsHandler resultsHandler, string sparqlQuery) { if (this._processor == null) { AlexandriaFileDataset dataset = new AlexandriaFileDataset(this); this._processor = new LeviathanQueryProcessor(dataset); } if (this._parser == null) { this._parser = new SparqlQueryParser(); } this._processor.ProcessQuery(rdfHandler, resultsHandler, this._parser.ParseFromString(sparqlQuery)); }
public bool TryLoadObject(IGraph g, INode objNode, Type targetType, out object obj) { switch (targetType.FullName) { case FileManager: String storeID = ConfigurationLoader.GetConfigurationString(g, objNode, ConfigurationLoader.CreateConfigurationNode(g, ConfigurationLoader.PropertyDatabase)); if (storeID != null) { //Supports using dnr:loadMode to specify the indexes to be used String indices = ConfigurationLoader.GetConfigurationString(g, objNode, ConfigurationLoader.CreateConfigurationNode(g, ConfigurationLoader.PropertyLoadMode)); if (indices == null) { obj = new AlexandriaFileManager(ConfigurationLoader.ResolvePath(storeID)); } else { obj = new AlexandriaFileManager(ConfigurationLoader.ResolvePath(storeID), this.ParseIndexTypes(indices)); } return true; } //If we get here then the required dnr:database property was missing throw new DotNetRdfConfigurationException("Unable to load the File Manager identified by the Node '" + objNode.ToString() + "' since there was no value given for the required property dnr:database"); break; case FileDataset: INode managerNode = ConfigurationLoader.GetConfigurationNode(g, objNode, ConfigurationLoader.CreateConfigurationNode(g, "dnr:genericManager")); if (managerNode == null) { throw new DotNetRdfConfigurationException("Unable to load the File Dataset identified by the Node '" + objNode.ToString() + "' since there we no value for the required property dnr:genericManager"); } Object temp = ConfigurationLoader.LoadObject(g, managerNode); if (temp is AlexandriaFileManager) { obj = new AlexandriaFileDataset((AlexandriaFileManager)temp); return true; } else { throw new DotNetRdfConfigurationException("Unable to load the File Dataset identified by the Node '" + objNode.ToString() + "' since the value for the dnr:genericManager property pointed to an Object which could not be loaded as an object of type AlexandriaFileManager"); } break; } obj = null; return false; }
public bool TryLoadObject(IGraph g, INode objNode, Type targetType, out object obj) { switch (targetType.FullName) { case FileManager: String storeID = ConfigurationLoader.GetConfigurationString(g, objNode, ConfigurationLoader.CreateConfigurationNode(g, ConfigurationLoader.PropertyDatabase)); if (storeID != null) { //Supports using dnr:loadMode to specify the indexes to be used String indices = ConfigurationLoader.GetConfigurationString(g, objNode, ConfigurationLoader.CreateConfigurationNode(g, ConfigurationLoader.PropertyLoadMode)); if (indices == null) { obj = new AlexandriaFileManager(ConfigurationLoader.ResolvePath(storeID)); } else { obj = new AlexandriaFileManager(ConfigurationLoader.ResolvePath(storeID), this.ParseIndexTypes(indices)); } return true; } //If we get here then the required dnr:database property was missing throw new DotNetRdfConfigurationException("Unable to load the File Manager identified by the Node '" + objNode.ToString() + "' since there was no value given for the required property dnr:database"); break; case FileDataset: INode managerNode = ConfigurationLoader.GetConfigurationNode(g, objNode, ConfigurationLoader.CreateConfigurationNode(g, "dnr:genericManager")); if (managerNode == null) { throw new DotNetRdfConfigurationException("Unable to load the File Dataset identified by the Node '" + objNode.ToString() + "' since there we no value for the required property dnr:genericManager"); } Object temp = ConfigurationLoader.LoadObject(g, managerNode); if (temp is AlexandriaFileManager) { obj = new AlexandriaFileDataset((AlexandriaFileManager)temp); return true; } else { throw new DotNetRdfConfigurationException("Unable to load the File Dataset identified by the Node '" + objNode.ToString() + "' since the value for the dnr:genericManager property pointed to an Object which could not be loaded as an object of type AlexandriaFileManager"); } break; } obj = null; return false; }